cypress-parallel icon indicating copy to clipboard operation
cypress-parallel copied to clipboard

Specify Cypress Config for each thread

Open MatthewLJensen opened this issue 2 years ago • 5 comments

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?

MatthewLJensen avatar Aug 01 '22 17:08 MatthewLJensen

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)

joshuajtward avatar Aug 17 '22 17:08 joshuajtward

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

n-studio avatar Nov 15 '22 03:11 n-studio

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

luisrudge avatar Dec 07 '22 02:12 luisrudge