Skip to content
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

backface-visibility: hidden doesn't hide elements from cypress #2985

Closed
callumacrae opened this issue Dec 24, 2018 · 4 comments · Fixed by #5591
Closed

backface-visibility: hidden doesn't hide elements from cypress #2985

callumacrae opened this issue Dec 24, 2018 · 4 comments · Fixed by #5591

Comments

@callumacrae
Copy link

callumacrae commented Dec 24, 2018

Current behavior:

cy.contains() is getting an element which isn't actually visible

Desired behavior:

It should fail as the element isn't visible

Steps to reproduce: (app code and test code)

https://codepen.io/desandro/pen/LmWoWe

On this pen, cy.contains('back') will pass even when it is hidden.

Versions

Latest version, chrome

@jennifer-shehane
Copy link
Member

Thank you so much for providing a reproducible example!

@jennifer-shehane
Copy link
Member

I'm able to reproduce this with the following code:

index.html

<!DOCTYPE html>
<html>
<head></head>
<body>
  <div style="position: absolute; width: 200px; height: 260px; background: red; backface-visibility: hidden;">
    <span id="front" >front</span>
  </div>
  <div style="position: absolute; width: 200px; height: 260px; background: blue; backface-visibility: hidden; transform: rotateY(180deg);">
    <span id="back">back</span>
  </div>
</body>
</html>

spec.js

it('should not be visible', function () {
  cy.visit('index.html')

  cy.get('#front').should('be.visible')
  cy.get('#back').should('not.be.visible')
})

I added a failing test in here: #4421

backface-visibility: https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility

@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope stage: work in progress stage: needs review The PR code is done & tested, needs review labels Nov 4, 2019
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 8, 2019

The code for this is done in cypress-io/cypress#5591, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 8, 2019

Released in 3.6.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants