Skip to content

Instantly share code, notes, and snippets.

@chrisoverstreet
Last active March 9, 2020 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisoverstreet/2c99d7012aed02653e0293605c4eef00 to your computer and use it in GitHub Desktop.
Save chrisoverstreet/2c99d7012aed02653e0293605c4eef00 to your computer and use it in GitHub Desktop.
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 demo+admin@homeeondemand.com',
'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`);
})();
@chrisoverstreet
Copy link
Author

chrisoverstreet commented Mar 9, 2020

Instructions:

  1. Install node
  2. Copy file into a new directory
  3. Run npm init --y
  4. Run npm i -S pa11y, pa11y-reporter-html, open

Usage:

node homee-pa11y.js https://workshop.dev.homee.com/workbench/active

Generates an html file, results.html in same directory. You can open this in your browser to see results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment