My demo site, demo.miguelcarino.com, is a working Angular app that backs the posts on this blog. Every pull request that touches the app goes through an accessibility sweep. Playwright, Microsoft's browser automation tool, opens each page in a real Chromium browser, once per color theme, and hands the finished page to axe-core, Deque's open-source library of accessibility rules. If axe reports a single violation, the build fails.
That sweep had been green for months. Then I found two holes in it, and both were sitting in plain sight in the test file.
The first was an array of seven strings. They're the tags that tell axe which rule sets to run, and they read like a complete list, with tags for WCAG 2.0, 2.1 and 2.2, for levels A, AA and AAA, and for axe's best practices. WCAG, the Web Content Accessibility Guidelines, is the W3C standard that most accessibility requirements are written against. The comment at the top of the file said the sweep checked WCAG 2.2. The list didn't say wcag22aa.
A gate is a list of questions
It's an easy string to miss, because nothing breaks without it. Each axe rule is filed under tags, and axe runs the rules whose tags you name. WCAG 2.2 added nine success criteria, and axe can test one of them automatically: 2.5.8 Target Size (Minimum), the rule that a button or link a pointer has to hit is at least 24 by 24 CSS pixels. That rule carries the wcag22aa tag and no other WCAG level tag. Deque ships it switched off by default, so a list without its tag never runs it.
So the build answered every question I'd written down, and I'd left one off. A gate is a list of questions with a pass or fail beside each one. A question that isn't on the list comes back blank, and a blank looks exactly like a pass.
The second hole was the list of pages. The sweep named 13 routes by hand. The app had grown to 19. Two pages built after the list was written had never been added, and neither had the four small pages behind the demo's route-guard examples. Two of those only open after you sign in on the Fundamentals page, and a test that just loads a URL as a guest never gets there.
What changed in the sweep
The tag fix was one line. Here is the scan as it stands, trimmed to its import and the axe call:
import AxeBuilder from '@axe-core/playwright';
const results = await new AxeBuilder({ page })
.withTags([
'wcag2a',
'wcag2aa',
'wcag21a',
'wcag21aa',
'wcag22aa',
'wcag2aaa',
'wcag22aaa',
'best-practice',
])
.analyze();
The page list took more care. The guarded pages get an enter step that reaches them the way a reader does, by signing in first:
async function signInAs(page: Page, role: 'user' | 'admin'): Promise<void> {
await page.goto('/fundamentals');
await page.getByRole('button', { name: 'Sign in' }).click();
if (role === 'admin') await page.getByRole('button', { name: 'Switch to admin' }).click();
}
And the route list that uses it, trimmed to three entries: the first, the page only a signed-in user can open and the last:
const routes: Route[] = [
{ path: '/', name: 'overview' },
{
path: '/fundamentals/secure',
name: 'secure area',
enter: async (page) => {
await signInAs(page, 'user');
await page.getByRole('link', { name: /secure area/ }).click();
},
},
{ path: '/testing', name: 'testing' },
];
Each route then runs once per theme, light and dark, which makes 38 tests on every ready pull request that touches the app. Each one reports by name, like secure area has no WCAG AAA + best-practice violations [dark]. When one fails, its message lists every broken rule, the element it found it on and axe's hint for the fix, so the red check on the pull request says what to change.
The new pages turned up a real miss. None of the four route-guard pages had a level-one heading. They were deliberately tiny, a short note and a link back, built as part of each example, and each one is still a page a reader can land on. A screen-reader user who lands on one has no heading to tell them where they are. When I ran axe over the new routes, it reported exactly that on the draft and briefing pages, the two a guest can open directly, in a best-practice rule called page-has-heading-one. The sweep itself waits for a page's level-one heading before it scans, so on those pages it would have timed out before axe ever looked. Each page got a heading named like its route.
Target size, the rule that had never run, passed on every page. The design system's smallest buttons already cleared the 24-pixel floor. Until that run, nothing had shown it.
The gates I didn't build
Lighthouse, Google's free page audit built into Chrome, has an accessibility score, and it's the check many developers already know. It's built on axe's rules and weights each audit as a plain pass or fail. It's an excellent first look at one page. As a merge gate it's coarser: a score sums up one page at a time, while a test per route and theme fails with the rule and the element named.
Pa11y and pa11y-ci, its companion for build servers, are the closest alternative. Pa11y runs HTML_CodeSniffer, Squiz's open-source checker, by default, can run axe instead, and supports scripted actions like signing in. On a project without browser tests it's the faster start. This one already ran Playwright for its end-to-end tests, and the sweep is one more Playwright test, seeding themes and signing in with the same tools as the rest. A second harness would have been a second way of doing the same thing.
Browser extensions like Deque's axe DevTools check a page while you build it, and Chrome's DevTools show a contrast ratio right in the color picker. That's how I once caught a contrast miss in a theme the sweep wasn't scanning yet. Both are good habits, and neither one can fail a build.
A manual audit by someone who knows the guidelines finds what none of these can. The axe-core project says plainly that it finds about 57% of WCAG issues on average. It can confirm a button has an accessible name, and it can't judge whether the name makes sense. It can confirm a live region exists, and it can't hear whether a screen reader announced the message. It also marks some results "incomplete" where it couldn't be sure, and the sweep only fails on violations, so those wait for a person. Listening to a page with a screen reader is its own discipline, and no build step replaces it.
A Green Check Proves What You Asked It
The tag list now covers every level of the standard the site claims, and the pages behind a sign-in have a sign-in step. The page list is still typed by hand, and that's the next thing I'd change: built from the router's own config, a new route couldn't be skipped. The sweep still only catches what it's asked to catch, so its list of questions gets the same review as its results.



