Last active
March 9, 2020 19:16
-
-
Save chrisoverstreet/2c99d7012aed02653e0293605c4eef00 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const html = require('pa11y-reporter-html'); | |
const pa11y = require('pa11y'); | |
const fs = require('fs'); | |
const open = require('open'); | |
const [, , url] = process.argv; | |
(async () => { | |
console.log(`Signing in as admin user...`); | |
const results = await pa11y('https://workshop.dev.homee.com/login/internal', { | |
actions: [ | |
'set field #login-email to [email protected]', | |
'set field #login-password to !homeeSiteAdmin989!', | |
`click element button[type=submit]`, | |
`wait for path to not be /login/internal`, | |
`navigate to ${url}`, | |
], | |
reporter: 'html', | |
}); | |
const htmlResults = await html.results(results); | |
fs.writeFileSync(`${__dirname}/results.html`, htmlResults); | |
console.log(`Report ready at: file://${__dirname}/results.html`); | |
await open(`${__dirname}/results.html`); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instructions:
npm init --y
npm i -S pa11y, pa11y-reporter-html, open
Usage:
Generates an html file,
results.html
in same directory. You can open this in your browser to see results.