Search code examples
wcagwcag2.0pa11y

pa11y-ci: How to specify filename for default html report?


I have Pa11y working well with the Json output, but I wanted to provide a HTML report for clients. We do manual WCAG checks right now and are migrating to a more automated approach. I've installed the Pa11y HTML reporter, and it seems to want to produce the output into the CI. It's a better output but how do I specify the filename for the html file such as myreport.html?

Here is my config file:

{
    "defaults": {
        "reporters": [
            "pa11y-reporter-html"
        ],
        "timeout": 10000,
        "standard": "WCAG2A",
        "viewport": {
            "width": 800,
            "height": 600
        }
    }
}

Here is how I'm calling it from the command line:

pa11y-ci --sitemap https://oursite.co.uk/sitemaps/sitemap.xml

Also, how do I add the sitemap to the config file? When I add it in like this it seems to ignore it:

"sitemap:":"https://oursite.co.uk/sitemaps/sitemap.xml",


Solution

  • The solution was to use:

    pa11y-ci-reporter-html -s results.json

    The json is the separate .json output from pally-ci generated separately.

    The ci-reporter is installed gloablly using:

    > npm install -g pa11y-ci-reporter-html

    So you have to keep pa11y-ci set to json mode for this to work.