Pa11y CI
Pa11y CI is a command-line CI-friendly tool to run against urls and supports basic scripting.
Installation
npm install -g pa11y-ci
npm install -g pa11y-ci-reporter-html"
Creating a configuration file
The configuration below is example when a site requires authentication, and will first run a login script, before checking all subsequently listed pages.
pa11y_config_example.js
{
"defaults": {
"chromeLaunchConfig": {
"ignoreHTTPSErrors": true
},
"useIncognitoBrowserContext": false,
"includeWarnings": true,
"timeout": 180000,
"wait": 60000,
"concurrency": 1,
"standard": "WCAG2AA",
"runners": [
"htmlcs"
],
"reporters": [
"pa11y-ci-reporter-html"
]
},
"urls": [
{
"url": "https://www.sitewithalogin.com",
"actions": [
"wait for #login_id to be visible",
"set field #login_id to auser@asite.co.uk",
"set field #password to Password1",
"click element #submit",
"wait for #user_avatar to be visible"
]
},
"https://www.sitewithalogin.com/page1",
"https://www.sitewithalogin.com/page2",
"https://www.sitewithalogin.com/page3",
]
}
Running Pa11y CI
pa11y-ci --config pa11y_config_example.js