c7e3048c09
CI Pipeline / test (20) (pull_request) Successful in 3m13s
CI Pipeline / test (18) (pull_request) Successful in 3m57s
CI Pipeline / e2e (firefox) (pull_request) Successful in 5m6s
CI Pipeline / e2e (webkit) (pull_request) Successful in 5m16s
CI Pipeline / e2e (chromium) (pull_request) Successful in 14m47s
CI Pipeline / performance (pull_request) Successful in 4m32s
CI Pipeline / storybook (pull_request) Successful in 1m35s
CI Pipeline / visual-regression (pull_request) Failing after 9m55s
CI Pipeline / lint (pull_request) Failing after 49s
CI Pipeline / build (pull_request) Successful in 1m48s
15 lines
422 B
TypeScript
15 lines
422 B
TypeScript
import { AxeBuilder } from "@axe-core/playwright";
|
|
|
|
export async function runA11y(page, _options = {}) {
|
|
const results = await new AxeBuilder({ page })
|
|
.withTags(["wcag2a", "wcag2aa"])
|
|
.analyze();
|
|
|
|
if (results.violations.length > 0) {
|
|
console.log("Accessibility violations found:", results.violations);
|
|
throw new Error(
|
|
`Found ${results.violations.length} accessibility violations`,
|
|
);
|
|
}
|
|
}
|