Add test-runner to Storybook and script to run locally
What does this MR do and why?
- Extends Storybook with test-runner and axe-playwright, using the same configuration as in GitLabUI
- Adds
storybook:dev:testscript for running the tests locally - Saves results in a json file
References
- https://storybook.js.org/docs/7/writing-tests/test-runner
- https://storybook.js.org/docs/7/writing-tests/accessibility-testing
- test: Leverage storybook test runner for accessibility tests (GitLab UI)
Screenshots or screen recordings
| Before | After |
|---|---|
| n/a | ![]() |
| n/a | ![]() |
| n/a | ![]() |
How to set up and validate locally
- Checkout the branch
- Run
yarn installin the root and storybook directory - Run
storybook:startorstorybook:start:skip-fixtures-update. Keep it running. The Storybook needs to be built for the tests to run. - Run
storybook:dev:testfrom the root directory
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #507448 (closed)
Edited by Paulina Sedlak-Jakubowska


