1.1.8 • Published 8 years ago
gulp-puppeteer-accessibility-audit v1.1.8
Gulp Puppeteer Accessibility Audit
Gulp plugin for Puppeteer Accessibility Audit
Installation
npm install --save-dev gulp-puppeteer-accessibility-auditor
yarn add --dev gulp-puppeteer-accessibility-auditUsage
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 failurefailAfterError- Reports at the end but only prints failures and will emit an errorfailOnError- Will emit an error on the first failure
Config
All config data passed into paa will be passed directly to Puppeteer Accessibility Audit
puppeteerConfigis passed to: puppeteer.launchviewportis passed to: page.setViewportauditScopeSelectoris used to target the audit and is passed to adocument.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