I have a project that has 6 tests that need to be run, and I’d like to run them in parallel (They are on the same spec file).
I tried setting “parallelism: 6” on my config.yml file, but it just had 6 workers that each ran all 6 tests. How can I set it up so each worker just does one of the 6 tests?
When I run the command “npx playwright test tests/check-in.spec.ts --project=chromium” on my local, it uses 6 workers (I have “fullyParallel: true” in my playwright.config.ts file)
I do not know much about playwright, but I think the issue is that you currently have circleci creating 6 environments in which playwright goes and executes a complete set of all the tests as it is not aware of all the independent environments.
The playwright docs indicate that it supports a feature called sharding that would allow tests to be spread across all the independent environments here (“Sharding in CircleCI”)
https://playwright.dev/docs/ci
If you look into the Sharding feature you may end up with a solution.
I actually found for my case, I just needed to update the playwright.config.ts file. This variable was configured differently for a CI tool than on my local, which is why it worked only on my local.
I changed “workers: process.env.CI ? 1 : undefined” to “workers: process.env.CI ? 6 : undefined”