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
Disable specific rules for specific locators in axe-core scan #4417
Comments
Thanks for the issue. Axe-core would be in charge of something like this so I'm going to move this ticket over there. |
Today, the easiest way to achieve this is by post-processing the results from axe-core before writing your test assertions. Playwright's Accessibility Testing docs has a section suggesting one option for how to do that. Longer-term, we do agree that this is a feature that would make sense to add to axe-core. We don't currently have engineering cycles to prioritize for it, but it's something we'd be happy to accept a contribution for. We did discuss some different options for it; if someone did want to try a contribution for this, we're leaning towards something along these lines:
We also considered adding properties to the axe.run |
Product: playwright
Expectation: Disable rules for a specific selector in an axe scan
Actual: Can either disable
Motivation: Even if the scanned element has an invalid rule inside one of its subtrees. It's still worth running other rules for that its subtree.
Let's take this example
There are two rules that are being violated here:
If I test the entire UI markup here, there's no way for me ignore a specific rule for one of the problematic buttons (if they happen to be an exception). In fact, it's possible to mistakenly exclude one of the problematic buttons or rules and get a less accurate result from the scan.
The text was updated successfully, but these errors were encountered: