Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

pa11y

pa11y721.5kLGPL-3.0-only9.0.0TypeScript support: definitely-typed

Pa11y is your automated accessibility testing pal

accessibility, analysis, cli, report

readme

Pa11y

Pa11y is your automated accessibility testing pal. It runs accessibility tests on your pages via the command line or Node.js, so you can automate your testing process.

NPM version Node.js version support Build status LGPL-3.0-only licensed

On the command line:

pa11y https://example.com

In JavaScript:

const pa11y = require('pa11y');

pa11y('https://example.com').then((results) => {
    // Use the results
});

Requirements

Pa11y 8 requires Node.js 18 or 20. An older version of Node.js can be used with Pa11y 6 or below.

Linux and macOS

To install Node.js you can use nvm. For example, to install with nvm with Homebrew, and then install the latest version of Node:

brew install nvm
nvm install node
nvm install-latest-npm

Alternatively, download a pre-built package from the Node.js website for your operating system.

Windows

On Windows 10, download a pre-built package from the Node.js website. Pa11y will be usable via the bundled Node.js application as well as the Windows command prompt.

Command-line interface

Install Pa11y globally with npm:

npm install -g pa11y
$ pa11y --help

Usage: pa11y [options] <url>

  Options:

    -V, --version                  output the version number
    -n, --environment              output details about the environment Pa11y will run in
    -s, --standard <name>          the accessibility standard to use: WCAG2A, WCAG2AA (default), WCAG2AAA – only used by htmlcs runner
    -r, --reporter <reporter>      the reporter to use: cli (default), csv, json
    -e, --runner <runner>          the test runners to use: htmlcs (default), axe
    -l, --level <level>            the level of issue to fail on (exit with code 2): error, warning, notice
    -T, --threshold <number>       permit this number of errors, warnings, or notices, otherwise fail with exit code 2
    -i, --ignore <ignore>          types and codes of issues to ignore, a repeatable value or separated by semi-colons
    --include-notices              Include notices in the report
    --include-warnings             Include warnings in the report
    -R, --root-element <selector>  a CSS selector used to limit which part of a page is tested
    -E, --hide-elements <hide>     a CSS selector to hide elements from testing, selectors can be comma separated
    -c, --config <path>            a JSON or JavaScript config file
    -t, --timeout <ms>             the timeout in milliseconds
    -w, --wait <ms>                the time to wait before running tests in milliseconds
    -d, --debug                    output debug messages
    -S, --screen-capture <path>    a path to save a screen capture of the page to
    -A, --add-rule <rule>          WCAG 2.1 rules to include, a repeatable value or separated by semi-colons – only used by htmlcs runner
    -h, --help                     output usage information

Testing with pa11y

Find accessibility issues at a URL:

pa11y https://example.com

The default test runner is HTML_CodeSniffer, but axe is also supported. To use axe:

pa11y https://example.com --runner axe

Use both axe and HTML_CodeSniffer in the same run:

pa11y https://example.com --runner axe --runner htmlcs

Generate results in CSV format, and output to a file, report.csv:

pa11y https://example.com > report.csv --reporter csv 

Find accessibility issues in a local HTML file (absolute paths only, not relative):

pa11y ./path/to/your/file.html

Exit codes

The command-line tool uses the following exit codes:

  • 0: Pa11y ran successfully, and there are no errors
  • 1: Pa11y failed run due to a technical fault
  • 2: Pa11y ran successfully but there are errors in the page

By default, only accessibility issues with a type of error will exit with a code of 2. This is configurable with the --level flag which can be set to one of the following:

  • error: exit with a code of 2 on errors only, exit with a code of 0 on warnings and notices
  • warning: exit with a code of 2 on errors and warnings, exit with a code of 0 on notices
  • notice: exit with a code of 2 on errors, warnings, and notices
  • none: always exit with a code of 0

Command-line configuration

The command-line tool can be configured with a JSON file as well as arguments. By default it will look for a pa11y.json file in the current directory, but you can change this with the --config flag:

pa11y https://example.com --config ./path/to/config.json 

If any configuration is set both in a configuration file and also as a command-line option, the value set in the latter will take priority.

For more information on configuring Pa11y, see the configuration documentation.

Ignoring

The ignore flag can be used in several different ways. Separated by semi-colons:

pa11y https://example.com --ignore "issue-code-1;issue-code-2" 

or by using the flag multiple times:

pa11y https://example.com --ignore issue-code-1 --ignore issue-code-2 

Pa11y can also ignore notices, warnings, and errors up to a threshold number. This might be useful if you're using CI and don't want to break your build. The following example will return exit code 0 on a page with 9 errors, and return exit code 2 on a page with 10 or more errors.

pa11y https://example.com --threshold 10 

Reporters

The command-line tool can provide test results in a few different ways using the --reporter flag. The built-in reporters are:

  • cli: output test results in a human-readable format
  • csv: output test results as comma-separated values
  • html: output test results as an HTML page
  • json: output test results as a JSON array
  • tsv: output test results as tab-separated values

You can also write and publish your own reporters. Pa11y looks for reporters in your node_modules folder (with a naming pattern), and the current working directory. The first reporter found will be loaded. So with this command:

pa11y https://example.com --reporter rainbows 

The following locations will be checked:

