-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec.cy.js
33 lines (29 loc) · 1.09 KB
/
spec.cy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
describe('Home Page Tests', () => {
it('should load the home page successfully', () => {
cy.visit('https://www.conqt.com/');
cy.url().should('include', 'conqt.com');
});
it('should validate API endpoint', () => {
cy.request('GET', 'https://api.conqt.com/home')
.its('status')
.should('equal', 200);
});
it('should check data consistency', () => {
cy.request('GET', 'https://api.conqt.com/home').then((response) => {
const apiData = response.body;
cy.visit('https://www.conqt.com/');
cy.get('.some-element').should('contain', apiData.someValue);
});
});
it('should have sufficient color contrast', () => {
cy.visit('https://www.conqt.com/');
cy.get('body').should('have.css', 'background-color', 'rgb(255, 255, 255)');
cy.get('.text-element').should('have.css', 'color', 'rgb(0, 0, 0)');
});
it('should have discernible link names', () => {
cy.visit('https://www.conqt.com/');
cy.get('a').each(($el) => {
cy.wrap($el).should('have.attr', 'aria-label').and('not.be.empty');
});
});
});