question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some rules not running with Cypress

See original GitHub issue

Expectation: Run the document-title and html-has-lang rules when running axe-core inside Cypress (Which runs the whole app inside an iFrame)

Actual: The rules are identified as inapplicable

Motivation: The document-title and html-has-lang rules should be able to run correctly when the whole app being tested is mounted inside an iFrame, which is what happens in the case of a Cypress test.

Currently I think what’s happening is that these 2 rules use the window-is-top.js check, which causes the rule to only run for the root/top window object - i.e. not the actual window to be tested in a Cypress test.

Could there be a way to define a “root” or “top” window/document, so that this window-is-top code checks against a specific window object, instead of the default top window?

axe-core version: 3.2.2
Browser: Chrome

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
strakercommented, Jun 6, 2019

Thanks for the issue. We’ll have to investigate to see what can be done.

0reactions
padmavemulapaticommented, Oct 6, 2020

With Cypress - axe.run() injectAxe(); injectIframes(); cy.window({ log: false }).then(async (win: Window) => { const { includedImpacts, ...axeOptions } = options || {}; win.axe.configure({ branding: { application: 'cypress' } }); const results: axe.AxeResults = await win.axe.run( context || win.document, axeOptions ); we were able to run the above mentioned rules successfully getting the results properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practices - Cypress Documentation
If your application is running locally and is sending the emails directly through an SMTP server, you can use a temporary local test...
Read more >
Introduction to Cypress
Cypress commands do not return their subjects, they yield them. Remember: Cypress commands are asynchronous and get queued for execution at a later...
Read more >
Retry-ability - Cypress Documentation
What you'll learn How Cypress retries commands and assertions When commands are retried and when they are not How to address some situations...
Read more >
Configuration - Cypress Documentation
This guide is for Cypress 10 and the new JavaScript configuration file format. If you are on an older version of Cypress that...
Read more >
General Questions | Cypress Documentation
No. In fact Cypress' architecture is very different from Selenium in a few critical ways: Cypress runs in the context of the browser....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found