-
Notifications
You must be signed in to change notification settings - Fork 0
How to pass exclude option? #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @stereobooster , I tried to implement the changes that were planned for the next release of cypress-axe so this option has been replaced by You can exclude a whole category/impact, for example exclude cy.checkA11y({
shouldFailFn: violations => violations.filter(v => v.impact !== 'critical')
}); or a certain violation like cy.checkA11y({
shouldFailFn: violations =>
violations.filter(v.id !== 'color-contrast')
});
|
I meant an option to exclude dom node, something like this:
|
Interesting! this has been abstracted in this implementation. Try this temporary workaround. <img class="notme" src="" /> cy.wrap({ exclude: ['.notme']}).checkA11y(); |
Thanks. My use case is: I have some components which use brand colors and lack contrast, so I want to ignore them until we get new color scheme from designers. |
That's a valid scenario. Glad I could help. |
WDYT about following API: cy.get('bla').checkA11y({ exclude: ['.notme']}); ? |
It might not be as straightforward as that. I don't want to spread the context props over the current config options. Will look into it later, for now I will update the readme to include the workaround. |
Hi,
thanks for maintaining the fork.
Maybe you know how to pass
exclude
option?The text was updated successfully, but these errors were encountered: