-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Fixed #33620 -- Allowed running accessibility checks on selenium tests. #16372
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
Conversation
Or at a specific point maybe? I have a view open — add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Thank you for your contribution 💪
As it's your first contribution be sure to check out the patch review checklist.
If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!
If you have any design or process questions then you can ask in the Django forum.
Welcome aboard ⛵️!
It doesn't look that well maintained. The latest version of Python in the test matrix is 3.6. I'm not sure about having a dependency on this package as it is. 🤔 |
Yes, nice catch. I went over to I also found out pa11y another accessibility test tool and it seems it has better support for generating better reports and also has an open-source dashboard to see results. I will take a look into how we could use it and share some ideas soon. |
Hey @carltongibson @smithdc1 pa11y seems to be much better than using axe. pa11y can be called directly from CLI on URLs, we can use axe-core as a pa11y runner, it can output a decent formatted result, and have options to customize them even further. Apart from that, I see pa11y-dashboard as well to visualize results if needed. After every UI change, writing a helper function that calls pa11y on the current selenium instance will not take much effort. I highly favour using the existing admin tests for accessibility as compared to writing and maintaining accessibility tests. One issue that I see with using pa11y as described above is redundancy in pa11y results because every time we would call pa11y, it would scan the whole page instead of only the new UI change. pa11y has an option rootElement to only test a subset of DOM but this would require the use of "#" id tag to identify the elements that I doubt might be present on every UI piece of admin. Other way than writing a whole accessibility testing suite is to iterate overall the Let me know your thoughts on the above points before I go ahead with something. |
Closing per #16372 (comment). Please continue discussing possible solutions in the ticket. |
Fixes ticket-33620
This is a PoC on how we could easily integrate aXe with existing selenium tests.
To test this, first, install axe-selenium-python. Add the
run_axe
decorator to the selenium tests that you need to run accessibility tests on.This approach helps in the following:
Things to improve this could be
axe
is run towards the end of tests so it would be better if we run axe after each action or UI change../runtests.py
commandThis approach would work in GHA as well, we could either run tests headlessly or use
xfvb
to make a virtual frame buffer to mimic having a monitor in GHAs.You can test the current single test on which I have added the decorator using the following.
Let me know your thoughts on how you are imagining this to work.