angular / protractor-accessibility-plugin

Runs a set of accessibility audits
MIT License
266 stars 37 forks source link

aXe audits for end-to-end tests #17

Open angela-choo opened 7 years ago

angela-choo commented 7 years ago

I'm running through my end-to-end tests and noticed that aXe is only running the audit at the end of the end-to-end test. Correct me if I'm wrong, audits should be done all the time and not just at the end. Has anyone encountered this problem?

aXe operates similarly to Chrome's Accessibility Developer Tools by injecting axe-core into all frames and checking the content against 53 accessibility rules.

Thank you.

dylanb commented 7 years ago

@angela-choo you are correct, you should be running the audit each time the UI gets into a new state, if you want to be sure to catch all the issues.

One of the strengths of this plugin is that it is VERY easy to use. The downside is that it does only what you have identified.

It would be great if we could enhance the plugin so that you could tell it at what points in your test to perform accessibility analysis.

The underlying axe-webdriverjs plugin does have this capability. I am not sure whether it would be possible to expose that through the plugin so that the test writer could call AxeBuilder.analyze() at the appropriate points (maybe one of the contributors could comment on this)?

In the interim, you could use the axe-webdriverjs plugin directly to achieve what you want.

contolini commented 7 years ago

@angela-choo Check out https://github.com/angular/protractor-accessibility-plugin/pull/9 and https://github.com/angular/protractor/issues/2951 for more details.