Run accessibility tests in Chrome at development time.
This will enable running accessibility tests via Tenon on:
- static sites (via url)
- dynamic sites (via browser navigation)
How It Works
- Opens a headless version of Chrome.
- Executes your test commands to drive Chrome via DevTools API.
- Sends HTML source to Tenon.
- Creates Tenon report locally and on tenon.io.
This requires you to have set up an account and API key with tenon.io.
- Create a local npm project with this module as a dependency.
npm install --save https://github.com/rei/a11y-devtools.git
- Sign into tenon.io and
- Copy your API key from tenon.io.
- Set up a new Project in your tenon account. Make note of the
- Copy the example file into your project directory and modify per your info above.
- Add tests.
- Run via
babel-node <your_test_file>.js; (babel-node if you're on node v6.x)
- Your report will be written locally as well as being displayed in your Tenon project via the Tenon.io site.
- Under the hood, this uses a package called
puppeteerfor driving Chrome via the Chrome DevTools API. Consult the puppeteer API docs for specific commands to drive browser.
- Turn the
headlessoption off while writing Chrome navigation commands so you can see the browser running your commands.
- Since this tool is rendering the entire page DOM, it is sensitive to timing. See the frame.waitForX commands.
- Unit tests.
Currently, due to CentOS not supporting Chrome, this tool can only be run locally (for now). Create Docker container for this tool.