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

preview_player
Показать описание
Learn how to run Playwright tests and spec files sequentially or in parallel by creating different directories and test configurations.

#playwright
Рекомендации по теме
Комментарии
Автор

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.

conorh
Автор

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.

Sowjanyanakkina
Автор

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 ?

ChiragMatkar
Автор

Thanks for the video! How could I run many copies of a single test in parallel?

gambit
Автор

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.

yanjingtui
Автор

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.

satishpolisetty
Автор

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

saurabhsrivastav
Автор

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.

AfsarBaig-wnml
Автор

I have a question, how can we run playwright tests for the a/b testing senario?

SofiaGoyal
Автор

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?

iwsujry
Автор

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?

megpat
Автор

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

salikhanan
Автор

How many workers max we can assign to execute tests ?

shanthi