dequelabs / axe-cli

[Deprecated] A command-line interface for the aXe accessibility testing engine
Mozilla Public License 2.0
430 stars 35 forks source link

Is it possible to pass the urls through a list in an input file? #56

Closed rianrietveld closed 6 years ago

rianrietveld commented 6 years ago

I'm currently investigating integrating axe-cli into CI processes, however, there is not a fixed list of URLs which can be passed to the command line in the current use case.

I could write a script to generate a list of URLs to check, but would need to pass that list in one way or another to the cli command line.

Something along the lines of:

https://url.local/somepost-name
https://url.local/otherpage-name

So I was wondering if it is possible to pass the path to a text or json file containing a list of URLs to check instead ?

If so, it would be great if this possibility could be added to the documentation.

If this is not currently possible, would you consider it as a feature request please.

We are working to integrate this into WordPress automated testing and this would make life much easier.

/cc @jrfnl

rianrietveld commented 6 years ago

Just thinking: being able to use a sitemap.xml file would make life even easier as an additional option ;-)

WilcoFiers commented 6 years ago

I like the idea of using sitemap.xml. It seems a little niche, so I don't think we'd develop that, but I would be in favour of supporting it if someone was to supply a PR for it.

As for alternative methods, it's pretty easy to write a script to put URLs into a command. You could do something like this with NodeJS:

const { exec } = require('child_process');
const urls = require('urls.json').join(' ');

exec('axe ' + urls, (err, stdout, stderr) => {
  //... process the results
});

If you're running many URLs you should probably run them one at a time though. Axe-cli isn't designed to test hundreds of pages at once.

Huink7 commented 6 years ago

Any chance you could update the markdown file to reflect that, @WilcoFiers ?

This is the part I got hung up on, trying to pass a string of 99 website urls =]

You can run multiple pages at once, simply add more URLs to the command. If you do not specify the protocol, http will be used by default:

axe www.deque.com, dequeuniversity.com

Luckily I stumbled upon this issue.