-
Notifications
You must be signed in to change notification settings - Fork 6.8k
chore: run a11y audits on protractor #2010
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
chore: run a11y audits on protractor #2010
Conversation
1449640
to
0fb1dd4
Compare
<a md-list-item [routerLink]="['radio']">Radios</a> | ||
<a md-list-item [routerLink]="['tabs']">Tabs</a> | ||
<!-- To avoid interfering with tests, we are not using the <md-list> element here --> | ||
<div role="list"> |
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.
This should be a <md-nav-list>
const {buildMessage} = require('./build-message'); | ||
|
||
/* Resolved violations */ | ||
const violations = {}; |
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.
Add more explanation to the comment about the structure of this object.
} | ||
|
||
/** Handles the results of axe-core. */ | ||
function handleResults(context, results) { |
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.
handleAxeResults
?
Also expand the comments with some explanation of what we're doing with those results.
@@ -0,0 +1,11 @@ | |||
exports.buildMessage = violation => { |
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.
Add description for what this does.
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.
Done
|
||
plugins: [ | ||
{ | ||
path: '../tools/axe-protractor/axe-protractor.js', |
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.
At which point in the e2e test does axe run?
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.
I added a short comment for it.
Runs the axe-core accessibility checks each time the e2e page changes and Angular is ready.
It basically means that the A11y check runs each time the e2e app changes its page.
Unfortunately we are not that flexible here, because the Protractor API does not provide much hooks (See https://github.com/angular/protractor/blob/master/docs/plugins.md)
0fb1dd4
to
f2d1cc7
Compare
@devversion LGTM, we can iterate on this in the future. @juliemr are you open to expanding the protractor hooks for plugins? I was thinking it might be useful to have a hook for when the test is complete. |
f2d1cc7
to
9c5468a
Compare
9c5468a
to
4eeef8d
Compare
@tinayuangao Rebased again 😄 |
7a2d724
to
af8df2f
Compare
* Fixes accessibility issue in grid-list with `role="listitem"` * Adds protractor plugin to run aXe-core accessibility audits * Fixes a bunch of a11y issues in the e2e app to make the aXe audits green
af8df2f
to
3c30766
Compare
…fere with the tests.
@jelbourn This should be ready for another review. The
|
@devversion Sounds like the menu tests are somewhat brittle, then... What if we just made it not a nav-list at all and just used regular anchors? |
@jelbourn Yep. The menu tests can always fail when the browser viewport is too small. As long as the anchors don't take up too much space this should work.
|
@jelbourn Just rebased with the new Github functionality
|
Yay!! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
role="listitem"