Cypress 3 complains about covered elements that make no sense
See original GitHub issueCurrent behavior:
In 2.1.0 tests work fine. In 3.0(1) cypress test fails because cypress think that elements covered, but that just dont make any sense. For example:
CypressError: Timed out retrying: cy.click() failed because this element:
<a href="/auth/signup" class="v-btn v-btn--block v-btn--router primary white--text">...</a>
is being covered by another element:
<html lang="en" data-n-head="lang">...</html>
Or like this
CypressError: Timed out retrying: cy.click() failed because this element:
<button type="button" primary="" data-cy="signup" class="v-btn v-btn--block primary">...</button>
is being covered by another element:
<i data-cy="invalid-check" aria-hidden="true" class="v-icon grey--text text--lighten-1 mdi mdi-close-circle-outline"></i>
Desired behavior:
No errors with hovered elements like in 2.1
Versions
Windows 10, Chrome 68
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:47 (15 by maintainers)
Top Results From Across the Web
cypress fix this problem, or use {force: true} to disable error ...
Since your element is covered by another element, you can use click({force: true}) , to disable the error checking and perform the click....
Read more >How to check for an element that may not exist using Cypress
What is the correct way to check for the existence of an element? I need something like cy.get() that doesn't complain if the...
Read more >Element Coverage - Cypress
I have no idea, and yet the function was 100% covered by the unit tests … Data coverage. How well some code constructs...
Read more >Solving The Element Is Detached From DOM Error In Cypress
A video of a page refreshing and breaking a Cypress test and several possible solutions. Many people complain about the dreaded "Element is ......
Read more >The Most Common Cypress Mistakes - Christian Lüdemann
#1: Not making commands/assertions retry-able. This is the #1 reason people complain over Cypress being “flaky” as this destroys the main stability benefit ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright, I’ve narrowed down the issue. We recently added the
--disable-blink-features=RootLayerScrolling
flag to Cypress on browser launch to fix this issue.It appears that this flag is now causing the issue within this thread, where the registered click positions of elements are shifted, so that the area Cypress calculates to click at, is not the coordinate that Chrome is listening at due to a bug. I have not tracked down the bug in Chromium yet because their bugs list is insanely long.
Hopefully removing this flag does not cause the AUT to shake again. I am not seeing this behavior anyway.
The Workaround Today
Within your
cypress/plugins/index.js
file, we will want to remove the--disable-blink-features=RootLayerScrolling
flag from the flag arguments being sent to chrome before launch.Cypress Fix
We will remove this flag in our next release of Cypress after tracking down the exact Chromium issues and ensuring the AUT shaking bug does not return.
Can confirm, had the same issue. @jennifer-shehane your work around helped