Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

then() chaining not working with else() #59

Closed
MRavimoF opened this issue Dec 27, 2022 · 1 comment
Closed

then() chaining not working with else() #59

MRavimoF opened this issue Dec 27, 2022 · 1 comment
Labels

Comments

@MRavimoF
Copy link

MRavimoF commented Dec 27, 2022

function bar() {
      return cy.wrap("testing")
      .if()
      .then(() => cy.wrap("got it"))
      .else()
      .then(() => cy.wrap("else do"))
}

bar().then(it => {
      cy.log(`result: ${it}`)
})

Will print

wrap: testing
wrap: got it

I would have expected to see

wrap: testing
wrap: got it
log: result: got it

I get the expected output if I comment out the else branch

function bar() {
      return cy.wrap("testing")
      .if()
      .then(() => cy.wrap("got it"))
//      .else()
//      .then(() => cy.wrap("else do"))
    }

I am a beginner with Cypress and cypress-if, wondering what's up with this behaviour.

"cypress-if": "^1.10.2",
"cypress": "10.11.0",
"cypress-fail-fast": "^3.4.1",
@github-actions
Copy link

🎉 This issue has been resolved in version 1.10.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant