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

Can we pass unique arguments to each thread? #171

Open
nimiyajoseph opened this issue Aug 9, 2023 · 1 comment
Open

Can we pass unique arguments to each thread? #171

nimiyajoseph opened this issue Aug 9, 2023 · 1 comment

Comments

@nimiyajoseph
Copy link

Hi,

Can we pass unique arguments to each thread?
For eg: I am going to pass t as 2, I want the first thread to use CredentialsA and second thread to use CredentialsB. Is it possible?

@danielclarify
Copy link

That can be handled on the Cypress side. Because the environment variable is set to CYPRESS_THREAD, anything prepended with CYPRESS_ can be accessed like so: Cypress.env('THREAD'). For example, you can do something like the following

if (Cypress.env('THREAD')) {
  email = `user_${Cypress.env('THREAD')}@example.com`
}

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