<cwd>/node_modules/pa11y-reporter-rainbows
<cwd>/rainbows

A Pa11y reporter must export a string property named supports. This is a semver range which indicates which versions of Pa11y the reporter supports:

exports.supports = '^8.0.0';

A reporter should export the following methods, each returning one string. If your reporter needs to perform asynchronous operations, then it may return a promise which resolves to a string:

begin(); // Called when pa11y starts
error(message); // Called when a technical error is reported
debug(message); // Called when a debug message is reported
info(message); // Called when an information message is reported
results(results); // Called with a test run's results

JavaScript interface

Add Pa11y to your project with npm, most commonly as a development dependency:

npm install pa11y --save-dev

Require Pa11y:

const pa11y = require('pa11y');

Run Pa11y against a URL, the pa11y function returns a Promise:

pa11y(url).then((results) => {
    // Use the results
});

Pa11y can also be run with options:

const options = { /* ... */ };
pa11y(url, options)).then((results) => {
    // Use the results
});

Pa11y resolves with a results object, containing details about the page, and an array of accessibility issues found by the test runner:

{
    pageUrl: 'The tested URL',
    documentTitle: 'Title of the page under test',
    issues: [
        {
            code: 'WCAG2AA.Principle1.Guideline1_1.1_1_1.H30.2',
            context: '<a href="https://example.com/"><img src="example.jpg" alt=""/></a>',
            message: 'Img element is the only content of the link, but is missing alt text. The alt text should describe the purpose of the link.',
            selector: 'html > body > p:nth-child(1) > a',
            type: 'error',
            typeCode: 1
        }
    ]
}

Transforming the results

If you wish to transform these results with a command-line reporter, require it into your code. The csv, tsv, html, json, and markdown reporters each expose a method process:

// Assuming you've already run tests, and the results
// are available in a `results` variable:
const htmlReporter = require('pa11y/lib/reporters/html');
const html = await htmlReporter.results(results);

async/await

Pa11y uses promises, so you can use async functions and the await keyword:

async function runPa11y() {
    try {
        const results = await pa11y(url);
        // Use the results
    }
    catch (error) {
        // Handle error
    }
}

runPa11y();

Callback interface

For those who prefer callbacks to promises:

pa11y(url, (error, results) => {
    // Use results, handle error
});

Validating actions

Pa11y's isValidAction function can be used to validate an action string ahead of its use:

pa11y.isValidAction('click element #submit');  // true
pa11y.isValidAction('open the pod bay doors'); // false

Configuration

Pa11y has lots of options you can use to change the way Headless Chrome runs, or the way your page is loaded. Options can be set either as a parameter on the pa11y function or in a JSON configuration file. Some are also available directly as command-line options.

Below is a reference of all the options that are available:

actions (array)

Actions to be run before Pa11y tests the page. There are quite a few different actions available in Pa11y, the Actions documentation outlines each of them.

pa11y(url, {
    actions: [
        'set field #username to exampleUser',
        'set field #password to password1234',
        'click element #submit',
        'wait for path to be /myaccount'
    ]
});

Defaults to an empty array.

browser (Browser) and page (Page)

A Puppeteer Browser instance which will be used in the test run. Optionally you may also supply a Puppeteer Page instance, but this cannot be used between test runs as event listeners would be bound multiple times.

If either of these options are provided then there are several things you need to consider:

  1. Pa11y's chromeLaunchConfig option will be ignored, you'll need to pass this configuration in when you create your Browser instance
  2. Pa11y will not automatically close the Browser when the tests have finished running, you will need to do this yourself if you need the Node.js process to exit
  3. It's important that you use a version of Puppeteer that meets the range specified in Pa11y's package.json
  4. You cannot reuse page instances between multiple test runs, doing so will result in an error. The page option allows you to do things like take screen-shots on a Pa11y failure or execute your own JavaScript before Pa11y

Note: This is an advanced option. If you're using this, please mention in any issues you open on Pa11y and double-check that the Puppeteer version you're using matches Pa11y's.

const browser = await puppeteer.launch({
    ignoreHTTPSErrors: true
});

pa11y(url, {
    browser: browser
});

browser.close();

A more complete example can be found in the puppeteer examples.

Defaults to null.

chromeLaunchConfig (object)

Launch options for the Headless Chrome instance. See the Puppeteer documentation for more information.

pa11y(url, {
    chromeLaunchConfig: {
        executablePath: '/path/to/Chrome',
        ignoreHTTPSErrors: false
    }
});

Defaults to:

{
    ignoreHTTPSErrors: true
}

headers (object)

A key-value map of request headers to send when testing a web page.

pa11y(url, {
    headers: {
        Cookie: 'foo=bar'
    }
});

Defaults to an empty object.

hideElements (string)

A CSS selector to hide elements from testing, selectors can be comma separated. Elements matching this selector will be hidden from testing by styling them with visibility: hidden.

pa11y(url, {
    hideElements: '.advert, #modal, div[aria-role=presentation]'
});

ignore (array)

An array of result codes and types that you'd like to ignore. You can find the codes for each rule in the console output and the types are error, warning, and notice. Note: warning and notice messages are ignored by default.

pa11y(url, {
    ignore: [
        'WCAG2AA.Principle3.Guideline3_1.3_1_1.H57.2'
    ]
});

