bahmutov / cypress-if

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

Determine the end of the chain correctly #13

Closed bahmutov closed 2 years ago

bahmutov commented 2 years ago

Currently stops at the command with type: parent but that is not too accurate, since some commands are dual

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

Here I expect the "if" branch to stop at "else()" but it stops at "get" and thus executes the .get('.clear-completed') command

Screen Shot 2022-08-31 at 09 22 35
bahmutov commented 2 years ago

Need to keep traversing while the chainerId is is the same

github-actions[bot] commented 2 years ago

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

The release is available on:

Your semantic-release bot :package::rocket: