Add pa11y-ci for automated accessibility tests with axe runner #1
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 Draft PR is originated from both twbs#29315 and Boosted use of pa11y / pa11y-ci
Run
Local
CLI mode
JSON mode
Focus on a specific page
GitHub CI
At the end, you can retrieve the HTML report:
Then, open the
index.html
file in the .zip file:Topics to tackle
Find a way to use the HTML reporter but still log the results in CLI
It seems possible in the
master
branch ofpa11y-ci
via pa11y/pa11y-ci@5c842cf that allows multiple reporters.We should be able to do something like:
But we would have to wait for the 2.4.3 or 2.5.0 to be released.
For the moment, the CLI version is only available locally.
See if we can use npx maybe, since Chromium is a huge download or see if we can cache puppeteer on CI
XhmikosR: "I don't want the huge puppeteer (which in turn downloads Chromium) devDependency, ~143MB... Not sure how to work around this, we could probably move the needed packages in the Action that needs them, but it's not a perfect solution either"
Which runner?
axe
like Boosted?htmlcs
like Bootstrap POCaxe
runner: Analyze and fix the errors or usehideElements
when necessaryTests of the 20th of October
"hideElements": ".bd-search"
: 1259 errors"hideElements": ".bd-search, footer ul.text-muted > li"
(removes 3 contrast errors in the footer): 978 errors (-291 errors) — Could be fixed by changing the text color here