Accessibility Testing – Javascript Library Roundup

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:

A javascript library – high fidelity accessibility testing need to happen after the DOM has rendered.

A standalone library that you can run in development and CI.

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.

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