cypress-bootstrap
Version:
Cypress Bootstrap is a project scaffolding tool that sets up a Cypress automation framework with a standardized folder structure and Page Object Model (POM) design. It helps teams quickly start testing with built-in best practices and sample specs.
22 lines (19 loc) • 848 B
text/typescript
import LoginPage from '../../pages/LoginPage';
const a11yOptions = {
runOnly: ['wcag2a', 'wcag2aa'],
includedImpacts: ['critical', 'serious', 'moderate'], // These levels of impacts make the tests fail if found
};
describe('Accessibility Test Suite', () => {
before(() => {
LoginPage.openPage('/');
cy.injectAxe();
});
it('should have no accessibility violations on the login page', () => {
// Checking for accessibility violations with WCAG 2.1 AA standards and fail the test if there are violations
cy.checkAccessibility(undefined, a11yOptions);
LoginPage.loginButton().click();
LoginPage.errorMessage().should('be.visible');
// Interacted with the page so that the page composition is changed. Then checking for accessibility violations again.
cy.checkAccessibility(undefined, a11yOptions);
});
});