Open lsigism opened 6 years ago
This issue reminded me of https://github.com/pa11y/pa11y/issues/178 which is a similar kind of idea.
Maybe we could add a second rules block called globals
, that overrides defaults
, but is additive with following rules instead of a straight replacement. So something like this:
{
"defaults": {
"timeout": 1000
},
"globals": {
"timeout": 50000,
"ignore": "issue-code-1",
"hideElements": ".hiddingThisGlobalElement, .alsoThisOne"
},
"urls": [
"http://pa11y.org/",
{
"url": "http://pa11y.org/contributing",
"hideElements": ".advert, #modal, div[aria-role=presentation]" ,
"ignore": "issue-code-2"
}
]
}
for all URLs by default would run pa11y with these parameters:
--timeout 50000 --ignore issue-code-1 --hide-elements ".hiddingThisGlobalElement, .alsoThisOne"
and for pa11y.org/contributing it would run with these parameters:
--timeout 50000 --ignore "issue-code-1;issue-code-2" --hide-elements ".hiddingThisGlobalElement, .alsoThisOne, .advert, #modal, div[aria-role=presentation]"
Edit: We'd need to make sure people don't try to do something like --timeout 1000 50000
- only some rules can be additive π€
Thoughts? @andrewmee etc?
Hello pa11y team π how are you?
I am a QA engineer trying to use Pa11y in our framework to improve the accessibility levels for our projects. I am really enjoying this tool so far. But today I came across a specific case that is the reason of this 'issue', or as I might say "an improvement".
Let's consider the following .pa11yci config file:
When I run it, Pa11y seems to be overriding the local hideElements values when I have a global HideElements defined. And in my current example I would like to have global HideElements as they appear for every page I am testing, but also I would like to hide unique elements (that are not conform with the accessibility standards) for every page I am testing.
A current workaround is duplicating every global HideElement for each individual URLs (what I think it's not great).
Let me know if you need more info and please share your thoughts about this suggestion π
Thank you guys π