You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(uncaught exception)CypressError: Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.
The command that returned the promise was:
cy.click()
The cy command you invoked inside the promise was:
cy.openTab()
Because Cypress commands are already promise-like, you don't need to wrap them or return your own promise.
Cypress will resolve your command with whatever the final Cypress command yields.
The reason this is an error instead of a warning is because Cypress internally queues commands serially whereas Promises execute as soon as they are invoked. Attempting to reconcile this would prevent Cypress from ever resolving.
The text was updated successfully, but these errors were encountered:
In my case I need to test a page with a button that should open a popup.
The test clicks on the button this way:
cy.window().getById("open-popup").click();
Then the same error happens:
CypressError: Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.
The command that returned the promise was:
> `cy.click()`
The cy command you invoked inside the promise was:
> `cy.openTab()`
Because Cypress commands are already promise-like, you don't need to wrap them or return your own promise.
Cypress will resolve your command with whatever the final Cypress command yields.
The reason this is an error instead of a warning is because Cypress internally queues commands serially whereas Promises execute as soon as they are invoked. Attempting to reconcile this would prevent Cypress from ever resolving.
at cy.<computed> [as openTab] (cypress_runner.js:160665:72)
at Object.invoke (cypress_runner.js:128531:32)
at functionStub (cypress_runner.js:131217:43)
at Function.invoke (cypress_runner.js:130069:47)
at agent.invoke (cypress_runner.js:144432:27)
at windowOpen (cypress_runner.js:130329:26)
I'm setting the window.open stub in the following way:
Hi, @jakedowns
Im getting this exception:
(uncaught exception)CypressError: Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.
The command that returned the promise was:
The cy command you invoked inside the promise was:
Because Cypress commands are already promise-like, you don't need to wrap them or return your own promise.
Cypress will resolve your command with whatever the final Cypress command yields.
The reason this is an error instead of a warning is because Cypress internally queues commands serially whereas Promises execute as soon as they are invoked. Attempting to reconcile this would prevent Cypress from ever resolving.
The text was updated successfully, but these errors were encountered: