forked from cartsnitch/cartsnitch
feat(e2e): add axe-core accessibility fixture
This commit is contained in:
committed by
GitHub
parent
f0c60778cc
commit
c2b5ccb830
@@ -0,0 +1,12 @@
|
|||||||
|
import { test as base, expect } from "@playwright/test";
|
||||||
|
import AxeBuilder from "@axe-core/playwright";
|
||||||
|
|
||||||
|
export const test = base.extend<{ axeCheck: void }>({
|
||||||
|
axeCheck: [async ({ page }, use) => {
|
||||||
|
await use();
|
||||||
|
const results = await new AxeBuilder({ page }).analyze();
|
||||||
|
expect(results.violations).toEqual([]);
|
||||||
|
}, { auto: true }],
|
||||||
|
});
|
||||||
|
|
||||||
|
export { expect } from "@playwright/test";
|
||||||
Reference in New Issue
Block a user