Defaults to an empty array.

ignoreUrl (boolean)

Whether to use the provided Puppeteer Page instance as is or use the provided url. Both the Puppeteer Page instance and the Puppeteer Browser instance are required alongside ignoreUrl.

const browser = await puppeteer.launch();
const page = await browser.newPage();

pa11y(url, {
    ignoreUrl: true,
    page: page,
    browser: browser
});

Defaults to false.

includeNotices (boolean)

Whether to include results with a type of notice in the Pa11y report. Issues with a type of notice are not directly actionable and so they are excluded by default. You can include them by using this option:

pa11y(url, {
    includeNotices: true
});

Defaults to false.

includeWarnings (boolean)

Whether to include results with a type of warning in the Pa11y report. Issues with a type of warning are not directly actionable and so they are excluded by default. You can include them by using this option:

pa11y(url, {
    includeWarnings: true
});

Defaults to false.

level (string)

The level of issue which can fail the test (and cause it to exit with code 2) when running via the CLI. This should be one of error (the default), warning, or notice.

{
    "level": "warning"
}

Defaults to error. Note this configuration is only available when using Pa11y on the command line, not via the JavaScript Interface.

log (object)

An object which implements the methods debug, error, and info which will be used to report errors and test information.

pa11y(url, {
    log: {
        debug: console.log,
        error: console.error,
        info: console.info
    }
});

Each of these defaults to an empty function.

method (string)

The HTTP method to use when running Pa11y.

pa11y(url, {
    method: 'POST'
});

Defaults to GET.

postData (string)

The HTTP POST data to send when running Pa11y. This should be combined with a Content-Type header. E.g to send form data:

pa11y(url, {
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded'
    },
    method: 'POST',
    postData: 'foo=bar&bar=baz'
});

Or to send JSON data:

pa11y(url, {
    headers: {
        'Content-Type': 'application/json'
    },
    method: 'POST',
    postData: '{"foo": "bar", "bar": "baz"}'
});

Defaults to null.

reporter (string)

The reporter to use while running the test via the CLI. More about reporters.

{
    "reporter": "json"
}

Defaults to cli. Note this configuration is only available when using Pa11y on the command line, not via the JavaScript Interface.

rootElement (element)

The root element for testing a subset of the page opposed to the full document.

pa11y(url, {
    rootElement: '#main'
});

Defaults to null, meaning the full document will be tested. If the specified root element isn't found, the full document will be tested.

runners (array)

An array of runner names which correspond to existing and installed Pa11y runners. If a runner is not found then Pa11y will error.

pa11y(url, {
    runners: [
        'axe',
        'htmlcs'
    ]
});

Defaults to:

[
    'htmlcs'
]

rules (array)

An array of WCAG 2.1 guidelines that you'd like to include to the current standard. You can find the codes for each guideline in the HTML Code Sniffer WCAG2AAA ruleset. Note: only used by htmlcs runner.

pa11y(url, {
    rules: [
        'Principle1.Guideline1_3.1_3_1_AAA'
    ]
});

screenCapture (string)

A file path to save a screen capture of the tested page to. The screen will be captured immediately after the Pa11y tests have run so that you can verify that the expected page was tested.

pa11y(url, {
    screenCapture: `${__dirname}/my-screen-capture.png`
});

Defaults to null, meaning the screen will not be captured. Note the directory part of this path must be an existing directory in the file system – Pa11y will not create this for you.

standard (string)

The accessibility standard to use when testing pages. This should be one of WCAG2A, WCAG2AA, or WCAG2AAA. Note: only used by htmlcs runner.

pa11y(url, {
    standard: 'WCAG2A'
});

Defaults to WCAG2AA.

threshold (number)

The number of errors, warnings, or notices to permit before the test is considered to have failed (with exit code 2) when running via the CLI.

{
    "threshold": 9
}

Defaults to 0. Note this configuration is only available when using Pa11y on the command line, not via the JavaScript Interface.

timeout (number)

The time in milliseconds that a test should be allowed to run before calling back with a timeout error.

Please note that this is the timeout for the entire test run (including time to initialise Chrome, load the page, and run the tests).

pa11y(url, {
    timeout: 500
});

Defaults to 30000.

userAgent (string)

The User-Agent header to send with Pa11y requests. This is helpful to identify Pa11y in your logs.

pa11y(url, {
    userAgent: 'A11Y TESTS'
});

Defaults to pa11y/<version>.

viewport (object)

The viewport configuration. This can have any of the properties supported by the puppeteer setViewport method.

pa11y(url, {
    viewport: {
        width: 320,
        height: 480,
        deviceScaleFactor: 2,
        isMobile: true
    }
});

Defaults to:

{
    width: 1280,
    height: 1024
}

wait (number)

The time in milliseconds to wait before running HTML_CodeSniffer on the page.

pa11y(url, {
    wait: 500
});

Defaults to 0.

Actions

Actions are additional interactions that you can make Pa11y perform before the tests are run. They allow you to do things like click on a button, enter a value in a form, wait for a redirect, or wait for the URL fragment to change:

