Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: How to Run One Worker for Chrome and One Worker for Edge in Parallel in Playwright #34566

Open
ThoufiAha opened this issue Jan 31, 2025 · 1 comment

Comments

@ThoufiAha
Copy link

Version

1.50.0

Steps to reproduce

I’m trying to run my tests with Playwright where I want to allocate one worker for Chrome and another worker for Edge, but despite using different configurations for each browser in my playwright.config.js, the workers are being assigned incorrectly.

When I set workers: 2, both workers are initially assigned to run all Chrome tests in parallel, and only after the Chrome tests are completed, the workers switch to Edge and run tests in parallel for Edge.
My goal is to run both browsers (Chrome and Edge) in parallel with one worker per browser without them interfering with each other.
Here’s the approach I’ve tried:

Setting workers: 2 globally
Using projects for Chrome and Edge with testIgnore to separate tests for each browser (but it doesn't solve the issue).
I also tried adding workers: 1 to each project, but I get an error saying workers is not a valid property inside projects.
How can I configure Playwright to run Chrome and Edge tests simultaneously with one worker per browser? Any help would be greatly appreciated!

Expected behavior

My goal is to run both browsers (Chrome and Edge) in parallel with one worker per browser without them interfering with each other.

Actual behavior

both workers are initially assigned to run all Chrome tests in parallel, and only after the Chrome tests are completed, the workers switch to Edge and run tests in parallel for Edge.

Additional context

No response

Environment

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx  
    Memory: 986.40 MB / 5.91 GB
  Binaries:
    Node: 22.13.1 - C:\Program Files\nodejs\node.EXE
    npm: 11.0.0 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.96.4 - C:\Users\91735\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  npmPackages:
    playwright: ^1.50.0 => 1.50.0
@agg23
Copy link
Contributor

agg23 commented Jan 31, 2025

Why do you care in which order the tests in the projects are executed? The projects do run in parallel by default, but it will still populate the workers with tests from a project before it starts distributing workers to the other projects (https://playwright.dev/docs/test-projects#running-sequence).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants