Specify Cypress configuration files
Learn how to specify a Cypress configuration file for your test runs on BrowserStack.
Starting BrowserStack Cypress-CLI v1.5.0, you can specify the Cypress configuration file that you want to use in two ways:
- Mentioning the configuration file details in
browserstack.json
- Using the
--cypress-config-file
CLI parameter
Using browserstack.json
You can use the cypress_config_file
key in run_settings
option to specify
the Cypress configuration file that you want to use.
Key | Accepted values |
---|---|
cypress_config_file |
Path (absolute or relative to browserstack.json) to the Cypress configuration file |
For example:
// browserstack.json
{
...
"run_settings": {
...
"cypress_config_file": "./cypress.config.js"
...
}
...
}
// browserstack.json
{
...
"run_settings": {
...
"cypress_config_file": "./cypress.json"
...
}
...
}
Using the CLI
You can use the following CLI parameter while running the tests using the run
command:
Arg | Shorthand | Accepted values |
---|---|---|
--cypress-config-file |
--ccf |
Path (absolute or relative to browserstack.json) to the Cypress configuration file |
For example:
# Pass a relative path to the CLI
browserstack-cypress run --sync --cypress-config-file ./cypress.config.js
# Pass an absolute path like this
browserstack-cypress run --sync --cypress-config-file /Users/holmes/project/tests/cypress.config.js
# Pass a relative path to the CLI
browserstack-cypress run --sync --cypress-config-file ./cypress.json
# Pass an absolute path like this
browserstack-cypress run --sync --cypress-config-file /Users/holmes/project/tests/cypress.staging.json
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!