Objectif
Remplacer Lighthouse comme outil de validation WCAG par @axe-core/playwright, intégré aux tests E2E existants.
Lighthouse ne couvre que ~30 règles WCAG. axe-core (Deque) en couvre 80+ (WCAG 2.1 AA/AAA) et s'intègre nativement dans Playwright.
Implémentation
1. Installer la dépendance
pnpm add -D @axe-core/playwright
2. Créer tests/e2e/a11y.spec.ts
Tests axe sur les pages critiques (parcours RGAA AAA définis dans les specs) :
/login
/register
/feed
/chat/[convId]
/associations/[id]
Pattern à appliquer sur chaque page :
import AxeBuilder from '@axe-core/playwright'
test('page passe axe WCAG AA', async ({ page }) => {
await page.goto('/feed')
const results = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21aa'])
.analyze()
expect(results.violations).toEqual([])
})
3. CI
Le job test-playwright existant couvre déjà ce fichier — aucun nouveau job CI nécessaire.
On peut garder Lighthouse pour les scores Performance/SEO, axe prend le relais sur l'accessibilité.
Critères d'acceptance
Objectif
Remplacer Lighthouse comme outil de validation WCAG par
@axe-core/playwright, intégré aux tests E2E existants.Lighthouse ne couvre que ~30 règles WCAG. axe-core (Deque) en couvre 80+ (WCAG 2.1 AA/AAA) et s'intègre nativement dans Playwright.
Implémentation
1. Installer la dépendance
2. Créer
tests/e2e/a11y.spec.tsTests axe sur les pages critiques (parcours RGAA AAA définis dans les specs) :
/login/register/feed/chat/[convId]/associations/[id]Pattern à appliquer sur chaque page :
3. CI
Le job
test-playwrightexistant couvre déjà ce fichier — aucun nouveau job CI nécessaire.On peut garder Lighthouse pour les scores Performance/SEO, axe prend le relais sur l'accessibilité.
Critères d'acceptance
pnpm add -D @axe-core/playwrighttests/e2e/a11y.spec.tsavec tests sur les 5 pages critiqueswithTags(['wcag2a', 'wcag2aa', 'wcag21aa'])minimumtest-playwrightjob)docs/dossier/02-specifications-ux.md) et section tests (docs/dossier/06-tests-cicd.md) pour mentionner axe-core à la place de Lighthouse comme outil de validation WCAG