-
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
should('not.be.visible') fails for non visible elements dur to overflow: hidden and set height #5959
Comments
I see that you are using an older version of Cypress. Before I dive in to completely recreate the issue, could you update to the current version of Cypress and let me know if this is still happening for you? Your issue may have already been fixed. Thanks! |
Hi @jennifer-shehane - I didn't realized I was so behind in versions! |
@rubenreyes2000 It's a bit tricky. We do scrolling whenever you time travel, so that we can highlight the DOM element for preview. We do not do scrolling for a simple assertion like this during the test run. You can see the actual scroll behavior during the test run by adding This is incorrectly failing. I've created the smallest reproducible example of this behavior here:
<html>
<body>
<div style="overflow: hidden; height: 67.84px;">
<h2>Vestibulum</h2>
<p class="content" style="background: red;">
Morbi nisl nunc.
</p>
</div>
</body>
</html>
it('is visible', function () {
cy.visit('index.html')
cy.get('.content').should('not.be.visible')
}) |
This issue was actually resolved in 4.0.0 or 4.0.1 of Cypress. Closing as resolved. |
Current behavior:
There continues to be issues with visibility tests. I saw the list of issues compiled at #1242 but I am not sure this is one of the issues still listed as open.
In summary: an element that is not visible due to parent
overflow: hidden
is still reported as visible.Desired behavior:
Elements not visible due to parent
overflow: hidden
should be reported as not visible by cypress.Steps to reproduce: (app code and test code)
Use this code:
Versions
cypress 3.8.0
The text was updated successfully, but these errors were encountered: