Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

click element if it is visible in cypress

cy.get("selector_for_your_button").then($button => {
  if ($button.is(':visible')){
    //you get here only if button is visible
  }
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #click #element #visible #cypress
ADD COMMENT
Topic
Name
5+1 =