Repository navigation
Run axe accessibility scans in e2e tests - #1411
Merged
Merged
Conversation
Scenarios scan the states they reach and fail on any violation not in the known list in src/e2e/axe.ts. Existing violations are recorded there rather than fixed here. The known list is recorded against the Foundation theme. Without the theme package the colour contrast rule is skipped, as the open source default colours fail in different places.
|
Preview build will be at |
Collaborator
Author
But almost certainly worth adding its own scan now we have e2e there. |
Separates conformance failures from axe's best-practice rules, to help prioritise fixes.
Collaborator
Author
|
CC @microbit-grace as I'm going to do this everywhere in fairly short order. |
Collaborator
Author
|
Just holding off merging until I have an ml-trainer version of the same in case I hit issues that suggest a change of approach or it seems shared code is worthwhile. |
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.
Adds axe scans to the Playwright suite. Scenarios call
app.expectNoNewAccessibilityViolations()on the states they reach, and a new block inaccessibility.test.tscovers the menus and dialogs that the page object's helpers click straight through. 22 scans in total.Existing violations are not fixed here. They are recorded in
knownViolationsinsrc/e2e/axe.tsas a rule id, a CSS selector and a reason, and a scan fails only on violations that aren't listed. Fixing one means deleting its entry.Each entry also records its WCAG level, taken from axe's tags for the rule, to help prioritise fixes. Currently known:
Level A
aria-labelon adivwith no rolerole="img"with no labelLevel AA
axe best practice (not required by WCAG)
h4Theme
The known list is recorded against the Foundation's private theme, which is what CI and the deployed editor use. Without the theme package installed (forks, or a checkout without it) the
color-contrastrule is skipped, as the open source default colours fail in different places. All other rules still run. This is noted insrc/e2e/axe.tsandAGENTS.md.Notes for review
data-testid="simulator"on the simulator container, so one known-violation entry can cover its sensor controls.h1otherwise hides our missing one.role-img-altandheading-orderentries are broad (div[role="img"],h4), so they would also hide a new instance of the same mistake.