Skip to content

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

Merged
merged 4 commits into from
Dec 13, 2016

Conversation

devversion
Copy link
Member

  • 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

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 28, 2016
@devversion devversion force-pushed the chore/protractor-axe-core branch from 1449640 to 0fb1dd4 Compare November 28, 2016 19:45
@devversion devversion changed the title echore: run a11y audits on protractor chore: run a11y audits on protractor Nov 28, 2016
<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">
Copy link
Member

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 = {};
Copy link
Member

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) {
Copy link
Member

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 => {
Copy link
Member

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.

Copy link
Member Author

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',
Copy link
Member

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?

Copy link
Member Author

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)

@devversion devversion force-pushed the chore/protractor-axe-core branch from 0fb1dd4 to f2d1cc7 Compare November 29, 2016 17:49
@jelbourn
Copy link
Member

@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.

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Nov 29, 2016
@devversion devversion force-pushed the chore/protractor-axe-core branch from f2d1cc7 to 9c5468a Compare December 1, 2016 14:44
@devversion devversion force-pushed the chore/protractor-axe-core branch from 9c5468a to 4eeef8d Compare December 2, 2016 18:10
@devversion
Copy link
Member Author

@tinayuangao Rebased again 😄

@devversion devversion added in progress This issue is currently in progress and removed action: merge The PR is ready for merge by the caretaker labels Dec 2, 2016
@devversion devversion force-pushed the chore/protractor-axe-core branch 3 times, most recently from 7a2d724 to af8df2f Compare December 11, 2016 18:49
* 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
@devversion devversion force-pushed the chore/protractor-axe-core branch from af8df2f to 3c30766 Compare December 11, 2016 19:21
@devversion
Copy link
Member Author

devversion commented Dec 11, 2016

@jelbourn This should be ready for another review.

The md-nav-list is making the link items bigger and the menus displayed differently.

Hiding them by default ensures that the links don't interfere with the specs.

@devversion devversion added pr: needs review and removed in progress This issue is currently in progress labels Dec 11, 2016
@devversion devversion requested a review from jelbourn December 11, 2016 20:25
@jelbourn
Copy link
Member

@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?

@devversion
Copy link
Member Author

@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.

I'd stick for now with the ngIf approach, because we might add other e2e pages here and we should make the menu tests stable in another PR.

@jelbourn jelbourn added action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Dec 13, 2016
@devversion
Copy link
Member Author

@jelbourn Just rebased with the new Github functionality

Unfortunately you cannot just rebase and force-push with that.

@jelbourn jelbourn merged commit c5fb94f into angular:master Dec 13, 2016
@devversion devversion deleted the chore/protractor-axe-core branch December 13, 2016 20:11
@dylanb
Copy link

dylanb commented Dec 13, 2016

Yay!!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants