-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cypress fails when use should('be.visible')
on a visible element - overflow hidden with position absolute outside
#4395
Comments
This is actually a duplicate of #755, but I will leave this issue open since the repro is so simple and comparable to our other tests. Here is the line of code you are referring to: https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/dom/visibility.js#L203 Here are the tests for this logic, which I think are fairly self explanatory: https://github.com/cypress-io/cypress/blob/develop/packages/driver/test/cypress/integration/dom/visibility_spec.coffee#L3 We run our
|
should('be.visible')
on a visible element.should('be.visible')
on a visible element - overflow hidden with position absolute outside
… position absolute element. Addresses #4395
@jennifer-shehane Thanks so much for the quick work |
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 |
What was the cypress ver. for this bug? |
I found
should('be.visible')
gives wrong result sometimes (even in latest version). I finally made a simple demo to reproduce it:index.html
hello_spec.ts
A complete small demo: https://github.com/freewind-demos/typescript-cypress-check-visibility-issue-demo
The problem is on this line of code:
(In function
elIsOutOfBoundsOfAncestorsOverflow
)The text was updated successfully, but these errors were encountered: