Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

xeroxinteractive/puppeteer-accessibility-audit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Puppeteer Accessibility Audit

Lightweight library for performing accessibility audits of URL's or files using Chrome Accessibility Tools

Utilises GoogleChrome/puppeteer and GoogleChrome/accessibility-developer-tools.

Installation

npm install --save-dev puppeteer-accessibility-audit

or

yarn add --dev puppeteer-accessibility-audit

Usage

const paa = require('puppeteer-accessibility-audit');

// Launch puppeteer to begin auditing
await paa.launch();

// Audit the supplied file and return the result
let paaResult = await paa.audit("test-file.html", opts);

// This is important to terminate any running chromium processes
await paa.destroy();

audit() will return an object with two properties

Config

Config can be supplied to paa.launch()

  • puppeteerConfig is passed to: puppeteer.launch
  • viewport is passed to: page.setViewport
  • auditScopeSelector is used to target the audit and is passed to a document.querySelector.

For example

await paa.launch({
  puppeteerConfig: {
    timeout: 5000,
    headless: false
  },
  viewport: {
    width: 1920,
    height: 1080
  },
  auditScopeSelector: "#content"
});

Credits

Lots of copy and pasting of a11y by Addy Osmani

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published