Skip to content

feat: Integrate @axe-core/playwright for automated accessibility testing in CI #929

@Wikid82

Description

@Wikid82

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

  1. Install @axe-core/playwright as a dev dependency
  2. Create a shared accessibility test helper/fixture that runs axe scans
  3. Add accessibility checks to existing E2E tests (or create dedicated a11y spec files) for key pages
  4. Configure axe rules to target WCAG 2.2 Level AA conformance
  5. 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

  • @axe-core/playwright installed and configured
  • Accessibility scans run on key application pages (dashboard, settings, login, etc.)
  • CI fails on critical/serious WCAG 2.2 AA violations
  • Results are available in Playwright HTML report
  • Works across all three browser projects (Chromium, Firefox, WebKit)

References

Metadata

Metadata

Assignees

Labels

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions