You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The <details> element can be used to create native HTML dropdowns, where the contained <summary> element is always visible, and other children can be toggled between visible and not visible. Currently, Cypress will always determine all elements within a <details> tag to be visible, even when they are clearly not.
I was able to reproduce this in both Electron v118 and Firefox v130.
Desired behavior
In this situation, Cypress should only find elements visible if they are actually visible on the page. (i.e. when the <details> element has been toggled open.
Test code to reproduce
Here is a simple reproducing example:
<body><detailsid="myDetails"><summaryid="opener">This is a details element</summary><pid="inner">This is hidden inside of it</p></details></body>
it(`finds not-visible disclosure elements`,()=>{cy.visit({url: "/other_files/scratch_paper.html"})cy.get("#myDetails").should("be.visible")cy.get("#opener").should("be.visible")// This fails: "expected '<p#inner>' not to be 'visible'"cy.get("#inner").should("not.be.visible")})
Here is what the test shows. In the first screenshot, you can see that the #inner element is not visible, but Cypress finds it.
Here is what it looks like when #myDetails is opened:
Cypress Version
13.9.0
Node version
v22.9.0
Operating System
macOS 13.4
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered:
Current behavior
The
<details>
element can be used to create native HTML dropdowns, where the contained<summary>
element is always visible, and other children can be toggled between visible and not visible. Currently, Cypress will always determine all elements within a<details>
tag to be visible, even when they are clearly not.I was able to reproduce this in both Electron v118 and Firefox v130.
Desired behavior
In this situation, Cypress should only find elements visible if they are actually visible on the page. (i.e. when the
<details>
element has been toggled open.Test code to reproduce
Here is a simple reproducing example:
Here is what the test shows. In the first screenshot, you can see that the
#inner
element is not visible, but Cypress finds it.Here is what it looks like when
#myDetails
is opened:Cypress Version
13.9.0
Node version
v22.9.0
Operating System
macOS 13.4
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: