cypress-axe
cypress-axe copied to clipboard
Feature/rfc 75
Trying to implement #75 (to the best of my knowledge/understanding).
I made shouldFail return array of violations instead of boolean.
shouldFail?: (violations: axe.Result[]) => axe.Result[];
Users can filter out the violations that they want to skip and only return the ones they want to assert against.
For example, I'm wrapping checkA11y to filter out color-contrast violations
Cypress.Commands.add(
'customCheckA11y',
{ prevSubject: 'optional' },
(subject, options, label) => {
return cy.checkA11y({
shouldFail: violations => violations.filter(v => v.id !== 'color-contrast')
});
}
);
Also
- updated dependencies
- upgraded cypress dependency to include v7