Developer guide

Accessibility testing in CI/CD pipelines

Automated accessibility checks in your pipeline stop the easy regressions, such as a missing label, an empty button or a contrast drop, before they reach production. This guide gives working setups for the free tools teams actually use, and is honest about what they cannot see.

Reviewed by Khushwant Parihar, CPACC

Updated

Choosing a tool

Free accessibility testing tools for CI, versions on npm in November 2026
ToolLatest (Nov 2026)Best whenEngine
@axe-core/playwright4.14.0You have Playwright testsaxe-core 4.14
cypress-axe1.7.0You have Cypress testsaxe-core (you install it)
jest-axe11.0.0Testing components in isolationaxe-core, in jsdom
pa11y-ci5.0.0You want to scan a list of URLsHTML_CodeSniffer and/or axe
@lhci/cli0.16.1You also track performance and SEOA subset of axe rules
@axe-core/cli4.14.0Quick scripted scansaxe-core

Skip @axe-core/react: its README says it does not support React 18 and above. For a deeper comparison of engines see axe vs WAVE and our testing tools benchmark.

axe with Playwright

npm install --save-dev @playwright/test @axe-core/playwright
// tests/a11y.spec.ts
import { test, expect } from "@playwright/test"
import AxeBuilder from "@axe-core/playwright"

const pages = ["/", "/pricing", "/contact"]

for (const path of pages) {
  test(`no WCAG A/AA violations on ${path}`, async ({ page }) => {
    await page.goto(path)
    const results = await new AxeBuilder({ page })
      .withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"])
      .analyze()
    expect(results.violations).toEqual([])
  })
}

The tags limit the run to WCAG A and AA rules. There is no wcag22a tag because the new Level A criteria in WCAG 2.2 have no automated axe rule. Test interactive states too: open the menu or dialog in the test, then call analyze() again, and scope with .include("#dialog") if needed.

axe with Cypress

npm install --save-dev cypress axe-core cypress-axe
// cypress/support/e2e.js
import "cypress-axe"

// cypress/e2e/a11y.cy.js
describe("accessibility", () => {
  it("home page has no WCAG A/AA violations", () => {
    cy.visit("/")
    cy.injectAxe()
    cy.checkA11y(null, {
      runOnly: { type: "tag", values: ["wcag2a", "wcag2aa", "wcag21a", "wcag21aa", "wcag22aa"] },
    })
  })
})

Component tests with jest-axe

import { render } from "@testing-library/react"
import { axe, toHaveNoViolations } from "jest-axe"
import { SignupForm } from "./SignupForm"

expect.extend(toHaveNoViolations)

it("SignupForm has no detectable violations", async () => {
  const { container } = render(<SignupForm />)
  expect(await axe(container)).toHaveNoViolations()
})

jest-axe needs the jsdom test environment. Because jsdom does not render, colour contrast checks are off; cover contrast in browser tests or with the contrast checker during design.

Pa11y CI for URL lists

// .pa11yci
{
  "defaults": {
    "standard": "WCAG2AA",
    "runners": ["axe", "htmlcs"],
    "timeout": 30000
  },
  "urls": [
    "http://localhost:3000/",
    "http://localhost:3000/pricing",
    "http://localhost:3000/contact"
  ]
}
npx pa11y-ci

Running both runners catches a few more issues than either alone. Pa11y CI exits with a non-zero code when any URL has errors, which fails the job. Point it at a sitemap with --sitemap for broader coverage.

Lighthouse CI

// lighthouserc.js
module.exports = {
  ci: {
    collect: { url: ["http://localhost:3000/"], startServerCommand: "npm run start" },
    assert: {
      assertions: {
        "categories:accessibility": ["error", { minScore: 0.95 }],
      },
    },
    upload: { target: "temporary-public-storage" },
  },
}

Lighthouse runs only a subset of axe rules and turns them into a score. A score of 100 means those rules passed, not that the page is accessible. Use it as a trend line alongside axe, not instead of it.

A GitHub Actions workflow

# .github/workflows/accessibility.yml
name: Accessibility
on: [pull_request]

