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 ?
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.
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.
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. 🦝
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.
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
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??
Great question. 💯 Did you try setting `fullyParallel` to `false` on the project level where you define the browser config? gist.github.com/stefanjudis/d204ae0fe69bd96bb154ae8547fdddb7
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?
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?
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.
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
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.
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. :)
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.
Yay! Happy it's been useful! 🎉
Thanks for the video! How could I run many copies of a single test in parallel?
Great tips! Thank you!
Thanks! Happy they're useful!
That was helpful. Thank you :)
Yay! Happy to hear that!
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 ?
Great as always !!!
Thanks! 💙
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.
Would project dependencies to the trick for you? You can define the order of "test groups" with them. 👉 playwright.dev/docs/test-projects#dependencies
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.
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. 🦝
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.
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
Hey, unfortunately we're not familiar with this setup and can't help with this question. :/
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??
Great question. 💯 Did you try setting `fullyParallel` to `false` on the project level where you define the browser config? gist.github.com/stefanjudis/d204ae0fe69bd96bb154ae8547fdddb7
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?
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
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?
Heyooo. :) It's very hard to give advice without looking at implementation details. Did you solve the problem already?
I have a question, how can we run playwright tests for the a/b testing senario?
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. :)
How many workers max we can assign to execute tests ?
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.
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
For this I'd rather recommend using a fixture or a setup step. :) ua-cam.com/video/2O7dyz6XO2s/v-deo.html
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.
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. :)