Parallel, Rerun & Report | Playwright & Cucumber - Typescript | Part 6
Hello :), In this video, we'll learn how to execute the tests in parallel, How to rerun the failed scenarios & how to create the test-results folder in the run time with the help of fs-extra package.
Timestamp:
0:00 Playwright Cucumber - Part 6
0:19 Parallel
2:38 Rerun
11:60 Retry
12:10 Report
Code: github.com/ort...
Reference: github.com/cuc...
---------------------------------------------------------------------
Tamil KZread Channel:
@kurimurai
---------------------------------------------------------------------
🎁Just in case you want to support me ☺️ donation might be helpful.
BuyMeCoffe: www.buymeacoff...
GPay: koushik350-1@okaxis
-------------------------Thank you--------------------------
Thanks for watching, if you like the video, give it a thumbs up 👆.
Sharing is caring, kindly share the video with your friends and colleagues.
Don't forget to subscribe and hit the bell 🔔 notification.
-------------------------------SOCIAL-------------------------------
📝Test Practice Site: letcode.in/
🐦Discord: / discord
📸Instagram: / letcode.in
🎓 LinkedIn: / ortoni
⛳️ XPath Extension: bit.ly/2T5EUCu
Join our WhatsApp group (Only for Channel Members)
bit.ly/3cSPCpm
Zerodha referral link: zerodha.com/?c...
#letcode #playwright #cucumber
Пікірлер: 109
whatever doubts I think he already covered those like thinking of emptying dir ,he explained at end good
@letcode
2 ай бұрын
Thanks 👍
It is really a great video. Thank you so much
@letcode
2 ай бұрын
Welcome
Another great video mate. You are a great teacher.
@letcode
Жыл бұрын
Thanks 👍
Explained very well, Thank you for the great video
@letcode
2 ай бұрын
Glad you like it 😊
Thanks my friend, you are the best!
@letcode
Жыл бұрын
Cool 😎
Hi, In your hooks.ts file you are creating browser(chromium.launch) under beforeAll. suppose if you mention the parallel as 2 in cucumber.json, will it execute beforeAll method twice ? I tried the same thing and its executing beforeAll twice if the parallel count is mentioned as 2 in cucumber.json. Is this an expected behavior of cucumber and is there any way to execute beforeAll only once even if the parallel thread is mentioned as 4 or 5. Please advice.
@letcode
4 ай бұрын
It is the behaviour of cucumber, beforall means before all the scenario of a particular future file..
fantastic job. :)
@letcode
11 күн бұрын
Thanks 👍
hi sir, how can i select and execute the feature i only wanted to run? aside from modifying the path in the cucumber.json file, what are the other way of doing it? thanks
@letcode
8 ай бұрын
You can pass the feature file name from the cli or using tags.
Hello Koushik, how can we update the test reult status on Lambda when the test retry fails.
@letcode
9 ай бұрын
If u r asking about LambdaTest, u have to contact them.
Hi @LetCode with Koushik, how to run test in headless mode using your framework? I set HEAD: false in the env file but it still running headed
@letcode
4 ай бұрын
I believe I have fixed that in the latest version of code.
@hoilehong7756
4 ай бұрын
@@letcode can you guide me how to fix it
@hoilehong7756
4 ай бұрын
@@letcode thank you, I fixed it
Hi @Koushik, I tried this to regenerate the report for the failed test case after rerun, but didn't get updated the report, however, report build posttest ran well. "postest": "npx ts-node src/helper/report.ts", "test:failed": "cucumber-js -p rerun @rerun.txt && npm run posttest" Please suggest how to fix the problem.
@letcode
3 ай бұрын
Oh, I have to check this.
@dev1mail508
3 ай бұрын
@@letcode Thank you Koushik
@sentyl6131
2 ай бұрын
@dev1mail508 @letcode I am also facing same issue. Please help me if you find any solution
Thanks for the video. I use Window operation and face the issue when running npm test, the error is "'true' is not recognized as an internal or external command". Could you please help me?
@letcode
Жыл бұрын
You can use the gitbash terminal
Hi @Koushik How to comment a line in JSON file. Ex: i want comment 1st line in below { "pretest": "npx ts-node src/helper/init.ts", "posttest": "npx tsnode src/helper/report.ts" }
@letcode
9 ай бұрын
// can be used, but commenting on a json file is bad practice
How to attach logs with some strings in report?
@letcode
6 ай бұрын
From hooks you can do it, from test files also possible I have to take a look.
Hi @Koushik, how can we execute test cases on mutiple browsers(like chrome and safari) parllelly ?
@letcode
9 ай бұрын
I have to check, as of now cross parallel browser is not supporting in this framework.
@luckylakshmi6972
9 ай бұрын
Thanks alot for quick reply@@letcode
How are we running all the scripts one after each in a single command?
@letcode
10 ай бұрын
In the cucumber.json file I have included all the feature files
How to run only a single feature file out of multiple files?
@letcode
6 ай бұрын
Give the feature file path with in path
Hi thanku you One more ques : regarding assets and features ,should we delete everytime before we run tests or not ,because it might populate extra results in cucumber-report.html , pls tell
@letcode
2 ай бұрын
It will get deleted
@sumitgoyal385
2 ай бұрын
@@letcode Hi As I can see features data keep on adding ,while assets data is overwritten everytime
Hello Koushik, as mentioned earlier, definitely some great videos from you. Quick question: Playwright normally supports parallel test execution, but can you guide me on how to run parallel tests on multiple browsers when integrating with Cucumber?
@letcode
9 ай бұрын
I'm not sure as of now, i have to check this.
@shivaKumar-oy7ty
9 ай бұрын
@@letcode thank you
Hi bro.. how to run scripts in sequential order in a fearure file..
@letcode
6 ай бұрын
I don't think there is an option for that
can we use allure report with cucumber ?
@letcode
Ай бұрын
Yes I guess, but the report I used is better.
excelent!!
@letcode
4 ай бұрын
Thanks 😊
thank you was a big help
@letcode
Жыл бұрын
Great 😃
Hi @Koushik,how can we get the retry count by runtime, once defined in cucumber.js file
@letcode
9 ай бұрын
Yes, using cli.
Hi @Koushik, how could I run debug within this framework (I’m using VScode, and doing configuration as your instruction in Part 1)? Thanks and have a great day
@letcode
11 ай бұрын
Debug is not working properly, i have to look into it.
Thanks for the helpful videos. Why did you add the '||' in package json - under scripts "test": "cross-env ENV=staging cucumber-js test || true"?
@letcode
Жыл бұрын
If the script test fails then the posttest won't execute, so to make it execute always i have given that.
Error: Cannot find module './init.ts' Require stack: - C:\Users\Desktop\cucumber-playwright\helper\imaginaryUncacheableRequireResolveScript Im getting the above error can you help me her for "init.ts" and "report.ts" file both
@letcode
11 ай бұрын
File path is wrong
Hi, How to give tagname in scripts "test": under package.json. To run scenarios which are tagged in feature file
@letcode
Жыл бұрын
That can be configured from the cucumber.json file
@malasriboora5525
Жыл бұрын
@@letcode may I know what is the command line and how to implement
@malasriboora5525
Жыл бұрын
Thank you as per your suggestion, I have configured in cucumber.json file by giving the below one and it worked "tags": "@tagname",
@letcode
Жыл бұрын
Yes, great 😃
Hello Koushik, if(testInfo.retry > 0){ console.log(`Test is retried ${testInfo.retry} times`); } how can we achieve this with cucumber... Thank you In advance.
@letcode
9 ай бұрын
As for my knowledge, i don't think it's possible.
'true' is not recognized as an internal or external command, operable program or batch file. and index,html file is also not getting generated
@letcode
10 ай бұрын
Use the gitbash terminal
Good job @ appreciate 👏
@letcode
Жыл бұрын
Thanks a lot
Hi, I added in package json file - "test:failed": "cucumber-js @rerun.txt --fail-fast" . in cucmber json i have only default .i am not using rerun:{ } in cucumber json file . my failed test case running only with success mode .
@letcode
23 күн бұрын
You should have another configuration to run only the failed tests,
how can i send the test report generated in playwright to testrail?
@letcode
Жыл бұрын
Not sure, maybe there will be an API
Can we run parallelly same set of test cases in multiple env?
@user-co6nc5ll2t
Жыл бұрын
Can you pls include in upcoming sessions
@letcode
9 ай бұрын
One environment at a time.
Can we use the profile concept for one to one mapping ? E.g one feature file to one step definition something similar to test runner in Java
@letcode
Жыл бұрын
To have different configurations we can use profile.
Can you show How to run parallelly same set of test cases in multiple browsers(like chrome and firefox)?
@letcode
Жыл бұрын
I don't think we have a direct option. Probably we can have to terminal and execute both at the same time..
@user-co6nc5ll2t
Жыл бұрын
@@letcode Can you pls include in upcoming sessions
@letcode
Жыл бұрын
@@user-co6nc5ll2t I'll check
awesome, re-run/parallel worked in 1st attempt, any idea how to re-run config automatically than calling 'npm run test:failed', but thanks a ton
@letcode
2 ай бұрын
Thanks, I'm not sure, but you can add in the post test that should work I guess.
can we run the parallel for Chromium, firefox and Webkit , please replay
@letcode
Жыл бұрын
Only one browser at a time.
@pranitingole5562
Жыл бұрын
@@letcode thanks @koushik , I have another q, when I pull code after environment setup commit, that code I am trying to run it showing 0 scenario 0 step thare is any configurations need to change for staging and prod
@letcode
Жыл бұрын
@@pranitingole5562 you can remove the tags in the cucumber.json file.
@pranitingole5562
Жыл бұрын
@@letcode Thanks @koushik , it's work fine
@letcode
Жыл бұрын
@@pranitingole5562 cool 😎
Can you make parallel testing in Cucumber+ Java + Selenium
@letcode
Жыл бұрын
Already covered in this playlist Cucumber + Selenium Java: kzread.info/head/PL699Xf-_ilW6oK3_otMtu7BPqiy0VlkE-
@Arshadarsh
Жыл бұрын
@@letcode Thanks Koushik i will check it
Please add intergration of logger with cuucmber js. Logs shd attach with each scenario
@letcode
Жыл бұрын
Ok
Great video & helpful. Can we run feature files in Parallel ? @letcode
@letcode
2 ай бұрын
Thanks, this video explains how to run in parallel only.
@sentyl6131
2 ай бұрын
@@letcode Thank you for the reply! Yes bro, I want to run features in parallel. But this video is on running scenarios in parallel. The reason is in my case scenarios in same feature file has data dependency so scenarios should run in sequence in other way feature files should run in parallel.
@letcode
Ай бұрын
Oh ok got it , that I'm not sure, I'll check the docs.
bdd-cucumber-playwright@1.0.0 failed > cucumber-js -p rerun @rerun.txt Error: ENOENT: no such file or directory, open 'D:\Git\BDD-Cucumber-Playwright\@rerun.txt' Here Getting this issue mate ensured that @rerun.txt file is there in project directory. How to resolve this?
@letcode
8 ай бұрын
I guess you are executing from the wrong directory.
When running this on a Mac, I keep getting this error---> ENOENT: no such file or directory, open /fullpath/Playwright_Cucumber_TS/@rerun.txt' even when the file is present in the root of the project
@letcode
Жыл бұрын
In mac, use copy relative path, don't change the slash.