pa11y / pa11y-ci

Pa11y CI is a CI-centric accessibility test runner, built using Pa11y
https://pa11y.org
GNU Lesser General Public License v3.0
515 stars 63 forks source link

Support passing `--debug` to `pa11y` #180

Open kussmaul opened 2 years ago

kussmaul commented 2 years ago

I have a set of Pa11y tests (run from pa11y-ci), each with a url and a set of actions to set fields, click elements, and wait for paths to change or other conditions. When I run/debug these tests, I often get messages like this, and then have to figure out which action caused the problem.

http://localhost:4200/some-path - Failed to run
Errors in http://localhost:4200/some-path:
 • Error: Pa11y timed out (30000ms)

More informative messages would be nice, but for now I use screen capture every few actions to trace what happens. I think it would be convenient and not difficult to add an action that writes text to the console. Something like console log <message> or write text <message>. This could even be extended to console error <message> or write url or write field <selector>.

Does this seem worth doing? Thoughts on syntax?

joeyciechanowicz commented 2 years ago

The debug flag (-d) should print out the actions as they're ran.

kussmaul commented 2 years ago

Thank you, @joeyciechanowicz. The debug flag works for pa11y but not pa11y-ci. Should I propose adding it to pa11y-ci? (similar to https://github.com/pa11y/pa11y-ci/issues/73) A more general write action could have other uses, especially if it could extract info from a page.

joeyciechanowicz commented 2 years ago

I think if we were to support passing the --debug flag to pa11y from pa11y-ci then we could avoid adding a new action?

kussmaul commented 2 years ago

Yes, pa11y-ci --debug would handle my use case.

josebolos commented 2 years ago

Moving issue to the pa11y-ci repo.