jobs:
  a11y:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm ci
      - run: npx playwright install --with-deps chromium
      - run: npm run build
      - run: npx playwright test tests/a11y.spec.ts
      - uses: actions/upload-artifact@v4
        if: failure()
        with:
          name: playwright-report
          path: playwright-report

Configure Playwright’s webServer option to start your app, or swap the last steps for npx pa11y-ci or npx @lhci/cli autorun. The same commands work in GitLab CI, Azure Pipelines or Jenkins.

Rolling it out without blocking everyone

  1. Report only for the first week or two. Publish the violations as an artifact.
  2. Fix or baseline what exists. axe lets you disable a rule for a known, ticketed issue with .disableRules([...]); keep that list short and dated.
  3. Fail on new violations in A and AA rules for the pages each change touches.
  4. Add interaction states: open menus, dialogs, error states and dark mode, because many failures only exist after an interaction.
  5. Review the gate each quarter as axe adds rules.

What automation will not catch

Deque’s 2021 study found automated axe testing covered 57% of issues by volume across more than 2,000 audits, but those issues sat under only 16 of 50 success criteria. A green pipeline still needs people to check:

  • Keyboard operation and focus management in custom widgets.
  • Whether alt text, labels and headings are meaningful, not just present.
  • Screen reader announcements for dynamic updates.
  • Reflow at 400% zoom, captions, and anything in video or PDF.

Our guide to automated vs manual testing shows how to split the work, and the WCAG 2.2 checklist covers the manual criteria.

Frequently Asked Questions

What is the best accessibility testing tool for CI/CD?

For most teams, axe-core run inside the end-to-end tests you already have: @axe-core/playwright for Playwright or cypress-axe for Cypress. It is free, open source, has few false positives and fails a build with a normal test assertion. If you have no browser tests, Pa11y CI scans a list of URLs with one config file, and Lighthouse CI is useful when you also want performance budgets.

How much of WCAG can automated tests catch?

A minority of criteria, but a large share of the issues on a typical page. Deque's 2021 study of over 2,000 audits found axe fully covered 57% of issues by volume, yet those issues fell under only 16 of 50 success criteria. Keyboard operation, focus order, meaningful alt text and most content questions still need people.

Should accessibility failures block a merge?

Yes, for violations of WCAG A and AA rules on the pages a change touches, once you have cleared the existing backlog. A common rollout is to report only for a sprint, fix or baseline the existing issues, then fail the build on any new violation.

Is there an official GitHub Action for axe?

Deque publishes dequelabs/axe-linter-action, which lints changed files in pull requests and needs an axe Linter API key. For page-level tests, run axe through Playwright or Cypress in an ordinary workflow step, or run Pa11y CI or Lighthouse CI as a step. Lighthouse CI documents an official workflow; Pa11y has no official action.

Does jest-axe test color contrast?

No. jest-axe runs in jsdom, which does not render pages, so color contrast checks are turned off. Use it for component markup and run contrast checks in a real browser with Playwright or Cypress.

Essential Accessibility Resources

Comprehensive tools, checklists, and guides to help you create inclusive digital experiences

Top Pick

Accessibility Testing Tools Benchmark 2026

axe, Lighthouse, HTML_CodeSniffer and IBM Equal Access tested against thirty seeded WCAG defects
axe
lighthouse
pa11y
+4 more
View resource
Top Pick

axe vs WAVE Comparison

Factual comparison of the two most popular accessibility testing tools
axe
wave
axe vs wave
+2 more
View guide
Top Pick

Automated vs Manual Accessibility Testing

What automated scans catch, what only manual testing finds, and the hybrid workflow
automated testing
manual testing
ci testing
View guide
Top Pick

Best Accessibility Testing Tools: Free & Paid Options

Comprehensive guide to accessibility testing tools including axe, WAVE, Lighthouse, and more. Compare features, pricing, and use cases for WCAG compliance testing.
accessibility
testing
tools:
View article

Mobile Accessibility Testing: iOS & Android Guide

Learn mobile accessibility testing with TalkBack, VoiceOver, and Switch Control. Essential guide for mobile app and responsive web accessibility.
accessibility
testing:
testing
View article

Screen Reader Testing Guide

Comprehensive guide to testing with NVDA, JAWS, VoiceOver, and TalkBack with command references and testing procedures
accessibility testing
View guide