I just need to pass true for the button variable if the if condition is ok. Then i need to pass the test case if the button variable value is true. Can someone help me to fix this. This is what i have got so far.
cy.get('@checkSkipButton').then(checkSkipButton => {
if (checkSkipButton) {
cy.log("NOT CLICKABLE")
cy.then(button = true)
//cy.log(button)
//return button;
//cy.log(button)
//return button
}else{
cy.log("CLICKABLE")
button = False
//return this
}
} )
cy.log("value is"+button)
button.should(have,value=true)
}