Summary
Add automated accessibility (a11y) testing to the existing Playwright E2E test suite using @axe-core/playwright.
Motivation
The project has comprehensive a11y guidelines (.github/instructions/a11y.instructions.md) but no automated enforcement in CI. Integrating axe-core into the existing Playwright tests catches WCAG 2.2 Level AA violations automatically across all three browser engines (Chromium, Firefox, WebKit) with minimal additional infrastructure.
Proposed Approach
- Install
@axe-core/playwright as a dev dependency
- Create a shared accessibility test helper/fixture that runs axe scans
- Add accessibility checks to existing E2E tests (or create dedicated a11y spec files) for key pages
- Configure axe rules to target WCAG 2.2 Level AA conformance
- Fail CI on critical/serious violations
Example Usage
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';
test('homepage should have no critical a11y violations', async ({ page }) => {
await page.goto('/');
const results = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag22aa'])
.analyze();
expect(results.violations.filter(v =>
['critical', 'serious'].includes(v.impact)
)).toEqual([]);
});
Acceptance Criteria
References
Summary
Add automated accessibility (a11y) testing to the existing Playwright E2E test suite using
@axe-core/playwright.Motivation
The project has comprehensive a11y guidelines (
.github/instructions/a11y.instructions.md) but no automated enforcement in CI. Integrating axe-core into the existing Playwright tests catches WCAG 2.2 Level AA violations automatically across all three browser engines (Chromium, Firefox, WebKit) with minimal additional infrastructure.Proposed Approach
@axe-core/playwrightas a dev dependencyExample Usage
Acceptance Criteria
@axe-core/playwrightinstalled and configuredReferences
.github/instructions/a11y.instructions.md