Open
Description
π What did you see?
Hooks that are loaded via supportCodeLibraryBuilder
encounter an error when using the parallel option in the runCucumber
API.
β What did you expect to see?
Hooks loaded through supportCodeLibraryBuilder
should be properly initialised and accessible, even when parallel mode is enabled.
π¦ Which tool/library version are you using?
Cucumber JS
- 9.5.1
π¬ How could we reproduce it?
- Reset
supportCodeLibraryBuilder
. - Import or require the files you want to use.
- Implement
BeforeAll
usingsupportCodeLibraryBuilder.methods.BeforeAll
. - Finalise
supportCodeLibraryBuilder
.
Once you've completed the above setup, you can invoke runCucumber
with parallel: 0
, and it should work as expected because it uses runTime
.
However, if you set parallel: 1
, you will encounter the following error because it uses the parallel coordinator
.
TypeError: Cannot read properties of undefined (reading 'getInvocationParameters')
at Object.run (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/step_runner.ts:34:43)
at TestCaseRunner.invokeStep (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:137:29)
at TestCaseRunner.runHook (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:273:23)
at /Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:231:29
at TestCaseRunner.aroundTestStep (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:170:34)
at TestCaseRunner.runAttempt (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:218:18)
at TestCaseRunner.run (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/test_case_runner.ts:188:40)
at Worker.runTestCase (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.js:115:30)
at Worker.receiveMessage (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.js:97:24)
at process.<anonymous> (/Users/tamil/Desktop/workspace/cucumber-parallel/node_modules/@cucumber/cucumber/src/runtime/parallel/run_worker.ts:20:8)
π Any additional context?
Code Snippet Used:
This text was originally generated from a template, then edited by hand. You can modify the template here.