-
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 doesn't handle visibility assertions for fixed or/and transform: translate #2558
Comments
Same problem on Cypress 3.1.0. |
Experiencing similar issue on 3.1.0 as well. I am using flexbox in my application that causes clipping issues with certain elements. |
Experiencing the same issue on Cypress 3.1.2 |
Can anyone provide a reproducible example? Test code + app code. |
Running into the same issue here. Too pressed for time to provide a self-contained example, but in my case it happens with a simple mobile slide-over menu. When my menu has |
I've created an example repository on https://github.com/rwam/cypress-test where you can see the problem in action. The error occurs in headless mode too (using Cypress.Commands.add('hide', { prevSubject: 'element' }, (subject) => {
subject.css('visibility', 'hidden');
}); and in my test: cy.get('header').hide(); Ok, I can use this in a Ciao |
@rwam I've recreated your repo to the minimal amount of code necessary to reproduce. HTML <!DOCTYPE html>
<html>
<head></head>
<body>
<header style="left: 0; right: 0; height: 60px; position: absolute;"></header>
<input id="myInput">
</body>
</html> Spec file Cypress.Commands.add('hide', { prevSubject: 'element' }, (subject) => {
subject.css('visibility', 'hidden');
})
it('Successful test', () => {
cy.visit('index.html');
cy.get('header')
.hide();
cy.get('#myInput')
.should('be.visible')
.type('John Smith')
})
it('Failed test', () => {
cy.visit('index.html');
cy.get('#myInput')
.should('be.visible')
.type('John Smith')
}) Your reproduction is not a bug in Cypress. Elements with The input is visible since the header covering it up has You can however use the None of this reproduction though actually has anything to do with the original issue that was opened concerning elements with fixed / transform: translate being evaluated incorrectly for visibility. @rwam I've created a separate issue for you here: #4420 NEED A REPRODUCIBLE EXAMPLE@kud @justinpincar @stephenchan9 @jon-thompson Everyone that is still experiencing the issue with transform / translate, no one has provided a reproducible example. A simple I was planning to start work on this, but cannot until this is provided. Thanks. |
Unfortunately we have to close this issue as there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward. Please comment in this issue with a reproducible example and we will reopen the issue. 🙏 |
For me this was caused by an incorrect z-index on the element. When I changed the z-index, everything was fine. |
Current behavior:
Cypress is telling me
However, when you check the display, the form in the header with "contexte" is visible.
Desired behavior:
No error, assertion should be "true".
Steps to reproduce:
Try a test on contexte.com and do:
Versions
cypress: 3.0.2
The text was updated successfully, but these errors were encountered: