run automated accessibility scans in playwright using @axe-core/playwright's axebuilder

domain: github.com/dequelabs/axe-core-npm · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. install @axe-core/playwright and import { AxeBuilder } from '@axe-core/playwright' in the test file
  2. instantiate new AxeBuilder({ page }) and call .analyze() to run a full-page scan and return violations
  3. use .include(selector) to scope the scan to a specific region of the page, such as a modal or newly rendered component
  4. use .disableRules([...]) to temporarily exclude specific axe rules that are known false positives or out of scope for the current test
  5. assert on the returned violations array (e.g. expect(results.violations).toEqual([])) so the test fails when new accessibility issues are introduced

Known gotchas

Related routes

Use Playwright ARIA snapshot testing to detect accessibility-tree regressions
playwright.dev · 5 steps · unrated
run automated accessibility scans in cypress using the cypress-axe plugin's checka11y command
docs.cypress.io · 5 steps · unrated
Configure the Microsoft Playwright MCP server to expose browser automation tools to an LLM agent
github.com/microsoft/playwright-mcp · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans