Skip to content

Avoid Cypress warnings about mixing promise and cy commands

Avoid Cypress warnings about mixing promise and cy. API commands

Now that https://github.com/cypress-io/cypress/issues/4790 is fixed we can avoid the Cypress warnings about promises and cy usage by using done.

Cypress Warning: Cypress detected that you returned a promise in a test, but also invoked one or more cy commands inside of that promise.

The test title was:

  > e2e tests signed in "before each" hook

While this works in practice, it's often indicative of an anti-pattern. You almost never need to return both a promise and also invoke cy commands.

Cy commands themselves are already promise like, and you can likely avoid the use of the separate Promise.

https://on.cypress.io/returning-promise-and-commands-in-test

Merge request reports