axe-core
axe-core copied to clipboard
Disable specific rules for specific locators in axe-core scan
Product: playwright
Expectation: Disable rules for a specific selector in an axe scan
Actual: Can either disable
- All rules for one locator and its descendants
- One rule for the entire scan
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
<div id="to-test">
<button id="duplicate-id">
<i class="send-icon"><i>
</button>
<button id="duplicate"><i class="delete-icon"></i></button>
</div>
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.
axe-core version: 4.9.0
@axe-core/playwright: 4.9.0
- Node version: 20
- Platform: Mac, Linux, Windows