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

add support for cypress 12 #65

Closed FMuellerBK closed 1 year ago

FMuellerBK commented 1 year ago

This adds support for cypress 12 (tested with 12.17.1), but older versions (< 12) won't work anymore. All of your tests passed locally. Also, all tests of our angular 16 app passed. We use cypress-if quite a lot in this app.

MaxVolobuev commented 1 year ago

Looks like what we need for Cypress >12 version, as currently we have an issue if we add import import "cypress-if"; `The following error originated from your test code, not from Cypress.

Cannot overwite the get query. Queries can only be overwritten with Cypress.Commands.overwriteQuery(). When Cypress detects uncaught errors originating from your test code it will automatically fail the current test. Cypress could not associate this error to any specific test. We dynamically generated a new test to display this failure.`

bahmutov commented 1 year ago

Super, thank you for adding this PR, the tests pass in Cypress v12. Let me update the code to keep v9 and v11 support before releasing it.