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

xeroxinteractive/gulp-puppeteer-accessibility-audit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gulp Puppeteer Accessibility Audit

Gulp plugin for Puppeteer Accessibility Audit

Installation

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

or

yarn add --dev gulp-puppeteer-accessibility-audit

Usage

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

gulp.task('audit', function () {
  return gulp.src('./**/*.html')
    .pipe(paa())
    .pipe(paa.reporter());
});

Reporters

There are 3 reporters available for use.

  • reporter - Reports at the end all passes and fails, does not trigger a failure
  • failAfterError - Reports at the end but only prints failures and will emit an error
  • failOnError - Will emit an error on the first failure

Config

All config data passed into paa will be passed directly to Puppeteer Accessibility Audit

  • 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

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

gulp.task('audit', function () {
  return gulp.src('./**/*.html')
    .pipe(paa({
      puppeteerConfig: {
        timeout: 5000,
        headless: false
      },
      viewport: {
        width: 1920,
        height: 1080
      },
      auditScopeSelector: "#content"
    }))
    .pipe(paa.reporter());
});

Credits

Lots of copy and pasting of gulp-a11y by Michael Pezzi

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published