Accessibility Testing – Javascript Library Roundup

May 19, 2014 Cameron Cundiff

If you’re a developer looking to build accessibility assertions into your own testing tool, there are a few things you’ll want to look for:

  1. A javascript library – high fidelity accessibility testing need to happen after the DOM has rendered.
  2. A standalone library that you can run in development and CI.
  3. Open source, for its transparency and flexibility

Here I’ve listed three libraries that meet the above criteria, along with some of the finer points about the tools, including license, standards covered, unit test coverage, and documentation detail.


HTML CodeSniffer

HTML CodeSniffer is an open source, “BSD-style license” javascript accessibility auditing library. It has rules for all levels of WCAG 2.0 as well as Section 508 guidelines. It also has a basic PhantomJS command line runner bundled in the project. The library does not have any unit tests for the assertions it defines.

HTML CodeSniffer is used to power the bookmarklet by the same name, as well as Pa11y, a hosted testing tool.

Strengths

  • Tests map discretely to standardized guidelines

  • Test result objects have clear descriptions

Weaknesses

  • No unit or behavioral tests

  • Sparse documentation

Accessibility Developer Tools

Google’s Accessibility Developer Tools is a javascript library released under the Apache 2.0 license. It defines rules based on WCAG 2.0 and general best practices. The rules have comprehensive unit and behavioral tests. While the audit results have links to a detailed description with associated standards, the standard is not included explicitly.

Accessibility Developer Tools is available bundled as a Chrome Extension.

Strengths

  • Robust consideration of WAI-ARIA techniques

  • Good unit test coverage

Drawbacks

  • Finding associated WCAG standards is an extra step away

Quail

Quail is MIT licensed, with a set of assertions that are well tested and have a clear mapping to WCAG 1.0 and 2.0 standards as well as Section 508 rules. It is a comprehensive and well documented library. Its biggest drawback is that it does not have a browser based extension or plugin, and that makes it harder to evaluate out of the box.

Strengths

  • Flexible license

  • Good documentation

  • Thoroughly tested

Drawbacks

  • No associated plugin or extension


Whatever you decide on, keep in mind that automated accessibility testing is never a complete picture of accessibility. Make sure to smoke test with screen readers and keyboard navigation, and present the app to folks with disabilities and see what works (and what doesn’t).

About the Author

Biography

Previous
Unit-Testing AngularJS in a Rails app using the Jasmine gem
Unit-Testing AngularJS in a Rails app using the Jasmine gem

Testing AngularJS applications is easy with Jasmine. If you look at the AngularJS docs, many of the code ex...

Next
World's Smallest IaaS, Part 2
World's Smallest IaaS, Part 2

In this blog post, we describe the procedure to deploy Pivotal CF Operations Manager (a web-based tool for ...