component-driven / component-driven/cypress-axe

feature request - allow runOnly tags to fall through or use array values

Open
#117 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
641
Forks
90
Avg merge
6h 8m
Merged PRs (30d)
1

Description

Hi,

Some background. Let's say I have a div with a color green and a background color of green. Running this test correctly fails the contrast check:

const a11yOptions: RunOptions = {
      runOnly: {
        type: 'tag',
        values: ['wcag2aa']
      }
    };
cy.checkA11y(null, a11yOptions as Options);

But if I set values: ['wcag2aaa] it fails using

"axe-core": "^4.3.5",
"cypress": "^9.2.0",
"cypress-axe": "^0.13.0",

It also fails with wcag21aa, even though 2.1 extends 2.0. I would expect that using the tag 2.1aaa would check everything in 2.1aaa, 2.1aa, 2.1a, 2.1, 2.0aaa, 2.0aa, 2.0a, 2.0, 1aaa, 1aa, 1a, and 1.

The example for getRules shows that rules have multiple tags, so this may be a problem/issue for the axe.run team at Deque instead. If they don't have the rules tagged with all of the appropriate fall through values, then checking for a level won't get all of the lower levels.

thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how cypress-axe forwards the runOnly option to axe.run, then compare the reported behavior with axe-core's getRules output and tag definitions. Determine whether tag fall-through or array values can be supported here or belongs in axe-core; done means the expected WCAG inheritance behavior is implemented or the upstream limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.