How to run your Playwright test in parallel or in serial mode

  Рет қаралды 14,704

Checkly

Checkly

Күн бұрын

Пікірлер: 33
@conorh999
@conorh999 Жыл бұрын
This is great, I've been an hour trying to do this in the test case code and a config change is all I needed.
@stefanjudis
@stefanjudis Жыл бұрын
Yay! Happy it's been useful! 🎉
@fonziVazquez
@fonziVazquez Жыл бұрын
Great tips! Thank you!
@stefanjudis
@stefanjudis Жыл бұрын
Thanks! Happy they're useful!
@Leader977
@Leader977 11 ай бұрын
That was helpful. Thank you :)
@ChecklyHQ
@ChecklyHQ 11 ай бұрын
Yay! Happy to hear that!
@ChiragMatkar
@ChiragMatkar Жыл бұрын
we have defined config parallel as true and each spec is defined as serial. we observed that all other tests are skipped if one fails . any way to change this behaviour ?
@The4m3r
@The4m3r Жыл бұрын
Great as always !!!
@stefanjudis
@stefanjudis Жыл бұрын
Thanks! 💙
@Sowjanyanakkina
@Sowjanyanakkina 6 ай бұрын
Hi Mate, have a question on the combo of serial mode + retry failed test method. Scenario Description : A home policy /quote creation involves multiple pages, each page depends on the successful completion of the previous page. Data is filled on each page and the process continues until the last page. After reaching the last page the policy gets created. The automation approach that I need: 1. Treat each page as an individual test 2. Test execution depends on the pass Status of the previous test. 3. If any test fails subsequently should be skipped. 4. Playwright should retry only the failed test for the retry count I provide, shouldn't attempt retrying any previously passed test(s). 5. If the previously failed test passes during retrial executes subsequent tests. Please help, I have tried several combinations & approaches but no success yet! Thanks in advance.
@ChecklyHQ
@ChecklyHQ 6 ай бұрын
Doing this with different tests seems a bit complicated and hard to realize with the test runner. I'd restructure things and use `test.step` for all your... well... steps (it sounds like it's different steps of one test). Then you have full control over what should be retried, failed and when. Hope this helps. 🦝
@gambit3904
@gambit3904 Жыл бұрын
Thanks for the video! How could I run many copies of a single test in parallel?
@satishpolisetty4217
@satishpolisetty4217 9 ай бұрын
Your videos really helped me in better understanding of playwright.I have one challenge in my current setup.I want the spec file execution in a particular order.Let's say I have atest.spec.ts and mtest.spec.ts.In this case I want mtest.spec.ts cases to be executed first(in parallel to save time) and after that atest.spec.ts should be picked up.And on top of all, another test say admincreation.spec.ts should be executed before all if I have ever configure to true from env file. Can you help me adressing this issue? Thanks in advcance.
@ChecklyHQ
@ChecklyHQ 8 ай бұрын
Would project dependencies to the trick for you? You can define the order of "test groups" with them. 👉 playwright.dev/docs/test-projects#dependencies
@SofiaGoyal
@SofiaGoyal Жыл бұрын
I have a question, how can we run playwright tests for the a/b testing senario?
@ChecklyHQ
@ChecklyHQ Жыл бұрын
If you could give more info on the A/B test and what you want to test with PWT, we're happy to share some thoughts. :)
@sushantparab5449
@sushantparab5449 3 ай бұрын
I have 6 tests in my folder. When I run npx playwright test --headed command I want playwright to open 1 Chrome, 1 Safari & 1 MSEdge browser parallelly and run all the 6 tests sequentially in those browsers. Is that possible @Checkly??
@ChecklyHQ
@ChecklyHQ 2 ай бұрын
Great question. 💯 Did you try setting `fullyParallel` to `false` on the project level where you define the browser config? gist.github.com/stefanjudis/d204ae0fe69bd96bb154ae8547fdddb7
@yanjingtui
@yanjingtui Жыл бұрын
Nice video, but i want to know how can i define 2 workers run parallel, which 1 worker for tests in folder "a", and 1 worker for folder "b". a and b folder is like folder sequence in your video.
@saurabhsrivastav902
@saurabhsrivastav902 Жыл бұрын
Hi, I am using Jave with playwright and testng file to run with below command which runs test cases suite in sequence. Should I make changes in command too? >mvn test -Dbase.env=uat -Dbrowser.name=chrome -Dcountry.name=IN -Dtestng.name=testng_RegressionSuite.xml
@ChecklyHQ
@ChecklyHQ Жыл бұрын
Hey, unfortunately we're not familiar with this setup and can't help with this question. :/
@ankittesting
@ankittesting 11 ай бұрын
Hi, The website's custom web workers are failing when fully parallel is enabled in the playwright project as we are making the API calls using the web workers. Any solution to this scenario?
@ChecklyHQ
@ChecklyHQ 11 ай бұрын
Heyooo. :) It's very hard to give advice without looking at implementation details. Did you solve the problem already?
@meg6pat
@meg6pat Жыл бұрын
Great video, but I still got problem running tests. So I got 2 files: login.setup.ts which work in Chromium - login and creates storageState. And logout.spec.ts which is running on all browsers and it fails, as I see it, they didn't using storageState, but in config file they have “use {storageState: ./state.json}”. Any suggestions?
@ChecklyHQ
@ChecklyHQ Жыл бұрын
That's hard to tell without looking at the actual code. But if you want, you can always join the Checkly community and ask there. checklyhq.com/slack
@JessicaJoseph-r3o
@JessicaJoseph-r3o 19 күн бұрын
Awesome
@salikhanan
@salikhanan Жыл бұрын
Quick Question in you example you have Two folder Parallel and Sequence How to Run one test from Parallel and one Test from sequence so that You can use a random value generated in parallel test can use in Sequence test
@ChecklyHQ
@ChecklyHQ Жыл бұрын
For this I'd rather recommend using a fixture or a setup step. :) kzbin.info/www/bejne/aICalaywa72CaNU
@shanthi3152
@shanthi3152 Жыл бұрын
How many workers max we can assign to execute tests ?
@stefanjudis
@stefanjudis Жыл бұрын
That's a great question: I don't think there's a limit from Playwright itself but usually you should set it depending on the number of CPUs that are available on the machine. When spinning up more workers than CPUs things aren't going in parallel anymore because one CPU has to handle multiple workers.
@AfsarBaig-wn6ml
@AfsarBaig-wn6ml 7 ай бұрын
There is barely any example where I want to run tests in serial which are not dependent on each other but when one test fails other subsequent tests to pass.
@ChecklyHQ
@ChecklyHQ 7 ай бұрын
I wouldn't say barely. One example coming to mind immediately is an ecom app where tests rely on an existing account to buy with different payment methods. These have to run in sequence bc otherwise one test is messing with the others. :)
Reuse Playwright  Code across Files and Tests with Fixtures
5:54
Why "page.goto()" is slowing down your tests
8:55
Checkly
Рет қаралды 6 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
Generate Locators in Playwright FAST with This Tool
11:26
Bondar Academy
Рет қаралды 726
Python Web Apps: Testing with Pytest and Playwright
1:31:29
Microsoft Reactor
Рет қаралды 2 М.
Parallel, Rerun & Report | Playwright & Cucumber - Typescript | Part 6
17:45
LetCode with Koushik
Рет қаралды 9 М.
How to detect broken links with Playwright Test
11:20
Checkly
Рет қаралды 3,1 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН