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

not respecting `.get()` timeout #71

Open midleman opened 1 year ago

midleman commented 1 year ago

Using latest version: 1.10.5.

Try this snippet:

    cy.get('thing', { timeout: 10000 })
      .if('visible')
      .log('thing is visible')
      .else()
      .log('thing is not visible')

It should wait 10 seconds for "thing" before deciding which branch to exercise. However, it immediately goes into the else branch.

midleman commented 1 year ago

I've been poking around trying to make sense of code, and it def seems to be an issue related to "disabling the built-in assertion". https://github.com/bahmutov/cypress-if/blob/a518e6e13713914228ea181ea3b99797926d7513/src/index.js#L257

gnsoria commented 12 months ago

This is also happening for me. I seem to recall a previous version of cypress-if respecting the timeout, but unfortunately that was at a previous employer so I don't know specifically which versions of cypress and cypress-if we were using. But it's breaking for me on cypress-if@1.10 and cypress-if@1.9. (1.8 is failing before that point for a different reason, so I was unable to confirm on that version.)

GeorgeXCV commented 10 months ago

Running into the same issue on cypress-if@1.10.5 and cypress@13.6.2

ederusb2 commented 6 months ago

Same problem with cypress@13.6.4 and cypress-if@1.12.0

galen-at-atomic-jolt commented 3 weeks ago

Same problem with cypress@13.15 and cypress-if@1.13.0...