14 lines
584 B
TypeScript
14 lines
584 B
TypeScript
import AxeBuilder from "@axe-core/playwright";
|
|
import { expect, test } from "@playwright/test";
|
|
|
|
for (const path of [
|
|
"/", "/records", "/report", "/rules", "/privacy",
|
|
"/admin", "/admin/moderation", "/admin/external-sources", "/admin/media",
|
|
]) {
|
|
test(`${path} has no serious accessibility violations`, async ({ page }) => {
|
|
await page.goto(path);
|
|
const results = await new AxeBuilder({ page }).withTags(["wcag2a", "wcag2aa", "wcag21aa"]).analyze();
|
|
expect(results.violations.filter(item => ["critical", "serious"].includes(item.impact ?? ""))).toEqual([]);
|
|
});
|
|
}
|