Comments (7)
I think a good enhancement would be to have the ignore rules in sync with this list: https://github.com/nature/pa11y/wiki/HTML-CodeSniffer-Rules
That's where I got the rule that I wanted to ignore and then copy/pasted it from there. I hadn't thought of copy/pasting straight from terminal.
from pa11y.
Hey Matt, can you share the url and standard you are running the test with (I'm assuming from the error that it's WCAG2AA)? Note that if you are trying to ignore WCAG2AA.
-prefixed errors, that you need to be testing against WCAG2AA
.
from pa11y.
Just as an example, the following works for me, and running it with and without the ignore produce the expected results:
var pa11y = require('pa11y');
pa11y.sniff({
url: 'https://www.reddit.com/r/thebutton/',
standard: 'WCAG2A',
useragent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104 Safari/537.36',
config: {
ignore: [
'WCAG2A.Principle2.Guideline2_4.2_4_4.H77,H78,H79,H80,H81'
]
},
}, function(err, results) {
if (err) {
console.error(err);
process.exit(1);
}
console.log(results);
});
from pa11y.
Hey, thanks for the quick response!
I'm running it against localhost so I can't share the URL. But, it seems changing the ignore rule from WCAG2AA.Principle1.Guideline1_4.1_4_3.G18
to WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail
seems to have worked.
I would have thought it would work without the .Fail.
from pa11y.
Yeah, it requires the rule verbatim as it appears in the results. Maybe it should work w/o the .Fail
(and possibly without the standard prefix)? That would be a good enhancement.
from pa11y.
Well it did say that they "can be used in a config file to ignore certain rules", so...yeah. I've updated that page to try and clarify the workflow -- some of those rules are dependent on e.g. [NodeName]
so I'm not sure if it could be in sync.
from pa11y.
Cool, thanks for looking into that. Hopefully it helps clear it up for anyone else!
from pa11y.
Related Issues (20)
- pa11y fails with Github Actions ubuntu-22.04 HOT 2
- pa11y disregards `display: none` inline style, contrary to 4th rule of ARIA Use HOT 2
- Timeouts happening 100% of the time HOT 1
- Pa11y check passes locally, fails in Github Actions HOT 3
- Ignore rules per selector HOT 1
- [Feature] - Playwright support HOT 1
- timeout error for a single url HOT 1
- CircleCI run differs from expected output. JS not running before pa11y test. HOT 1
- Using gitlab ci environment variables to authenticate HOT 1
- Can we get violations defects for after login pages using pa11y? HOT 2
- TimeoutError: Pa11y timed out HOT 6
- Inconsistencies between pa11y and other accessibility tools HOT 1
- Axe runner doesn't include wcag2aaa tag when standard is set to WCAG2AAA. HOT 2
- How do I include multiple Urls in 1 report? HOT 7
- Can I include a config file for a report? HOT 2
- Sort in CosmosDB Mongo APIs mandates indexing
- Error reporting during installation HOT 1
- rules option ignored HOT 1
- Documented require() for reporters doesn't work HOT 3
- Error: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (869685) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pa11y.