daedalOS/e2e/index.spec.ts
2025-05-01 19:10:29 -07:00

30 lines
851 B
TypeScript

import AxeBuilder from "@axe-core/playwright";
import { expect, test } from "@playwright/test";
import { ACCESSIBILITY_EXCEPTION_IDS } from "e2e/constants";
import {
backgroundCanvasMaybeIsVisible,
captureConsoleLogs,
clockCanvasMaybeIsVisible,
desktopEntriesAreVisible,
loadApp,
startButtonIsVisible,
taskbarIsVisible,
} from "e2e/functions";
test.beforeEach(captureConsoleLogs());
test.beforeEach(loadApp());
test.beforeEach(desktopEntriesAreVisible);
test.beforeEach(taskbarIsVisible);
test.beforeEach(startButtonIsVisible);
test.beforeEach(clockCanvasMaybeIsVisible);
test.beforeEach(backgroundCanvasMaybeIsVisible);
test("can pass accessibility scan", async ({ page }) =>
expect(
(
await new AxeBuilder({ page })
.disableRules(ACCESSIBILITY_EXCEPTION_IDS)
.analyze()
).violations
).toEqual([]));