archfz/cypress-terminal-report

Error report not working properly

nelsoncc opened this issue · 2 comments

Hi,

Since Cypress upgrade to v4.8.0, the cypress-terminal-report v1.3.1 plugin stopped working.

Before, it showed a full report, with all the steps executed in the test.

Now it shows the following error:

CypressError: The following error originated from your test code, not from Cypress.
   > 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.

My temporary solution was to downgrade to Cypress v4.7.0.

Looking forward to hear any feedback or see any fixes.

Best regards,
Nelson

I am seeing this error as well, only in firefox. It is coming from here:

./node_modules/cypress-terminal-report/src/installLogsCollector.js:77:1

  75 |       // Need to set a promise otherwise logs that just recently failed won't be marked as
  76 |       // failing.
> 77 |       cy.wrap(new Promise((resolve) => {
     | ^
  78 |         setTimeout(() => {
  79 |           cy.task(CONSTANTS.TASK_NAME, {
  80 |             spec: this.test.file,

Released in 1.4.0