The A11y Machine
The A11y Machine (or
a11ym for short, spelled “alym”) is an automatedaccessibility testing tool which crawls and tests pages of any Webapplication to produce detailed reports. It validates pages against thefollowing specifications/laws:
- W3C Web Content Accessibility Guidelines(WCAG) 2.0, including A, AA and AAA levels (understanding levels ofconformance),
- U.S. Section 508 legislation,
- W3C HTML5 Recommendation.
Table of contents
- Roadmap and board
- Authors and license
If privacy matters for you, you're likely to install The A11y Machine overany SaaS services: It runs locally so you don't need to send your codesomewhere, you can test all parts of your application including the ones whichrequire an authentification (like a checkout, a back-office etc.)…
Here are some pros and cons compared to SaaS solutions:
Properties | The A11y Machine | SaaS services-----------|------------------|---------------Can run locally | yes | noCan test each patch | yes | no (except if deployed)Reduce the test loop | yes | no (the loop is longer)Can test private code | yes | no (you must send your code)Can test auth-required parts | yes | noCan crawl all your pages | yes | yes (but it can be pricey)
Accessibility is not only a concern for disabled people. Bots can be consideredas such, like DuckDuckGo,Google or Bing. By respecting thesestandards, you're likely to have a better ranking. Also it helps to clean yourcode. Accessibility issues are often left unaddressed for budget reasons. Infact most of the cost is spent looking for errors on your website. The A11yMachine greatly help with this task, you can thus focus on fixing your code andreap the benefits.
NPM is required. Then, execute the following lines:
sh$ npm install -g the-a11y-machine
If you would like to validate your pages against the HTML5 recommendation, thenyou need to install Java.
As an alternative you can run a Docker image instead, which will ensure the imageis available locally:
sh$ docker build -t liip/the-a11y-machine .$ docker run liip/the-a11y-machine --help
To get access to a report you will need to:
- Mount a path into the container,
- Specifify that internal path in your
sh$ docker run -v $PWD:/var/output liip/the-a11y-machine -o /var/output http://example.org
As a prelude, see the help:
```sh Usage: a11ym [options] url …
-h, --help output usage information-b, --bootstrap Bootstrap file, i.e. the configuration file. All CLI options will overwrite options defined in the configuration file.-e, --error-level Minimum error level: In ascending order, `notice` (default), `warning`, and `error` (e.g. `warning` includes all warnings and errors).-c, --filter-by-codes Filter results by comma-separated WCAG codes (e.g. `H25,H91,G18`).-C, --exclude-by-codes Exclude results by comma-separated WCAG codes (e.g. `H25,H91,G18`).-d, --maximum-depth Explore up to a maximum depth (hops).-m, --maximum-urls Maximum number of URLs to compute.-o, --output-directory Output directory.-r, --report Report format: `cli`, `csv`, `html` (default), `json` or `markdown`.-s, --standards Standard to use: `WCAG2A`, `WCAG2AA` (default), ` WCAG2AAA`, `Section508`, `HTML` or your own (see `--sniffers`). `HTML` can be combined with any other by a comma.-S, --sniffers Path to the sniffers file, e.g. `resource/sniffers.js` (default).-u, --filter-by-urls Filter URL to test by using a regular expression without delimiters (e.g. 'news|contact').-U, --exclude-by-urls Exclude URL to test by using a regular expression without delimiters (e.g. 'news|contact').-w, --workers Number of workers, i.e. number of URLs computed in parallel.--http-auth-user Username to authenticate all HTTP requests.--http-auth-password Password to authenticate all HTTP requests.--http-tls-disable Disable TLS/SSL when crawling or downloading pages.-V, --no-verbose Make the program silent.--ignore-robots-txt Ignore robots.txt file.
Thus, the simplest use is to run
a11ym with a URL:
sh$ ./a11ym http://example.org/
All URLs accessible from
http://example.org/ will be tested against theWCAG2AA standard. See the
--maximum-urls options to reduce the number ofURLs to test.
a11ym_output/index.html and browser the result!
List of URLs instead of crawling
You can compute several URLs by adding them to the command-line, like this:
sh$ ./a11ym http://example.org/A http://example.org/B http://example.org/C
Alternatively, this is possible to read URLs from STDIN, as follows:
sh$ cat URLs.lists | ./a11ym -
-: It means “Read URLs from STDIN please”.
When reading several URLs, the
--maximum-depth option will be forced to 1.
The index of the reports:
Report of a specific URL:
The dashboard of all reports:
As mentionned, the following standards are supported: * W3C WCAG, * U.S. Section 508 legislation, * W3C HTML5 recommendation.
You cannot combine standards between each other, except HTML5 that can becombined with any other. So for instance, to run
sh$ ./a11ym --standards WCAG2AAA http://example.org/
WCAG2AA along with
sh$ ./a11ym --standards WCAG2AA,HTML http://example.org/
How does it work?
The pipe looks like this:
node-simplecrawlertool is used to crawl a Web application based on the given URLs, with our own specific exploration algorithm to provide better results quickly, in addition to support parallelism,
- For each URL found, 2 kind of tests are applied:
- Finally, results from different tools are normalized, and enhanced and easy to use reports are produced.
HTML_CodeSniffer are widely-used, tested and precise tools.
pa11y simplifies the use of these two latters. The Nu Html Checker is the toolused by the W3C to validate documents online. However, in this case, we do allvalidations offline! Nothing is sent over the network. Again, privacy.
Write your custom rules
HTML_CodeSniffer is build in a way that allows you to extend existing rules orwrite your own. A rule is represented as a sniffer (this is anotherterminology). The
resource/sniffers/ directory contains an example ofa custom sniffer.
The A11y Machine comes with a default file containing all the sniffers:
resource/sniffers.js. You can provide your own by using the
--sniffersoption. To build your own sniffers, simply copy the
resource/sniffers/somewhere as a basis, complete it, then compile it with the
sh$ ./a11ym-sniffers --directory my/sniffers/ --output-directory my_sniffers.js
Then, to effectively use it:
sh$ ./a11ym --sniffers my_sniffers.js --standard MyStandard http://example.org/
Watch the dashboard
a11ym-dashboard command to serve the dashboard. The dashboard is anoverview of several reports generated by the
a11ym command. The command canserves the dashboard over HTTP, or over static files. In addition to requiringa root directory, it requires: In the first case, an address, and a port, in thesecond, nothing more than just a flag. For instance, if the reports aregenerated with the following command:
sh$ ./a11ym --output-directory my_reports/`date +%s`/ http://example.org/A http://example.org/B
Then, the root directory is
my_reports/ and thus the dashboard will be startedover HTTP with the following command:
sh$ ./a11ym-dashboard --root my_reports
127.0.0.1:8080 (by default) to see the dashboard!
Or to generate static files:
sh$ ./a11ym-dashboard --root my_reports --static-output
my_reports/index.html, and do the same!
Bonus: Use the
--open option to automatically open the dashboard in yourfavorite browser.
Roadmap and board
The board is publicly available at the following URL: https://waffle.io/liip/TheA11yMachine.
Authors and license
Copyright (c), Ivan Enderlin and Liip All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The A11y Machine is an automated accessibility testing tool which crawls and tests pages of any web application to produce detailed reports.
Download the bundle liip-TheA11yMachine_-_2017-06-06_05-41-10.bundle and run:
git clone liip-TheA11yMachine_-_2017-06-06_05-41-10.bundle -b master
Upload date: 2015-12-16
- 2017-06-06 05:41:10
- Internet Archive Python library 1.5.0
- iagitup - v1.0