Accessibility assertions for end-to-end tests

Add WCAG auditing to any Playwright test with a single toBeAccessible() matcher — test full pages or scoped locators.

View on npm

Features

Page and locator support

Assert on an entire page or scope to a specific locator — test a full page or just a navigation region.

Clear failure messages

Each violation includes the rule ID, WCAG level, success criterion, and the CSS selector of the offending element.

Same rule engine

Powered by @accesslint/core — 93 WCAG rules, zero dependencies, fast results.

Quick start

npm install --save-dev @accesslint/playwright
// example.spec.ts
import { test, expect } from "@playwright/test";
import "@accesslint/playwright";

test("homepage is accessible", async ({ page }) => {
  await page.goto("https://example.com");
  await expect(page).toBeAccessible();
});