Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a11y testing to pixel #196

Merged
merged 9 commits into from
Dec 26, 2023
Merged

Add a11y testing to pixel #196

merged 9 commits into from
Dec 26, 2023

Conversation

bernardwang
Copy link
Collaborator

@bernardwang bernardwang commented Jul 18, 2023

Summary

Adds ability to test for a11y errors to pixel.

  • Add new a11y-regression docker image
  • Use the pa11y library to run automated a11y tests
  • Create a custom a11y error reporter that shows differences between the 'test' and 'reference' patches

Notes

At some point, it might make sense to factor out the part of pixel that creates docker containers to compare patches. That logic is what's primarily being leveraged for this new feature, and having a generic tool for comparing patches could be useful for other applications as well.

How to test

The -a or --a11y flag is used to run a11y tests instead of visual tests.

Run the following to see what a a11y regression would look like

./pixel.js reference -a && ./pixel.js test -c 954075 -a

Run the following to see what a a11y improvement would look like

./pixel.js reference -c 954075 -a && ./pixel.js test -a

Run the following to see what no change would look like

./pixel.js reference -a && ./pixel.js test -a

Copy link
Collaborator

@montehurd montehurd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bernardwang

Sorry for delay! Seems to run fine on my machine

Could the Dockerfile be updated to use this?

It's not a dealbreaker, just curious.

@bernardwang
Copy link
Collaborator Author

@montehurd done!

@moabualruz moabualruz self-requested a review December 21, 2023 19:37
@moabualruz moabualruz merged commit f092411 into main Dec 26, 2023
1 check passed
@moabualruz moabualruz deleted the bernard/wmf-a11y branch December 26, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants