diff --git a/README.md b/README.md index 287e2dcd..52902649 100644 --- a/README.md +++ b/README.md @@ -488,7 +488,7 @@ You can use it for multiple use cases, and here's an example that combines the s ```js // .storybook/test-runner.js const { getStoryContext } = require('@storybook/test-runner'); -const { injectAxe, checkA11y } = require('axe-playwright'); +const { injectAxe, checkA11y, configureAxe } = require('axe-playwright'); module.exports = { async preRender(page, context) { @@ -503,6 +503,11 @@ module.exports = { return; } + // Apply story-level a11y rules + await configureAxe(page, { + rules: storyContext.parameters?.a11y?.config?.rules, + }) + // from Storybook 7.0 onwards, the selector should be #storybook-root await checkA11y(page, '#root', { detailedReport: true,