import { test, expect } from "./fixtures"; import AxeBuilder from "@axe-core/playwright"; for (const r of [ "/", "/services", "/a-propos", "/temoignages", "/nous-joindre", "/confidentialite", ]) { test(`axe : aucune violation sérieuse ou critique sur ${r}`, async ({ page }) => { await page.goto(r); const results = await new AxeBuilder({ page }) .withTags(["wcag2a", "wcag2aa", "wcag21aa", "wcag22aa"]) .analyze(); const serious = results.violations.filter( (v) => v.impact === "serious" || v.impact === "critical", ); expect( serious.map((v) => `${v.id}: ${v.nodes.map((n) => n.target.join(" ")).join(", ")}`), ).toEqual([]); expect(results.violations.map((v) => v.id)).toEqual([]); }); }