On this page:
- Using NAV-Ally in your project
- Web Driver and Docker setup
- As a module in your existing project
- Running NAV-Ally standalone
- Command line arguments
Using NAV-Ally in your project
Web Driver and Docker setup
You must have a web driver installed and set in the path, before starting. On MacOS/Linux, you can do that easily with Brew:
$ brew cask install chromedriver
As a module in your existing project:
-
Add the module to your project
npm install --save-dev nav-ally
-
Create a Yaml-based definition file and add it anywhere in your project (preferably on the root folder):
Paste in the following example content in a file called wcag.yml:
links: - "http://google.com"
-
Create a run script in your package.json:
“wcag-test”:”nav-ally -f wcag.yml”
This will tell NAV-Ally to use the file called “wcag.yml”. Validation will fail on any violation. If you want to allow up to x errors , add the -M flag (not recommended):
“wcag-test”:”nav-ally -M 3 -f wcag.yml”
-
You can now run the validator:
$ npm run wcag-test
Command line arguments
Argument | Description |
---|---|
-V, –version | output the version number |
-f, –definition-file | set definition file |
–headless | run in headless mode (default: “yes”) |
-r, –detailed-report | print a detailed report |
-d, –debug-info | prints out debug info to console if set |
-w, –warnings | validation fails on warnings too if set |
-M, –max-errors | accept up “M” number of errors |
-h, –help | output usage information |
You can specify single letter args (those without values) together. For example to enable detailed report, debug info and fail on warnings:
"wcag-test":"nav-ally -drw -f wcag.yml"
### <a id="standalone"> Running NAV-Ally standalone
1. Install NAV-Ally globally from NPM:
`$ npm install -g nav-ally`
2. Run the following command to run the validator with a given definition file:
`$ nav-ally -f wcag.yml`