Cypress - if else #15024
Unanswered
faprile
asked this question in
Component Testing
Cypress - if else
#15024
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i have this if.
if this button is present, then he must press ok, otherwise he must proceed with the other instructions. but it does not work.
if the button is not present, the test looks for it anyway and fails
lged.logged().then($button => { if ($button.is(':visible')){ lged.logged() out.bar().click() out.clickout() } else { out.bar().click() out.clickout() } })
lg.timeout().then($button => { if ($button.is(':visible')){ lg.timeout().click() } else { lg.name().type(user) lg.pw().type(pass) lg.loginbutton() } }) })
Beta Was this translation helpful? Give feedback.
All reactions