Open Ant0n777 opened 3 months ago
Hi @Ant0n777 thanks for creating the issue. I pushed a fix in a PR but it needs to go in a major release since it will potentially change behaviour for some users (but the change makes sense).
Thanks @soulgalore. Could you please help me with some workaround for now? I was thinking about updating contex.options.axe directly in the test script and remove duplicated (camelCase) rules from it. Would be nice if you can give some example how to do that (I'm not so experienced in JS).
Let me think during the weekend, maybe there's a simpler smart way to do it.
@soulgalore, I found the workaround: update axe configuration directly in the test script and don't use config.json Like this:
context.options.axe = {
enable: true,
run: {
runOnly: {
type: "tag",
values: [
"wcag2a",
"wcag2aa",
"wcag21aa",
"wcag22aa",
],
},
rules: {
"aria-allowed-role": { enabled: true },
"empty-heading": { enabled: true },
"heading-order": { enabled: true },
...
},
},
};
I've disabled camel case for the configuration so this should work now.
Have you read the documentation?
URL
any
What are you trying to accomplish
I need to configure AXE accessibility rules to run. Specific set of rules (all WCAG rules + some Best Practices). I created config.json with
But it does not work because config options with '-' symbols automatically replaced with camelCase. So, in this case "empty-heading" is replaced with "emptyHeading". Almost all AXE rules are with dash(es). So, it's not possible to configure.
Same configuration but with rule that does not have '-' in the name works fine! For ex.:
works fine.
What browser did you use?
Chrome
How to reproduce
Log output