Documentation / Axe

Axe

Axe is an accessibility testing engine for websites and other HTML-based user interfaces.

Run

You enable testing with --axe.enable.

docker run --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:41.0.1 --axe.enable https://www.sitespeed.io

That will run axe-core and generate a new axe tab in your HTML result. The number of violations (per type) will automatically be sent to Graphite/InfluxDB.

Rules

See the full list of the tested accessibility rules when you run Axe.

Configure Axe

You can configure Axe to choose which rules/checks will be used.

You need to read the Axe official documentation to get a feeling for what you can configure with Axe. In the axe namespace we pass all parameters to the configuration object of Axe. --axe.checks will result in a configuration object like:

checks: {

}

That way you can configure all things you can configure in the Axe configuration.

However you probably just want to configure run options, you can do that by adding a run prefix. Say for example you only want to test wcag2aa compliance, you can do that with the runOnly configuration in Axe. You can do that with a configuration like:

{
    "axe": {
        "run": {
            "runOnly": ["wcag2aa"]
        }
    }
}

If you want to avoid having over-complicated CLI parameters, you should use the configuration as JSON feature.

How it works behind the scenes

The Axe tests are run as a postScript.

Running Axe will add some extra run time per test. How much extra time it takes depends on your page and the server running the browser.