@uswds/web-components
Version:
> [!CAUTION] > Work on the next version of the Design System is happening in this repo. The code in this repository is not yet ready for production use.
24 lines (20 loc) • 574 B
JavaScript
import { injectAxe, checkA11y, configureAxe } from "axe-playwright";
import { getStoryContext } from "@storybook/test-runner";
const config = {
async preVisit(page) {
await injectAxe(page);
},
async postVisit(page, context) {
const storyContext = await getStoryContext(page, context);
await configureAxe(page, {
rules: storyContext.parameters?.a11y?.config?.rules,
});
await checkA11y(page, "#storybook-root", {
detailedReport: true,
detailedReportOptions: {
html: true,
},
});
},
};
export default config;