dequelabs / axe-core

Accessibility engine for automated Web UI testing
https://www.deque.com/axe/
Mozilla Public License 2.0
5.96k stars 776 forks source link

skip-link rule not able to find link when scanning a logged-in WordPress page #4605

Open pattonwebz opened 2 weeks ago

pattonwebz commented 2 weeks ago

Product

axe-core

Product Version

4.10.0

Latest Version

Issue Description

Expectation

The skip-link rule should find a valid skip link on the page and check it.

Actual

The skip-link rule returns inapplicable as it is unable to determine the correct skip link on the page.

How to Reproduce

A default WordPress site scanned as a logged in user creates the scenario that causes this.

Additional context

When a user is logged in on a WordPress site generally markup for an Admin Bar is added to the page which produces links that are the first page links. I understand that this breaks expectation of where a skip link should appear in the page but I can't control the placement or markup of that admin bar.

I do have the admin bar excluded in the context however the skip link heuristics do not consider the excludes context when finding the first link on the page.

WilcoFiers commented 2 weeks ago

Thank you for reporting this @pattonwebz. I'm not sure there is anything we can do about this. In order to avoid failing things that aren't real issues (aka false positives), axe-core can only test things if its sure about what it's testing. An internal link that's not at the top of the page may be a skip link, or it may not be. We can't say for sure, and if we can't be sure we can't test it without false positives.

That's the tradeoff axe has to make to be as accurate as it is, it sometimes has to ignore things that could be issues, because we're not confident enough that it will be.

pattonwebz commented 2 weeks ago

@WilcoFiers I understand that the default rules should be using certainty and avoiding false positives. However if the heuristics for this was updated to take into account the context.exclude[] values then for WordPress sites it could be made to be reliable by simply excluding the admin bar ID.