bahmutov / cypress-if

Easy conditional if-else logic for your Cypress tests when there is no other way
https://cypress.tips/courses/cypress-plugins
96 stars 12 forks source link

Correctly skip the entire `else` chain #15

Closed bahmutov closed 2 years ago

bahmutov commented 2 years ago

In this situation

cy.get('[htmlfor="toggle-all"]', { timeout: 0 })
  .if('visible')
  .click()
  .get('.clear-completed')
  .click()
  .else()
  .log('**nothing to complete**');

If executes the "if" commands, yet still logs "nothing to complete" because it does not skip the entire "else" branch

Screen Shot 2022-08-31 at 09 42 11
github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.4.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: