Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can getRules return "impact" and other details that are included in deque university pages? #3321

Closed
ls-andrew-borstein opened this issue Dec 3, 2021 · 2 comments

Comments

@ls-andrew-borstein
Copy link

Product:

axe-core

Expectation

The axe.getRules() API method returns a rule's impact and ideally also the same info available in the Compliance Data & Impact section of each rule on a deque university rule page: Disabilities Affected, Requirements, Success Criteria, Section 508 Guidelines.

Screen Shot 2021-12-03 at 7 45 24 AM

Actual

Only ruleId, description, help, helpUrl, and tags are returned.

I can see WCAG Sucess Criteria and Requirements are there via the tags key, albeit in a truncated way that I'd need to parse, i.e.

{ 
  tags: ['cat.language', 'wcag2a', 'wcag311', 'ACT']
}

instead of something like

{ 
  requirements: [{ id: 'wcag2a', description: 'WCAG 2.0 (A): MUST' ]
  section508guidelines: [],
  wcagSuccessCritera: { id: 311, description: '3.1.1 Language of Page' }
}

Motivation

I'm trying to find a way to do something very similar to https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md but make it a filterable/sortable table, so someone can view only WCAG AA rules or sort by impact (critical first). This would be part of internal documentation, helping my company and teammates to better prioritize which rules to address or to understand their impact when considering them while building new products. Although I could imagine other developers would also find a public resource like that quite useful.

Here's a live demo of what I'm attempting (with a static, non-interactive table at the moment): https://codesandbox.io/s/axe-core-get-rules-qpvmh?file=/src/App.js

I found what seemed like a similar issue but it was unclear to me what the outcome was. I'm confused about the suggestion that the rule impact is only calculated at run time / during test evaluations, because it's is available at https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md outside of any specific test and also on each deque university rule page.

I could potentially scrape the deque university website for that info, but if it's available in the axe-core API I'd much prefer that.

axe-core version

4.3.5

@ls-andrew-borstein ls-andrew-borstein changed the title Can getRules return "impact" and other details included in deque university pages? Can getRules return "impact" and other details that are included in deque university pages? Dec 3, 2021
@WilcoFiers
Copy link
Contributor

It is unlikely we'll ever provide an API like this. Part of why we can make axe-core available for free is that it gets folks to our documentation pages. This is important to keep axe-core properly maintained. If there are changes you'd like to see for the documentation please let us know. We'll gladly consider those.

That said, it really isn't difficult to get that information out of axe-core. All the JSON files are included in the release, you could read out the directory. That's how the rule-descriptions.md file is created.

@ls-andrew-borstein
Copy link
Author

Thanks for the response @WilcoFiers 👌

it really isn't difficult to get that information out of axe-core

I appreciate the suggestion — I'll see if I can retrieve the info I need that way. It looks like the any attribute connects a rule to its associated check, which does contain the impact info.

Part of why we can make axe-core available for free is that it gets folks to our documentation pages

I totally get that. FWIW you've got at least one vote in favor of improving the documentation such that the rules are filterable and sortable. And if that's something axe would be interested in, I'd be happy to make a separate issue to discuss how it could be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants