Pa11y CI

4.1.0 · active · verified Tue Apr 21

Pa11y CI is an accessibility testing tool built upon the core Pa11y library, specifically engineered for integration into Continuous Integration (CI) workflows. It facilitates automated auditing of web applications against WCAG standards by scanning a defined list of URLs or a sitemap. The current stable version is `4.1.0`, actively maintained with updates often synchronizing with its upstream dependencies like Pa11y and Puppeteer. Its key differentiators include its robust command-line interface, making it ideal for CI environments, and its flexible configuration system that supports both JSON and JavaScript files. This allows for fine-grained control over testing parameters, including parallel execution, browser contexts, and specific Pa11y options per URL, enabling comprehensive and efficient accessibility validation. It leverages a headless Chromium browser to perform accurate, real-world accessibility checks.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates configuring Pa11y CI with a JavaScript file for multiple URLs and executing it via the command line, including per-URL overrides.

/* .pa11yci.js */
module.exports = {
  defaults: {
    timeout: 5000,
    viewport: {
      width: 1280,
      height: 720
    },
    // Example: Use the 'json' reporter for CI integration
    reporter: 'json'
  },
  urls: [
    'https://pa11y.org/',
    {
      url: 'https://pa11y.org/contributing',
      // Override default timeout for a potentially slow page
      timeout: 10000,
      // Example of per-URL pa11y configuration
      actions: ['click element #nav-menu-button', 'wait for path to be /contributing']
    },
    'https://example.com' // Another URL to test
  ]
};

// To run this configuration from your terminal:
// npm install -g pa11y-ci
// pa11y-ci --config .pa11yci.js

// If installed locally:
// npm install pa11y-ci
// npx pa11y-ci --config .pa11yci.js

view raw JSON →