Skip to content

Commit

Permalink
fix: test-runner 설정 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene028 committed Jun 7, 2024
1 parent f3457f3 commit 5883463
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/wow-ui/.storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { TestRunnerConfig } from "@storybook/test-runner";
import { injectAxe, checkA11y } from "axe-playwright";
import { getStoryContext, type TestRunnerConfig } from "@storybook/test-runner";
import { injectAxe, checkA11y, configureAxe } from "axe-playwright";

/*
* See https://storybook.js.org/docs/writing-tests/test-runner#test-hook-api
Expand All @@ -9,7 +9,13 @@ const config: TestRunnerConfig = {
async preVisit(page) {
await injectAxe(page);
},
async postVisit(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: {
Expand Down

0 comments on commit 5883463

Please sign in to comment.