Skip to content

Commit

Permalink
doc:modified Global utility functions section
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagisa Ando committed Aug 30, 2022
1 parent bb36851 commit 885ecf7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down

0 comments on commit 885ecf7

Please sign in to comment.