https://cypress.io logo
command not being executed
# i-need-help
a
Cypress is skipping the 2nd command and moving straight to intercept. i know there might be an issue with the way i'm trying to click the button, any help with that will also be much appreciated
g
cy.get($butn)
is incorrect. You probably meant to say
cy.wrap($btn)
a
tried it but still the same
g
Ok, in that case, it is the condition. I think
.is('enabled')
is valid jQuery, I think it should be the opposite
is(':disabled')
, but I will make an example tomorrow to put at my https://glebbahmutov.com/cypress-examples/recipes/conditional-testing.html#click-a-button-if-not-disabled
a
Thank you very much @gray-kilobyte-89541 your example works 🙌