Automated testing

Automated scanners are fast, repeatable and cheap enough to run on every commit. They are also blind to most of WCAG. Both halves of that sentence matter: teams that skip automation ship defects they could have caught for free, and teams that stop at automation ship inaccessible sites with a green badge.

What this repository's own test run reports

Run it yourself:

npm install
npm run test:a11y

The run asserts three things for every one of the 86 criteria:

The summary it prints is the honest coverage map:

Criteria in WCAG 2.2                         86
With at least one mapped axe rule            31  (36%)
No automated test exists at all              55  (64%)

The number behind the number

36% of criteria have some rule mapped to them. That is not the same as 36% of accessibility problems being detectable. Within those 31 criteria the coverage is partial: a scanner sees that alt is missing, never that the alt text is wrong; that a label is absent, never that it is meaningless; that contrast fails on a solid background, rarely over an image.

Independent studies of automated tooling consistently put real-world detection at roughly a quarter to a third of actual defects. Plan your testing budget on that basis.

The three outcomes axe reports, and why the third one matters

How to read an axe result
OutcomeWhat it meansWhat you do
violationsThe rule failed, with confidenceFix it
passesThe rule was checked and satisfiedNothing — but this is not proof the criterion is met
incompleteThe rule fired but axe will not decide. Also called "needs review"Check it by hand. This is not a pass

Most CI setups report only violations and silently discard incomplete. That is how a page with no skip link, no landmarks and no headings is recorded as clean — 2.4.1 Bypass Blocks returns incomplete, not a violation. This repository's runner reports it as a distinct outcome for exactly that reason.

Traps that make automated results misleading

The tools

Automated accessibility tools and what each is for
ToolEngineBest for
axe DevToolsaxe-coreBrowser extension. The fastest way to check a page while building it.
axe-coreaxe-coreThe library. Use it in unit and end-to-end tests, where you can drive the page into each state first.
pa11y-ciHTML_CodeSniffer or axeCrawling many URLs in CI. A second engine cross-checks the first.
Lighthouseaxe-core (subset)A quick score. Its accessibility number is a subset of axe and should never be treated as a conformance measure.
WAVEOwnVisual, in-page annotation. Excellent for teaching, because it shows you where on the page each issue is.
ANDIOwnA bookmarklet from the US SSA. Good for inspecting the accessible name of a specific control.

Wiring it into CI properly