-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
'visible' assertion says visible for elements cropped by parent element with overflow: hidden #4161
Comments
I am having the same issue. In my case, the |
This comment has been minimized.
This comment has been minimized.
What is additionally weird is that when you go to hover to see the snapshot, the blue div does appear in the snapshot. I've written a failing test for this within #4421 |
…ith el outside bounds Addresses #4161
The code for this is done in cypress-io/cypress#4421, but has yet to be released. |
* Add failing test case for visible element within overflow hidden then position absolute element. Addresses #4395 * Write failing test case for when parent is flex and overflow hidden with el outside bounds Addresses #4161 * Wrote failing test for visibility outside of clip-path Addresses #1178 * Add failing tests for transform scale Addresses #723 * Add failing test for backfact-visibility hidden example * cs -> js fixes * Add more specific error when el is not element * Always return as visible when checking html or body * Add comments + rename methods to be more exact * Add case for isHidden when visibility is collapse * Add failing test cases for visibility issues * Add comment about how ensureVisibility works under the hood * Add checks and tests for opacity: 0 to be hidden * Simplify if/case statements to be more readable * Expand check for offset parents to also check children of ancestor for positioning attributes close #4395 close #755 * Fix issue where els with parents with absolute position inside overflow hidden would be calculated as not visible * comment out opacity checks for patch release * Add more tests around new visibility assertions - Add case to make sure display none is not on the option or optgroup itself * Fix failing assertion - where el was undefined when looking for visibiliyt * remove commented out code involving opacity 😬
Released in |
Current behavior:
Cypress claims an element is visible, while it's completely cropped by parent
overflow: hidden
container element.Here's html:
Here's the test:
All three divs, red, green and blue are 80% of the parent, parent div is

overflow: hidden
, there is no way for a user to scroll to blue div:But Cypress somehow scrolls to that div and thinks it's visible:

Desired behavior:
Above code should be enough, but just in case, here's the reproduction repo: https://github.com/mvasin/cypress-visible-bug
Versions
Cypress 3.2.0, Ubuntu 18.04.2 LTS, Electron 59 or Chrome 74
The text was updated successfully, but these errors were encountered: