SPB Git

spb/phi-conseil

Public
767 B · 26 lines typescript
1import { test, expect } from "@playwright/test";2import AxeBuilder from "@axe-core/playwright";34for (const r of [5  "/",6  "/services",7  "/a-propos",8  "/temoignages",9  "/nous-joindre",10  "/confidentialite",11]) {12  test(`axe : aucune violation sérieuse ou critique sur ${r}`, async ({ page }) => {13    await page.goto(r);14    const results = await new AxeBuilder({ page })15      .withTags(["wcag2a", "wcag2aa", "wcag21aa", "wcag22aa"])16      .analyze();17    const serious = results.violations.filter(18      (v) => v.impact === "serious" || v.impact === "critical",19    );20    expect(21      serious.map((v) => `${v.id}: ${v.nodes.map((n) => n.target.join(" ")).join(", ")}`),22    ).toEqual([]);23    expect(results.violations.map((v) => v.id)).toEqual([]);24  });25}26
Files · 18a9e1379a7e4662b184e2c070c92578c5de3ea8
Menu

Theme