tnicola / cypress-parallel

Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.
MIT License
561 stars 116 forks source link

Specify Cypress Config for each thread #119

Open MatthewLJensen opened 1 year ago

MatthewLJensen commented 1 year ago

Is it possible to specify a different cypress config that can be used for each executing thread? Basically, I want the ability for each thread to execute containing different cypress environment variables.

The only way I can think of on how to do that is to add a switch at the top of every spec to check the environment variable "PARALLEL_THREAD" and determine which config to load based on that. However, it seems like it would be possible to specify a directory containing different configs, or perhaps different cypress.env.json files. As long as the number of configs matched the number of threads specified, then it could assign a different config to each thread.

Is there an alternative way to accomplish this that currently exists?

joshuajtward commented 1 year ago

Is there a reason why you need this to be run by the same parent process? (my guess is for reporting, but that will shape the possible alternatives)

n-studio commented 1 year ago

I would personally need this feature to run the tests on different ports (localhost:3000, localhost:3001, localhost:3002, etc.)

luisrudge commented 1 year ago

I'm on the same boat. I need each thread to point to a different baseUrl (since each baseUrl will be pointing to a different database). It's the only way we can parallelize our tests, because we're resetting the database for each spec