I have a test case of my site with cypress. however the site, which is been built in vue.js has lets say 2 journeys. in one of them there is an button which I want to click. So, what I want to do is the following:
if ('button exists') {
cy.get(#"button-class").click() //basically click the button
}
If the button isn't there, which can be true for the second journey then carry on, as no button will be there.
Whatever I have tried so far failed. All I want is a simple if statement in cypress.