Accessibility testing automation with axe-core and WCAG.
Accessibility testing automation in Nexus StudioQA runs axe-core against the live page at the end of a test and lists each WCAG rule that fired, with its impact and the elements involved. It is advisory by default. In strict mode a passing test with a serious or worse violation reads A11Y_VIOLATION. Automated checks find only part of the accessibility problems, so they do not replace a manual review.
By the Nexus StudioQA team, Verdict System LLC.
Last updated: .
What it checks and how you turn it on
The check is off until you ask for it: --a11y for one run, or NEXUS_A11Y_ENABLED=true for every run. It needs the @axe-core/playwright add-on; without it the report says “not measured” and the test is not affected.
| Setting | Default | What it does |
|---|---|---|
NEXUS_A11Y_ENABLED | false | Runs the axe-core audit on the page the test ends on. |
NEXUS_A11Y_STANDARD | wcag21aa | The rulebook: wcag2a, wcag2aa, wcag21a, wcag21aa or wcag22aa. |
NEXUS_A11Y_FAIL_LEVEL | serious | The lowest impact that counts as a violation: minor, moderate, serious or critical. |
NEXUS_A11Y_STRICT | false | When true, a violation at or above the fail level marks a passing test A11Y_VIOLATION. |
How the score and the verdict work
A11Y_VIOLATION is one of the 15 verdicts. It applies only to a test that passed, it exits 0 in CI, and the report and History show the reservation. A failed test is never escalated, and in chaos runs the audit is skipped. A touch screen, emulated or real, is also audited against WCAG 2.2 AA, which adds target size.
| Impact | Weight in the score |
|---|---|
| Critical | 25 points per violated rule |
| Serious | 10 points per violated rule |
| Moderate | 4 points per violated rule |
| Minor | 1 point per violated rule |
What the report holds
A score and a grade
The score is 100 minus the weights above, counted once per violated rule and not per element. Grades are A from 90, B from 75, C from 60, D from 40 and F below that. It is our own summary of one page, not a WCAG conformance level.
The rules that fired
Up to 15 rules, worst first, each with its impact, its WCAG tags, a link to the rule’s help page and up to 5 example elements. The section is added to report.md.
A count of checks that need a person
axe-core marks some checks as incomplete when it cannot decide. The report counts them and says they need human review.
What automated checks do not find
An automated check finds only part of the accessibility problems on a page. A clean result does not mean the page is accessible, and Nexus StudioQA does not certify WCAG conformance.
Meaning, not just markup
A rule can see that an image has alt text. It cannot judge whether the text describes the image, or whether a link’s wording makes sense out of context.
Use with a keyboard or a screen reader
Whether the reading order is sensible and whether the page can be used with a keyboard alone or with a screen reader needs a person to try it.
Only one page state per test
The audit runs on the page the test ends on. A page the test never reaches, or a state that closed before the end, is not audited.
Common questions
Does automated testing replace a manual accessibility audit?
No. It catches the rules a machine can decide and lists the rest as needing review. Use it to stop regressions between manual audits, not in place of them.
Will an accessibility problem fail my build?
Not by default. Problems are listed in the report. With
NEXUS_A11Y_STRICT=true, a passing test with a violation at or above the fail level reads A11Y_VIOLATION, which still exits 0 in CI.Which WCAG version does it test?
WCAG 2.1 AA by default. Settings offer 2.0 and 2.1 at levels A and AA, and 2.2 AA. On a touch screen, WCAG 2.2 AA is added.
Does it work with my existing tests?
Yes. It runs next to the assertions of Playwright, Selenium or pytest tests run through Nexus StudioQA, with
--a11yon a run or the setting on for all. Accessibility settings
Run it on your own machine.
Try every feature free, on your own machines. No card needed.