Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise #35

Closed
jean9696 opened this issue Jun 11, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jean9696
Copy link

jean9696 commented Jun 11, 2020

Hi, I randomly get this error while running my tests in CI.

I cannot reproduce it in local and I don't understand what is happening.

Capture d’écran 2020-06-11 à 17 19 12

https://github.com/archfz/cypress-terminal-report/blob/master/src/installLogsCollector.js#L74


  > 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.wrap()`

The cy command you invoked inside the promise was:

  > `cy.task()`

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.

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Because this error occurred during a `after each` hook we are skipping all of the remaining tests.```

@archfz
Copy link
Owner

archfz commented Jun 11, 2020

@jean9696 Are you using cypress 4.8? If yes the newest version is not yet compatible with this plugin atm. You can downgrade cypress yo 4.7 or maybe help port it for the newer version :).

@archfz archfz added the bug Something isn't working label Jun 11, 2020
@archfz archfz self-assigned this Jun 14, 2020
@archfz
Copy link
Owner

archfz commented Jun 14, 2020

Released in 1.4.0

@archfz archfz closed this as completed Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants