Skip to content

14.0.0: Element being incorrectly seen as visible when it is not visible #30922

@jennifer-shehane

Description

@jennifer-shehane

Current behavior

Starting in 14.0.0, we have a situation where an element is failing a .should('not.be.visible') check when the element is not physically visible.

Desired behavior

This element should not be seen as visible.

Test code to reproduce

index.html

<!DOCTYPE html>
<html>
<body>
  <div style="display: grid; grid-template-columns: 332px 1fr; grid-template-rows: 62px 1fr;">
    <div style="overflow-y: auto;">
      <div style="height: 297px; position: relative;">
        <div style="height: 96px; position: absolute; left: 0; top: 0;">
          <a href="">
            test test-1
          </a>
        </div>
        <div style="height: 36px; position: absolute; left: 0; top: 96px; background-color: red;">
          <a href="">
            test test-2
          </a>
        </div>
      </div>
    </div>
  </div>
</body>
</html>

spec.cy.js

it('test 1', () => {
  cy.visit('index.html')
  cy.contains('test-2').should('not.be.visible')
})

13.17.0

Image

14.0.0

Image

Cypress Version

14.0.0

Node version

Operating System

Debug Logs

Other

No response

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

Status

Generally Available

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions