badeball / cypress-cucumber-preprocessor

Run cucumber/gherkin-syntaxed specs with Cypress
MIT License
1.32k stars 149 forks source link

Intermittently getting the error CypressError: `cy.task('cypress-cucumber-preprocessor:test-step-finished')` timed out after waiting `60000ms` #1040

Closed rakeshnambiar closed 1 year ago

rakeshnambiar commented 1 year ago

Current behavior

On GitLabCI, when the tests are running continuously by the pipeline, it is failing very often. The error which I can see Intermittently getting the error CypressError: cy.task('cypress-cucumber-preprocessor:test-step-finished') timed out after waiting 60000ms. Also, it didn't generate the multiple-cucumber report due to this error.

An error was thrown in your plugins file while executing the handler for the after:run event.
The error we received was:
TypeError: Cannot destructure property 'message' of 'testStepResult' as it is undefined.
    at JsonFormatter.getStepData (/builds/cloud/custom-software/nimbus-test-suite/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js:183:17)
    at /builds/cloud/custom-software/nimbus-test-suite/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js:100:33
    at Array.map (<anonymous>:null:null)
    at /builds/cloud/custom-software/nimbus-test-suite/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js:98:66
    at Array.map (<anonymous>:null:null)
    at /builds/cloud/custom-software/nimbus-test-suite/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js:94:36
    at Array.map (<anonymous>:null:null)
    at JsonFormatter.onTestRunFinished (/builds/cloud/custom-software/nimbus-test-suite/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js:87:63)
    at EventEmitter.<anonymous> (/builds/cloud/custom-software/nimbus-test-suite/node_modules/@badeball/cypress-cucumber-preprocessor/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js:43:22)
    at EventEmitter.emit (node:events:525:35)
    at afterRunHandler (/builds/cloud/custom-software/nimbus-test-suite/node_modules/@badeball/cypress-cucumber-preprocessor/dist/plugin-event-handlers.js:134:30)

Desired behaviour

The test should work without any further issues and reports has to be generated.

Versions

badeball commented 1 year ago

Hey, and thanks for reporting this issue. You need to provide a minimal, reproducible example issues that illustrates the issue.

rakeshnambiar commented 1 year ago

@badeball that is very difficult as I cannot share the original application details here. Let me see if I can reproduce it on any other public website :(

andriand06 commented 1 year ago

image Hi, i also have the same issue when github action running the jobs. also we can reproduce the issue by running npx cypress run --env someEnvVariable --browser {chrome, edge}

badeball commented 1 year ago

Feel free to provide me with an example any time soon.

youvegotnigel commented 1 year ago

image

I am also facing this issue, after upgrading to version '^17.2.0' of cypress-cucumber-preprocessor. This is the error I got in the Jenkins console.

`An error was thrown in your plugins file while executing the handler for the after:run event.

The error we received was:

TypeError: Cannot destructure property 'message' of 'testStepResult' as it is undefined. at JsonFormatter.getStepData (C:\jenkins\workspace\S12\S12_Regression_Tests\node_modules\@cucumber\cucumber\src\formatter\json_formatter.ts:281:13) at C:\jenkins\workspace\S12\S12_Regression_Tests\node_modules\@cucumber\cucumber\src\formatter\json_formatter.ts:161:23 at Array.map () at C:\jenkins\workspace\S12\S12_Regression_Tests\node_modules\@cucumber\cucumber\src\formatter\json_formatter.ts:159:58 at Array.map () at C:\jenkins\workspace\S12\S12_Regression_Tests\node_modules\@cucumber\cucumber\src\formatter\json_formatter.ts:155:30 at Array.map () at JsonFormatter.onTestRunFinished (C:\jenkins\workspace\S12\S12_Regression_Tests\node_modules\@cucumber\cucumber\src\formatter\json_formatter.ts:147:59) at EventEmitter. (C:\jenkins\workspace\S12\S12_Regression_Tests\node_modules\@cucumber\cucumber\src\formatter\json_formatter.ts:92:14) at EventEmitter.emit (node:events:525:35) at EventEmitter.emit (node:domain:489:12) at afterRunHandler (C:\jenkins\workspace\S12\S12_Regression_Tests\node_modules\@badeball\cypress-cucumber-preprocessor\dist\plugin-event-handlers.js:146:30)`

Cypress version: 11.2.0 Node version: v18.16.0

badeball commented 1 year ago

I want to remind readers that the only thing I want, is a way to reproduce the issue.

@youvegotnigel, you mention a version range (^17.2.0), which doesn't really help me. More useful would be to tell me exactly which version that introduces the erroneous behavior.

badeball commented 1 year ago

Closing due to lack of a reproducible example. Feel free to open up another issue if anything changes in this regard.