[NOT MERGE] PoC: Storybook a11y testing in CI#217434
Closed
smith wants to merge 36 commits intoelastic:mainfrom
Closed
[NOT MERGE] PoC: Storybook a11y testing in CI#217434smith wants to merge 36 commits intoelastic:mainfrom
smith wants to merge 36 commits intoelastic:mainfrom
Conversation
Contributor
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
Contributor
This is how far I got partially following these docs: * https://storybook.js.org/docs/writing-tests/accessibility-testing * https://storybook.js.org/docs/writing-tests/test-runner To run the axe tests on all the APM stories, do: ```sh yarn storybook apm & # Have the APM storybook running on localhost:9001 cd x-pack/solutions/observability/plugins/apm npx test-storybook --url http://localhost:9001 ``` At the end you should get: ``` Test Suites: 28 failed, 15 passed, 43 total Tests: 46 failed, 26 passed, 72 total Snapshots: 0 total Time: 49.085 s Ran all test suites. ``` Neat! What's missing from this PR? * This needs to run in CI * But for every plugin? Maybe only run it for plugins that have added a test-runner.ts file? * I have not looked at the results. Some could be failing because the component is failing to render, some do have actual a11y violations. Some are passing, some are failing. * There's a ton of warnings * I think there's a way to get the test feedback red/green in the storybook UI. * I just added the test-runner.ts to the apm plugin and have not tried any others. * It updated a bunch of unrelated snapshots. I did run it with `-u` because it said there were snapshot updated but I have no idea why ones in api integrations are being deleted.
aea46a3 to
fb72f54
Compare
683d6d0 to
e5fba40
Compare
Contributor
|
ci:build-storybooks |
cd3572f to
86075b8
Compare
2ac6b0a to
407a24f
Compare
Contributor
|
This PR is waiting for elastic/synthetics#999 to be merged |
34f7faa to
82b9271
Compare
32793da to
7afd4fd
Compare
eb43e01 to
4868e89
Compare
…urce-definitions/scripts/fix-location-collection.ts'
74d18ea to
c1a14fe
Compare
ba6a996 to
4820b44
Compare
…urce-definitions/scripts/fix-location-collection.ts'
smith
commented
Jun 2, 2025
| STORYBOOK_PID=$! | ||
|
|
||
| echo "Waiting for Storybook to be ready..." | ||
| sleep 60 |
Contributor
Author
There was a problem hiding this comment.
If we're going to be waiting for a server to be available we should do it by polling the server until it's ready, rather than waiting 60s no matter what. Probably just by putting curl with a HEAD request in a while loop.
Contributor
💔 Build Failed
Failed CI StepsHistory
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR follows these docs:
To run the axe tests on all the APM stories, do:
What was done in this PR:
test-runner.tsfor apmFor CI
package.json,test:storybook, to call these tests easier.buildkite/scripts/steps/storybooks/to call the new command in CI. Made sure tochmod +xthe sh file..buildkite/pipelines/pull_request/storybooks.yml. The step havesoft_fail: truefor now and calls the new sh script.Note
Removed some outdated snapshots when running the tests locally, not sure why they show up as they are not related with APM