webapp/.storybook/test-runner.ts
Untone d7a5a188ff
Some checks failed
deploy / Update templates on Mailgun (push) Waiting to run
deploy / test (push) Has been cancelled
editor-showup+fixes
2024-09-24 09:48:39 +03:00

24 lines
628 B
TypeScript

import type { Page } from '@playwright/test'
import type { TestRunnerConfig } from '@storybook/test-runner'
import { checkA11y, injectAxe } from 'axe-playwright'
/*
* See https://storybook.js.org/docs/react/writing-tests/test-runner#test-hook-api-experimental
* to learn more about the test-runner hooks API.
*/
const a11yConfig = {
async preRender(page: Page) {
await injectAxe(page)
},
async postRender(page: Page) {
await checkA11y(page, '#storybook-root', {
detailedReport: true,
detailedReportOptions: {
html: true
}
})
}
} as TestRunnerConfig
module.exports = a11yConfig