testcafe-cucumber-typescript
testcafe-cucumber-typescript copied to clipboard
Parallel execution of test scenarios or feature files are not working for framework : testcafe+typescript+cucumber.js
Hi,
I am unable to take parallel run of test scenarios or feature files. I added the below command in the package.json , in order to run test cases parallelly on windows.
"test:win:parallel": "cucumber-js.cmd -p cucumber -- --parallel 2"
And I added the testcafe concurrency in hook.ts in runner -
runner = runner
.src(./${TEST_FILE}
)
.screenshots('out/reports/screenshots/', false) // we create screenshots manually!
.concurrency(2) //To open two instances of browser
.browsers(${BROWSER}${BROWSER_FLAGS}
.trim());
I executed the command : npm run test:win:parallel Two chrome instances got launched, however all the testcases/scenarios executed in one chrome instance and the other chrome instance remains idle.
I also launched the browser every time for each test scenario by calling the method createServerAndRunTests() in before method (this works perfectly fine), but the parallel execution is not working.
I tried running command : npm run tests:parallel , it also throws error - Error: ENOENT: no such file or directory, open '<Path of local system>\testcafe-cucumber-typescript@skip''
In order to resolve this error , I remove the tag present in tests (line number 15 : package.json) and then again executed the command : npm run tests:parallel . The two browser instances got loaded and the test scenarios executed in the instances. However, during report generation, getting the error - TypeError: Cannot read property 'step' of undefined at <Path of local system>\testcafe-cucumber-typescript\node_modules@serenity-js\serenity-bdd\src\stage\crew\serenity-bdd-reporter\processors\transformations\activityFinished.ts:14:20
Yes, seems like serenity-js does not play well with testcafe parallel execution. What I've seen, the ordinary cucumber HTML report is fine. I believe this needs special integration, see https://github.com/serenity-js/serenity-js/issues/330