pa11y(url, {
    actions: [
        'click element #tab-1',
        'wait for element #tab-1-content to be visible',
        'set field #fullname to John Doe',
        'clear field #middlename',
        'check field #terms-and-conditions',
        'uncheck field #subscribe-to-marketing',
        'screen capture example.png',
        'wait for fragment to be #page-2',
        'wait for path to not be /login',
        'wait for url to be https://example.com/',
        'wait for #my-image to emit load',
        'navigate to https://another-example.com/'
    ]
});

Below is a reference of all the available actions and what they do on the page. Some of these take time to complete so you may need to increase the timeout option if you have a large set of actions.

click element <selector>

Clicks an element:

pa11y(url, {
    actions: [
        'click element #tab-1'
    ]
});

You can use any valid query selector, including classes and types.

set field <selector> to <value>

Sets the value of a text-based input or select:

pa11y(url, {
    actions: [
        'set field #fullname to John Doe'
    ]
});

clear field <selector>

Clears the value of a text-based input or select:

pa11y(url, {
    actions: [
        'clear field #middlename'
    ]
});

check field <selector>, uncheck field <selector>

Checks/unchecks an input of type radio or checkbox:

pa11y(url, {
    actions: [
        'check field #terms-and-conditions',
        'uncheck field #subscribe-to-marketing'
    ]
});

screen capture <to-file-path.png>

Captures the screen, saving the image to a file, which can be useful between actions for debugging, or just for visual reassurance:

pa11y(url, {
    actions: [
        'screen capture example.png'
    ]
});

wait for

wait for <fragment|path|url>

