-
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
Visibility false to style='transform: scale(0,0)' or style='tra… #5590
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
Co-Authored-By: Chris Breiding <chrisbreiding@users.noreply.github.com> Update packages/driver/src/dom/visibility.js Co-Authored-By: Chris Breiding <chrisbreiding@users.noreply.github.com> Fixed typo.
@chrisbreiding I found that I missed adding getReasonIsHidden message test in #5591. Can I add it here or should I open a new PR? |
Adding it here is fine. |
…ress-io#5590) * Handle elements hidden by scale. * Check rotateX(90deg), rotateY(90deg) + Use of getBoundingClientRect * Added reason message. * Fixed typo. Co-Authored-By: Chris Breiding <chrisbreiding@users.noreply.github.com> Update packages/driver/src/dom/visibility.js Co-Authored-By: Chris Breiding <chrisbreiding@users.noreply.github.com> Fixed typo. * Use numberRegex created for backface-visibility. * Added test for reason message. * Added missing message test in cypress-io#5591
@sainthkh There's an edge case where this falsely evaluates an element as invisible when the parent has height: 0 that this does not cover. The example is given here: #5974 (comment) |
User facing changelog
When an element is transformed by
scale(0)
orrotateY(90deg)
, it is not visible on the screen, but Cypressbe.visible
checks it's visible. Now, they're invisible.Additional details
It can be confusing to users when something invisible is visible in Cypress tests.
NOTE: In #723, it was only about the change caused by scale. But rotateX(90deg), rotateY(90deg) can cause similar things. So, they're fixed in this PR, too.
Not much. I could remove skip in one visibility test.
I had to parse
matrix3d
to checkscaleZ(0)
. I linked the resources to transformation matrix in comments.How has the user experience changed?
Now, we can check visibility change by transform.
PR Tasks
Has a PR for user-facing changes been opened incypress-documentation
?Have API changes been updated in thetype definitions
?Have new configuration options been added to thecypress.schema.json
?