"contains" and visibility #27120
-
Hello I have a page with two buttons labeled "Cancel", one is visible, and one is hidden (inside a closed drawer). I use So I tried to use :visible pseudo-selector with To explain why I am not refining my selector : I create a internal testing framework with Cypress and Cucumber and steps must be as simple as |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hey @mistic100 👋 If you know there only are two buttons, you can try one of the option:
Let me know if it helps 🙂 |
Beta Was this translation helpful? Give feedback.
Yeah, get it, and what about
cy.get("button:contains('Cancel')").filter(':visible')
In this case,
button:contains('Cancel')
should yeld both elements.