π Enhancement
In Storybook 9, the accessibility addon has been enhanced with automated reporting capabilities and the Test-runner has out of the box support for it. If you have @storybook/addon-a11y
installed, as long as you enable them via parameters, you will get a11y checks for every story:
// .storybook/preview.ts
const preview = {
parameters: {
a11y: {
// 'error' will cause a11y violations to fail tests
test: 'error', // or 'todo' or 'off'
},
},
};
export default preview;
If you had a11y tests set up previously for Storybook 8 (using axe-playwright and the test-runner hooks), you can uninstall axe-playwright and remove all the code from the test-runner hooks, as they are not necessary anymore.
π Bug Fix
- Add telemetry to test run #566 (@yannbf)
- fix a11y report checking bug #562 (@yannbf)
- Fix: Support a11y disable parameter #558 (@yannbf)
- Replace @storybook/csf with storybook's internal csf implementation #556 (@yannbf)