component-driven / component-driven/cypress-axe

Support iframes

Open
#100 1 comment 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. It would be great if this library supported an option to target a specific window/document.

This could be achieved with an API like this:

it('checks the iframe content is accesible', () => {
  cy.iframe('iframe.testing').within((frame) => {
    const window = frame.ownerDocument.defaultView
    cy.injectAxe({ window });
    cy.checkA11y(undefined, { window });
  });
});

The only annoying thing is you have to inject the axe-core lib into each iframe that you want to check.

What do you think? I'd be happy to submit a PR.

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 the injectAxe and checkA11y API entry points and how they currently select the window or document. Compare that behavior with the iframe example in the issue, then verify that a selected iframe window can be targeted and that axe-core can be injected for the accessibility check.

Written by the indexing model from the issue text.

Assessment

Tech stack
cypress, typescript
Domain
accessibility, testing
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.