This allows you to pause the test until a condition is met, and the page has either a given fragment, path, or URL. This will wait until Pa11y times out so it should be used after another action that would trigger the change in state. You can also wait until the page does not have a given fragment, path, or URL using the to not be syntax. This action takes one of the forms:

  • wait for fragment to be <fragment> (including the preceding #)
  • wait for fragment to not be <fragment> (including the preceding #)
  • wait for path to be <path> (including the preceding /)
  • wait for path to not be <path> (including the preceding /)
  • wait for url to be <url>
  • wait for url to not be <url>

E.g.

pa11y(url, {
    actions: [
        'click element #login-link',
        'wait for path to be /login'
    ]
});

wait for element's state

This allows you to pause the test until an element on the page (matching a CSS selector) is either added, removed, visible, or hidden. This will wait until Pa11y times out so it should be used after another action that would trigger the change in state. This action takes one of the forms:

  • wait for element <selector> to be added
  • wait for element <selector> to be removed
  • wait for element <selector> to be visible
  • wait for element <selector> to be hidden

E.g.

pa11y(url, {
    actions: [
        'click element #tab-2',
        'wait for element #tab-1 to be hidden'
    ]
});

wait for element's event

This allows you to pause the test until an element on the page (matching a CSS selector) emits an event. This will wait until Pa11y times out so it should be used after another action that would trigger the event. This action takes the form wait for element <selector> to emit <event-type>. E.g.

pa11y(url, {
    actions: [
        'click element #tab-2',
        'wait for element #tab-panel-to to emit content-loaded'
    ]
});

This action allows you to navigate to a new URL if, for example, the URL is inaccessible using other methods. This action takes the form navigate to <url>. E.g.

pa11y(url, {
    actions: [
        'navigate to https://another-example.com'
    ]
});

Runners

Pa11y supports multiple test runners which return different results. The built-in options are:

You can also write and publish your own runners. Pa11y looks for runners in your node_modules folder (with a naming pattern), and the current working directory. The first runner found will be loaded. So with this command:

pa11y https://example.com --runner custom-tool

The following locations will be checked:

<cwd>/node_modules/pa11y-runner-custom-tool
<cwd>/node_modules/custom-tool
<cwd>/custom-tool

A Pa11y runner must export a string property named supports. This is a semver range which indicates which versions of Pa11y the runner supports:

exports.supports = '^8.0.0';

A Pa11y runner must export a property named scripts. This is an array of strings which are paths to scripts which need to load before the tests can be run. This may be empty:

exports.scripts = [
    `${__dirname}/vendor/example.js`
];

A runner must export a run method, which returns a promise that resolves with test results (it's advisable to use an async function). The run method is evaluated in a browser context and so has access to a global window object.

The run method must not use anything that's been imported using require, as it's run in a browser context. Doing so will error.

The run method is called with two arguments:

  • options: Options specified in the test runner
  • pa11y: The Pa11y test runner, which includes some helper methods:
    • pa11y.getElementContext(element): Get a short HTML context snippet for an element
    • pa11y.getElementSelector(element): Get a unique selector with which you can select this element in a page

The run method must resolve with an array of Pa11y issues. These follow the format:

{
    code: '123', // An identifier for this error
    element: {}, // The HTML element this issue relates to; `null` if no element is involved
    message: 'example', // A description of the issue
    type: 'error', // 'error', 'warning', or 'notice'
    runnerExtras: {} // Additional data a runner is free to provide; unused by Pa11y itself
}

Examples

Basic example

Run Pa11y on a URL and output the results. See the example.

Multiple URLs example

Run Pa11y on multiple URLs at once and output the results. See the example.

Actions example

Step through some actions before Pa11y runs. This example logs into a fictional site then waits until the account page has loaded before running Pa11y. See the example.

Puppeteer example

Pass in pre-created Puppeteer browser and page instances so that you can reuse them between tests. See the example.

Common questions and troubleshooting

See our Troubleshooting guide to get the answers to common questions about Pa11y, along with some ideas to help you troubleshoot any problems.

Tutorials and articles

You can find some useful tutorials and articles in the Tutorials section of pa11y.org.

Contributing

There are many ways to contribute to Pa11y, some of which we describe in the contributing guide for this repo.

If you're ready to contribute some code, clone this repo, commit your code to a new branch, then create a pull request to bring your changes into main. If you're an external contributor, fork this repo first, then follow the same process.

Please write unit tests for your code, and check that everything works by running the following before opening a pull request:

npm run lint                # Lint the code
npm test                    # Run every test, reporting coverage

You can also run test suites individually:

npm run test-unit           # Run the unit tests alone
npm run test-integration    # Run the integration tests alone
npm run test-coverage       # Run the unit tests alone, reporting coverage

Support and migration

[!TIP] We maintain a migration guide to help you migrate between major versions.

When we release a new major version we will continue to support the previous major version for 6 months. This support will be limited to fixes for critical bugs and security issues. If you're opening an issue related to this project, please mention the specific version that the issue affects.

The following table lists the major versions available and, for each previous major version, its end-of-support date, and its final minor version released.

Major version Final minor version Node.js support Puppeteer version Support end date
9 | 20, 22, 24 ^24 ✅ Current major version
8 8.0 18, 20, 22 ^22 2025-11-07
7 7.0 18, 20 ^20 2024-10-02
6 6.2 12, 14, 16 ~9.1 2024-07-16
5 5.3 8, 10, 12 ^1 2021-11-25
4 4.13 4, 6, 8 | 2018-08-15
3 3.8 0.12, 4 | 2016-12-05
2 2.4 0.10, 0.12 | 2016-10-16
1 1.7 0.10 | 2016-06-08

License

Pa11y is licensed under the Lesser General Public License (LGPL-3.0-only).
Copyright © 2013-2024, Team Pa11y and contributors

changelog

Changelog

9.0.0 (2025-05-07)

Pa11y 9 requires a stable (even-numbered) Node.js version of 20 or above, updates to the latest version of Puppeteer (24) and Axe (4.10), updates several other dependencies, and includes some GitHub actions and documentation cleanup.

Changes in pa11y@9

  • Breaking: Upgrade Node.js support: Pa11y 9 requires a stable (even-numbered) Node.js version of 20 or above
  • Significant dependency changes (potentially impacting Pa11y results):
    • Upgrade puppeteer to 24 from 22. This updates the underlying Chrome version (to 135).
    • Upgrade axe-core to 4.10 from 4.8. This includes rule fixes that may change results when using the axe runner. See axe-core releases for complete details.
  • Other dependency changes:
    • Upgrade bfj to 9.1 from 8.0.
    • Upgrade commander to 13.1 from 12.0.
    • Upgrade envinfo to 7.14 from 7.11.
    • Upgrade semver to 7.7 from 7.6.
  • GitHub Actions changes: Update workflows for Node 22/24, Ubuntu 24.04 compatibility, and publishing package with provenance.
  • Other changes: Refactor code and tests for dependency compatibility, update support table and fix some links in the README.

New contributors in pa11y@9

Full diff for pa11y@9

8.0.0 (2024-03-25)

Pa11y 8 makes the latest version of Puppeteer (22) available to Pa11y and updates several other dependencies.

Changes in pa11y@8

  • Major dependency changes
    • Upgrade puppeteer to 22 from 20
      • This may affect Pa11y's operating system support and the behaviour of Pa11y's browser automation.
    • Upgrade commander to 12 from 11
    • Remove dependency p-timeout
      • This will only affect users who had depended on p-timeout's presence as a side effect of installing Pa11y.
  • Minor dependency changes:
    • Upgrade semver to 7.6 from 7.5

Many thanks to @aarongoldenthal for contributing these dependency upgrades to Pa11y.

Full diff for pa11y@8

7.0.0 (2024-01-16)

Changes in pa11y@7

  • Breaking: Upgrade Node.js support: Pa11y 7 requires a stable (even-numbered) Node.js version of 18 or above
  • Breaking: Upgrade dependency puppeteer to 20 from 9: this may affect Pa11y's operating system support and the behaviour of Pa11y's browser automation
  • Breaking: Upgrade dependency commander to 11 from 8
  • Breaking: Upgrade dependency bfj to 8 from 7
  • Upgrade axe-core to ~4.8.2 from ~4.2.1
  • Support versions of Ubuntu above 20.04 without further configuration (thanks @aarongoldenthal)
  • Increase confidence in macOS and Windows support (thanks @aarongoldenthal)
  • Fix mistakes in documentation about runners (thanks @aarongoldenthal)
  • Update stale links in documentation (thanks @gavinr)
  • Update support policy

New contributors in pa11y@7

Full diff for pa11y@7

6.2.3 (2022-04-11)

  • Revert console logging behaviour which was still causing problems on some sites.

6.2.2 (2022-04-08)

  • Fix a crash when a page logs a warning or an error.

6.2.1 (2022-04-07)

  • Fix a circular reference error when parsing the console logs. Thanks @alycia-docusign for reporting the issue and @jefflward for suggesting a fix.

6.2.0 (2022-03-31)

  • Replace hogan.js with mustache in the HTML reporter (thanks @wit-0-bit)
  • Increase verbosity of actions when debug is enabled (thanks @m1rp)
  • Several documentation fixes (thanks @gabalafou, @manuelmeister, @LorenzoAncora)

6.1.1 (2021-11-17)

  • Add clear-field action (thanks @amprew)
  • Fix html reporter and reporter integration tests (thanks @aarongoldenthal)

6.1.0 (2021-11-09)

  • The axe runner now supports the same error level flags as the HTML_CodeSniffer runner.
  • Add ignore-rules section to axe runner config
  • Improve the logic to detect local files passed as an argument (thanks @kkoskelin)
  • Increase default timeout from 30 to 60 seconds (thanks @m1rp)
  • Update documentation to mention WCAG 2.1 instead of WCAG 2.0 when appropriate
  • Remove all mentions to Section 508 from the tool
  • Merge the example HTML reporter into this repo
  • Update dependencies
  • Downgrade package-lock.json file to v1 for compatibility with older versions of npm.

6.0.1 (2021-06-28)

  • Merge axe and htmlcs runners into repo
  • --environment flag now shows pa11y version correctly (thanks @aarongoldenthal)
  • Tests and dependency fixes for runners and reporters (thanks @aarongoldenthal)

6.0.0 (2021-05-26)

  • Test against WCAG 2.1 rules when using the default HTML_CodeSniffer runner.
  • Upgrade puppeteer to v9, which reduces the number of browser crashes significantly.
  • Remove support for testing against Section 508 standard.
  • Replace make commands for testing with npm scripts (thanks @sonniesedge and @paazmaya).
  • Integrate the built-in reporters with the pa11y repo (thanks @joeyciechanowicz).
  • Improve resilience of tests and other quality of life improvements (thanks @sangitamane).
  • Improve --environment output (thanks @ryhinchey).
  • Drop support for Node.js versions older than 12.

6.0.0-alpha (2020-04-28)

  • Update HTML_CodeSniffer to 2.5.1, which includes support for WCAG 2.1
  • Drop support for Node.js versions older than 10.

5.3.1 (2021-04-01)

  • Removed survey link from README.md file.
  • Update the HTML_CodeSniffer runner so it doesn't install a version with WCAG 2.1 rules. See pa11y/pa11y-runner-htmlcs@f22d3d1 for details.
  • Pin other dependencies in order to avoid problems like the one just mentioned.

5.3.0 (2019-09-30)

  • Adds support for axe test runner (thanks @rowanmanning)
  • Adds support for multiple test runners (thanks @rowanmanning)
  • Adds support for sites using AMD (thanks @joeyciechanowicz)
  • Removes dependency on fs-extra (thanks @timnovis)
  • Improves JSDoc typings (thanks @josebolos)
  • Inverts the order of setViewport and goto to prevent accidental page reloads (thanks @josebolos)
  • Minor documentation updates (thanks @sjparkinson, @josebolos)

5.2.0 (2019-07-04)

  • Allow pa11y to use an existing puppeteer page instance (thanks @kevinatown)
  • Fixed a bug where set field may fail if the text contains the string " to " (thanks @kkoskelin)
  • Use npm version of HTML_CodeSniffer instead of a static one (thanks @paazmaya) and update to version 2.4.0
  • Add a package-lock.json file to the package
  • Several dependency and tooling updates (thanks @leeroyrose and others)
  • Other bugfixes (thanks @joeyciechanowicz)
  • Minor documentation updates

5.1.0 (2018-10-18)

  • Intercept first page requests only when necessary, to work around a Puppeteer bug.
  • Add an .nvmrc file to specify the minimum Node version already listed in the requirements
  • Update dependencies
    • commander: ^2.14.1 to ^2.19.0
    • eslint: ^4.17.0 to ^4.19.1
    • mocha: ^5.0.1 to ^5.2.0
    • nyc: ^11.4.1 to ^11.9.0
    • puppeteer: ^1.4.0 to ^1.9.0
    • semver: ^5.5.0 to ^5.6.0
    • sinon: ^4.3.0 to ^4.5.0
    • HTML CodeSniffer: 2.1.1 to 2.2.0

5.0.4 (2018-05-21)

  • Update dependencies
    • puppeteer: 1.0.0 to ^1.4.0
  • Correct and clarify some of the documentation

5.0.3 (2018-03-09)

  • Fix an issue caused by a site having a global module.exports property

5.0.2 (2018-03-08)

  • Pin puppeteer at 1.0.0 to fix file URL issues

5.0.1 (2018-02-16)

  • Update dependencies
    • commander: ^2.9.0 to ^2.14.1
    • p-timeout: ^1.2.0 to ^2.0.1
    • semver: ^5.4.1 to ^5.5.0
    • eslint: ^3.1.8 to ^4.17.0
    • mocha: ^3.2.0 to ^5.0.1
    • nyc: ^10.1.2 to ^11.4.1
    • proclaim: ^3.4.4 to ^3.5.1
    • sinon: ^3.2.0 to ^4.3.0

5.0.0 (2018-02-15)

5.0.0-beta.10 pre-release (2018-02-14)

  • Allow passing in a Chrome page instance to a test

5.0.0-beta.9 pre-release (2018-01-30)

  • Update dependencies
    • pa11y-reporter-cli: ^1.0.0 to ^1.0.1

5.0.0-beta.8 pre-release (2018-01-22)

  • Allow sharing a Chrome browser instance between test runs
  • Fix Content-Security-Policy issues

5.0.0-beta.7 pre-release (2018-01-17)

  • Fix browser logging

5.0.0-beta.6 pre-release (2018-01-16)

  • Add the navigate-url action
  • Correct documentation on isValidAction
  • Update dependencies
    • puppeteer: ^0.13.0 to ^1.0.0

5.0.0-beta.5 pre-release (2017-12-11)

  • Update dependencies
    • puppeteer: ^0.11.0 to ^0.13.0

5.0.0-beta.4 pre-release (2017-12-06)

  • Add reporter, threshold and level as configuration options
  • Clarify some documentation

5.0.0-beta.3 pre-release (2017-11-26)

  • Fix a timeout issue
  • Fix an issue with the built in copy of HTML CodeSniffer

5.0.0-beta.2 pre-release (2017-10-04)

  • Output browser console messages to the debug log
  • Add the screen-capture action
  • Add the wait-for-element-event action
  • Update dependencies
    • puppeteer: ^0.10.2 to ^0.11.0
    • pa11y-lint-config: ^1.2.0 to ^1.2.1

5.0.0-beta.1 pre-release (2017-09-11)

4.13.2 (2017-11-26)

  • Fix an issue with the built in copy of HTML CodeSniffer

4.13.1 (2017-10-16)

  • Trigger correct change/input events for check-field and set-field-value actions

4.13.0 (2017-09-15)

  • Update dependencies
    • HTML CodeSniffer: 2.0.7 to 2.1.1

4.12.2 (2017-09-11)

  • Exit with an error when using an incompatible command-line reporter

4.12.1 (2017-08-23)

  • Roll back dependencies
    • HTML CodeSniffer: 2.1.0 to 2.0.7

4.12.0 (2017-08-23)

  • Add the wait-for-element-state action
  • Update the wait-for-url action to support waiting for hostname
  • Update dependencies
    • HTML CodeSniffer: 2.0.7 to 2.1.0
  • Lots of updates to the README and trouble-shooting guide
  • Support Node.js 8.x

4.11.0 (2017-06-02)

  • Add the ability to make Pa11y perform POST requests
  • Documentation improvements
  • Update dependencies
    • truffler: ^3.0.1 to ^3.1.0

4.10.0 (2017-04-18)

  • Update example URLs across the project for clarity
  • Add a TSV reporter

4.9.0 (2017-03-29)

  • Add the ability to add additional WCAG rules to the selected standard
  • Update dependencies
    • async: ~1.4 to ^2.2.0
    • bfj: ~1.2 to ^2.1.2
    • chalk: ~1.1 to ^1.1.3
    • commander: ~2.8 to ^2.9.0
    • lower-case: ~1.1 to ^1.1.4
    • node.extend: ~1.1 to ^1.1.6
    • once: ~1.3 to ^1.4.0
    • truffler: ~3.0 to ^3.0.1
    • mocha: ^3 to ^3.2.0
    • mockery: ~1.4 to ^2.0.0
    • proclaim: ^3 to ^3.4.4
    • sinon: ^1 to ^2.1.0
  • Use the standard Pa11y lint config
  • Update the tooling for consistency with other projects

4.8.0 (2017-03-17)

  • Add the --environment flag for easier debugging
  • Update the Windows requirements to include Windows 10
  • Update the trouble-shooting guide and common questions

4.7.0 (2017-03-08)

  • Add the ability to screen capture the tested page
  • Move the main bin to a .js file
  • Clean up coveralls

4.6.0 (2017-01-30)

  • Add negation to the "wait for..." actions

4.5.0 (2017-01-25)

  • Expose action validation for use in dependent projects

4.4.0 (2017-01-19)

  • Add support for actions

4.3.0 (2016-12-15)

  • Add a verifyPage option, and a --verify-page flag
  • Switch from JSHint/JSCS to ESLint
  • Add a contributing guide
  • Update dependencies
    • istanbul: ~0.3 to ~0.4

4.2.0 (2016-11-25)

  • Display the page title in the logs to help with debugging

4.1.1 (2016-11-24)

  • Update dependencies
    • truffler: ~2.3 to ~3.0

4.1.0 (2016-11-21)

  • Install PhantomJS as a dependency if the latest version isn't present
  • Remove the SSL protocol from the default PhantomJS config

4.0.3 (2016-11-20)

  • Add protocols to URLs, make path instructions explicit

4.0.2 (2016-11-10)

  • Update dependencies
    • truffler: ~2.2 to ~2.3
  • Fix typos and mistakes across the documentation

4.0.1 (2016-08-18)

  • Upgrade mocha to version 3. This fixes a security vuln with versions of minimatch older than 3.0.2. Minimatch is one of mocha's dependencies. This only affects devDependencies.
  • Documentation updates.

4.0.0 (2016-06-05)

3.8.1 (2016-06-03)

  • Fixes the hideElements option

3.8.0 (2016-05-25)

  • Make the built-in reporters usable in JavaScript
  • Tidy up the examples

3.7.1 (2016-05-03)

  • Support Node.js 6.x

3.7.0 (2016-04-27)

  • Update dependencies
    • truffler: ~2.1 to ~2.2
    • HTML CodeSniffer: 2.0.1 to 2.0.7

3.6.0 (2016-03-01)

  • Adding the rootElement option so a subset of the document can be tested
  • Adding the hideElements option so elements can be hidden from testing

3.5.1 (2016-02-09)

  • Update repository references to springernature
  • Update the license

3.5.0 (2016-02-09)

  • Adding the beforeScript option so JavaScript can be run on the page before testing
  • Re-license under the LGPL 3.0

3.4.0 (2016-02-01)

  • Document running Pa11y against local files
  • Add a trouble-shooting guide for Windows
  • Make allowed standards configurable

3.3.0 (2016-01-11)

  • Add the ability to use the --ignore command line more than once

3.2.1 (2016-01-05)

  • Fix an issue where JSON output was truncated

3.2.0 (2015-12-17)

  • Add a threshold CLI parameter to allow a certain number of errors before failing

3.1.0 (2015-12-14)

  • Add the ability to specify the path to the PhantomJS binary

3.0.1 (2015-11-09)

  • Support Node.js 5.x

3.0.0 (2015-10-16)

  • Initial 3.0 release
  • Overhaul the API (now uses Truffler 2.0)
  • Drop Node.js 0.10 support
  • See the migration guide for details

2.4.5 (2016-01-05)

  • Fix an issue where JSON output was truncated

2.4.4 (2015-08-20)

  • Handle PhantomJS exits better when a timeout occurs

2.4.3 (2015-08-18)

  • Add code coverage reporting and increase coverage

2.4.2 (2015-08-09)

  • Update dependencies
  • Increase linter coverage

2.4.1 (2015-07-13)

  • Add a question about proxying to the README

2.4.0 (2015-07-13)

  • Add a Markdown reporter
  • Update dependencies

2.3.0 (2015-06-23)

  • Add a wait option for pages which take time to fully render
  • Relax development dependencies

2.2.1 (2015-06-19)

  • Update the migration guide

2.2.0 (2015-06-18)

  • Add the ability to specify a HTML CodeSniffer URL/path
  • Make sure that the HTML reporter passes WCAG2AA

2.1.0 (2015-06-09)

  • Add CSS selectors to the results, making it easier to find elements in the page

2.0.2 (2015-06-09)

  • Fix a bug caused by PhantomJS stdout

2.0.1 (2015-06-08)

  • Update dependencies

2.0.0 (2015-06-08)

1.7.0 (2015-05-08)

  • Add HTML snippets to results for additional context

1.6.3 (2015-01-17)

  • Fix memory issues by reducing data sent between node and phantom

1.6.2 (2014-10-07)

  • Documentation updates

1.6.1 (2014-06-27)

  • Document the viewport option
  • Expose the viewport option to the CLI

1.6.0 (2014-06-27)

  • Output debug messages to stderr
  • Output debug messages in the JSON/CSV reporters
  • Allow configuring viewport width/height

1.5.4 (2014-04-30)

  • Increase the timeout for functional tests

1.5.3 (2014-02-10)

  • Add the GPL preamble to all files

1.5.2 (2014-01-13)

  • Fix a formatting issue which caused files generated by the CSV reporter to display incorrectly in Excel

1.5.1 (2013-11-26)

  • Set default exit status to -1 to not conflict with error count status codes
  • Throw a more helpful error when PhantomJS cannot be found

1.5.0 (2013-10-31)

  • Allow cookies to be set in-browser, for testing pages which require authentication
  • Add "strict mode", where warnings are treated as errors
  • Move from Make to Grunt for easier development on Windows
  • Full rewrite of the functional tests

1.4.3 (2013-10-03)

  • Remove instances of process.exit from the library

1.4.2 (2013-09-10)

  • Fix an issue where a premature exit caused the timer to kill the parent process

1.4.1 (2013-09-09)

  • Fix an issue where HTML CodeSniffer errors can derail Pa11y

1.4.0 (2013-08-30)

  • Allow users to specify a port to run PhantomJS on. This means you can run multiple Pa11y commands in parallel

1.3.0 (2013-08-23)

  • Finalise and document the JavaScript API (for non-command-line use)
  • Use a custom UserAgent string (pa11y/<version>)
  • Allow users to specify their own UserAgent string

1.2.1 (2013-08-16)

  • Sanitize local HTMLCS URLs for API consistency

1.2.0 (2013-07-18)

  • Add the ability to ignore certain rules through a JSON config file
  • Exit with a non-zero code if any "Error" level messages are present in the results
  • Simplify the output of the default console reporter
  • Large code overhaul and more complete test suite

1.1.0 (2013-07-10)

  • Add a CLI option for self-hosted HTML_CodeSniffer
  • Fix broken tests on some ISPs

1.0.1 (2013-06-26)

  • Bug fixes

1.0.0 (2013-06-25)

  • Test Windows support
  • Final config tweaks for stable release

1.0.0-beta.3 pre-release (2013-06-24)

  • Documentation updates
  • Large-scale refactoring and testing

1.0.0-beta.2 pre-release (2013-06-11)

  • Add a debug command line option
  • Node 0.10.x support

1.0.0-beta.1 pre-release (2013-06-04)

  • Initial release