alexej-strelzow / testcafe-cucumber-typescript

A complete Framework for End-to-End Testing
MIT License
23 stars 11 forks source link

Parallel execution of test scenarios or feature files are not working for framework : testcafe+typescript+cucumber.js #8

Open arpanoberoi opened 3 years ago

arpanoberoi commented 3 years ago

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.

arpanoberoi commented 3 years ago

I tried running command : npm run tests:parallel , it also throws error - Error: ENOENT: no such file or directory, open '\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 \testcafe-cucumber-typescript\node_modules\@serenity-js\serenity-bdd\src\stage\crew\serenity-bdd-reporter\processors\transformations\activityFinished.ts:14:20

alexej-strelzow commented 2 years ago

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