pa11y-webservice icon indicating copy to clipboard operation
pa11y-webservice copied to clipboard

Support choice of runner(s)

Open jsa34 opened this issue 5 years ago • 10 comments

Just giving a stab at adding caps for axe runners as a config - feedback welcome!

jsa34 avatar Oct 04 '19 09:10 jsa34

noticed this approach passes unit tests, works with config file array passing, but trying to start with command line args, i.e. RUNNERS=['axe,'htmlcs'] or any other format. Will close and try and work out how to get this to work

jsa34 avatar Oct 07 '19 07:10 jsa34

This is a great start. But yes, env('RUNNERS', ['htmlcs', 'axe']) won't work as it will just be the string "['axe','htmlcs']".

To get it working with the appraoch you've gone for I'd suggess simply accepting a CSV list of runners.

function csvToArray(value) {
   const parts = value.split(/,/g)
      .filter(part => part.match(/^\s+$/))
     .map(part => part.trim());
   return parts;   
}

/// later
runners: csvToArray(env('RUNNERS', 'htmlcs,axe'))

joeyciechanowicz avatar Oct 07 '19 09:10 joeyciechanowicz

I think there will be additional work to display this on the dashboard correctly.

joeyciechanowicz avatar Oct 07 '19 09:10 joeyciechanowicz

Yup! There's also a bigger discussion to be had regarding how do we expose this in the dashboard.

When we added axe support to the CLI we decided to make it use only one runner per call, this was to keep the code clean and simple.

However, there's argument to be made for using both runners in the dashboard in order to capture as many issues as possible, so we definitely need to discuss if/how that could happen.

josebolos avatar Oct 07 '19 09:10 josebolos

When I tried running in pa11y-dashboard with config file, it appears to correctly display axe, htmlcs or both axe AND htmlcs issues and collate them in the categories without any necessary code changes. The cli obviously did not work, but as I use the config file it was only by chance I noticed this. It doesn't, other than the error produced itself, label issues as axe or htmlcs, but perhaps the error details are sufficient?
Screenshot 2019-10-07 at 10 45 49

jsa34 avatar Oct 07 '19 09:10 jsa34

Added suggestion of a string to array function. Feedback welcome!

jsa34 avatar Oct 07 '19 14:10 jsa34

@jsa34 status of requested changes?

jasonday avatar Feb 11 '20 00:02 jasonday

Hey there! I just wanted to know if I can be of any help to address the remaining comments and leave this PR ready.

Ruluk avatar May 18 '20 19:05 Ruluk

Hi! I was wondering if there has been any movement on this PR? Being able to use Axe in the dashboard would be incredible!

bconnelly-niche avatar May 05 '21 19:05 bconnelly-niche

Hi all, will revisit this during 5.x once pa11y-webservice@5 has been released. Potentially some overlap with #144 but I haven't thought too much about this yet, from the point of view of any changes along these lines (a) making sense for the service alone, since we've seen some recent interest in this service without the dashboard, while (b) also making sense for the dashboard.

edit: a third related PR, which has since been closed:

  • #127

danyalaytekin avatar Mar 17 '24 23:03 danyalaytekin