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
520 stars 63 forks source link

pa11y-ci ends with an npm error after the displaying the results #83

Closed rkrjain closed 3 years ago

rkrjain commented 5 years ago

I have spent hours trying to overcome this issue where the pa11y-ci ends with an error. It throws out the errors and ends with this error below


   (#mat-input-1)

   <input _ngcontent-fgs-c4="" class="mat-input-element
   mat-form-field-autofill-control cdk-text-field-autofill-monitored
   ng-untouched ng-pristine ng-invalid" formcontrolname="password" matinput=""
   onpaste="return false" placeholder="Password" type="pas...

✘ 2/3 URLs passed
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @xxxxxxxxxxxx@0.0.0 a11y-report: `pa11y-ci`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @xxxxxxxxxxxx@0.0.0 a11y-report script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\M1030316\AppData\Roaming\npm-cache\_logs\2019-06-11T08_10_41_881Z-debug.log

Need quick help in fixing this problem; I am blocked because of this.

this is my .pa11yci

{
  "defaults": {
    "ignore": ["notice"],
    "standard": "WCAG2A"
  },
  "urls": [
    "http://localhost:4200/not-found",
    "http://localhost:4200/not-authorized",
    "http://localhost:4200/admin"
  ]
}

I am just running "pa11y-ci" from the terminal.

tmasrat commented 5 years ago

@rgjain what version of node do you have?

braican commented 4 years ago

It looks like you're running your pa11y script via npm, and npm is exiting with an error because there's an accessibility error in your tests. This looke to be the expected behavior: by default the pa11y script returns an exit code of 2 if there is an accessibility error, which npm interprets as an error with the script that was being run.

Presumably this was done this way so that when the tests were run in CI the NPM script itself would fail, which would kill the process and prevent inaccessible code or features from being pushed to whatever environment the CI is hooked up to.

josebolos commented 3 years ago

Thanks for creating this issue. It looks like this is now fixed, feel free to reopen the issue if not.