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

Ignore rule while using Axe runner #145

Closed smustgrave closed 3 years ago

smustgrave commented 3 years ago

https://github.com/dequelabs/axe-core/issues/3034 opened this up with Axe. But wondering if there's a way to ignore a rule while using axe? { "defaults": { "standard": "WCAG2AA", "runners": ["axe"], "timeout": 90000, "level": "none", "chromeLaunchConfig": { "ignoreHTTPSErrors": true, "args": ["--no-sandbox"] }, "ignore": [ "Section508.D.H49.AlignAttr", "Section508.D.HeadingOrder", "WCAG2A.Principle1.Guideline1_3.1_3_1.H49.AlignAttr", "WCAG2AA.Principle1.Guideline1_3.1_3_1.H49.AlignAttr", "WCAG2AAA.Principle1.Guideline1_3.1_3_1.H49.AlignAttr", "WCAG2AAA.Principle1.Guideline1_3.1_3_1_AAA.G141" ] } }

this is my config file but axe skips the ignore.

joeyciechanowicz commented 3 years ago

Currently the ignore section is only used by HTML_CodeSniffer, this support needs to be added to the axe runner.

The axe runner does enable some rules, this just needs to be extended to do the inverse.

smustgrave commented 3 years ago

Thanks a lot! Saw the merge does this mean axe will ignore now? Same syntax?

joeyciechanowicz commented 3 years ago

Same syntax, though it will only work if you get latest from Github. This will be released with pa11y v6

smustgrave commented 3 years ago

So I'm trying this { "defaults": { "standard": "WCAG2AA", "runners": ["axe"], "timeout": 90000, "level": "none", "chromeLaunchConfig": { "ignoreHTTPSErrors": true, "args": ["--no-sandbox"] }, "ignore": [ "Section508.D.H49.AlignAttr", "Section508.D.HeadingOrder", "WCAG2A.Principle1.Guideline1_3.1_3_1.H49.AlignAttr", "WCAG2AA.Principle1.Guideline1_3.1_3_1.H49.AlignAttr", "WCAG2AA.Principle1.Guideline1_3.1_3_1.G141", "WCAG2AAA.Principle1.Guideline1_3.1_3_1.H49.AlignAttr", "WCAG2AAA.Principle1.Guideline1_3.1_3_1_AAA.G141" ] } }

And it's not ignoring. Tested with htmlcs and works fine. Updated pa11y to 6.0.1 beforehand. I'm also using pa11y-ci