How do you add automated accessibility testing to a CI/CD pipeline?

Automated accessibility testing can be added to CI/CD by running a consistent rule engine against components and critical page states whenever code changes. The pipeline should block known high-confidence regressions without pretending to certify full WCAG conformance. Manual, keyboard and assistive-technology testing remain necessary.
Begin with stable component tests for buttons, forms, dialogs, navigation and other shared patterns. Add browser-level tests for a small set of essential journeys such as login, search and checkout. Load the page, open the state being tested, wait for dynamic content, then run the accessibility engine. Testing only the initial URL misses errors inside menus, validation messages and modal dialogs.
A Playwright test using axe can follow this pattern:
import AxeBuilder from "@axe-core/playwright";
test("checkout has no serious automated violations", async ({ page }) => {
await page.goto("/checkout");
await page.getByRole("button", { name: "Continue" }).click();
const results = await new AxeBuilder({ page }).analyze();
expect(results.violations.filter(v => ["serious", "critical"].includes(v.impact))).toEqual([]);
});
Introduce the gate gradually. Establish a reviewed baseline, fail new violations rather than hiding existing debt, and allow a documented exception only when a qualified person has confirmed the result and set an expiry date. Store the rule-engine version and test artifacts so an unexpected change can be investigated. Do not disable a rule globally because one component needs a narrow exception.
Keep scheduled scans for broader URL coverage and manual acceptance criteria for behaviors automation cannot judge. Review pipeline failures by component and fix the shared source before updating snapshots. A useful CI check makes accessibility defects visible within minutes of the change and gives the developer enough context to reproduce them locally.