Skip to main content

Browserstack.json Reference

A list of browserstack.json settings you can use to run Cypress tests on BrowserStack.

The following code shows the sample browserstack.json file:

browserstack.json
{
    "auth": {
        "username": "YOUR_USERNAME",
        "access_key": "YOUR_ACCESS_KEY"
    },
    "browsers": [
        {
            "browser": "chrome",
            "os": "Windows 10",
            "versions": [
                "latest",
                "latest-1"
            ]
        },
        {
            "browser": "firefox",
            "os": "Windows 10",
            "versions": [
                "latest",
                "latest-1"
            ]
        },
        {
            "browser": "edge",
            "os": "Windows 10",
            "versions": [
                "latest",
                "latest-1"
            ]
        }
    ],
    "run_settings": {
        "nodeVersion": "<auto populated node version>",
        "cypress_version": "9.latest",
        "cypress_config_file": ".<path/to/your/cypress.json/file>",
        "home_directory": "</path/to/your/projects/root_directory/name_of_root_directory>",
        "specs": ["cypress/integration/login/**/*", "cypress/integration/examples/actions.spec.js"],
        "spec_timeout": 10,
        "npm_dependencies": {
            "npm-package-you-need-to-run-tests-1": "^1.2.1",
            },
        "package_config_options": {
            "npm-package-you-need-to-run-tests-1_options": {
                "option1": true,
                "option2": "some-value"
            }},
        "exclude": ["some-folder/test.js", "static/*.pdf"],
        "system_env_vars": ["NPM_TOKEN", "GITHUB_SECRET", "<ANY_OTHER_ENV_VAR_AVAILABLE_IN_YOUR_SYSTEM>"],
        "project_name": "My sandbox project",
        "build_name": "Build no. 1",
        "parallels": "5",
        "record": true,
        "record-key": "<your_record-key>",
        "projectId": "<your_cypress_project_id>",
        "geolocation": "<country_code>",
        "headless": true
    },
    "connection_settings": {
        "local": false,
        "local_identifier": null,
        "local_mode": null,
        "local_config_file": null
    },
    "disable_usage_reporting": false
}

The following table provides a list of configurations that you can set in the browserstack.json file to run your Cypress tests.

Object Key Value Reference
auth username Your BrowserStack username. Set your username
auth access_key Your BrowserStack access key. Set your access key
run_settings cypress_version 6.Latest, 7.Latest, 8.Latest, 9.Latest Set the required Cypress version
run_settings nodeVersion Set the required node version to run your Cypress tests. Supported node versions are 14.19.1 and 16.15.0 N/A
run_settings cypress_config_file Absolute or relative path to the cypress.json file. Specify the Cypress config file that you want to use
run_settings specs An array of patterns (file paths or regexes) that match the spec files that you want to run. Specify the spec files that you want to run
run_settings home_directory Absolute or relative path to root directory in case of multiple cypress.json files. Specify the root directory to avoid your test being failed
run_settings geolocation Country code for the location you want to simulate. Simulate a specific geolocation
run_settings spec_timeout Timeout value in case any spec with issues is killed and build continues. Set the timeout duration for the spec files
run_settings project_name


build_name
String value to identify the project.

String value to identify the build.
Set your project name


Set your build name
run_settings npm_dependencies List of dependent npm packages that your project requires. Set the npm dependencies required to run your Cypress tests
run_settings exclude An array of patterns (file paths or regexes) to exclude files that are not required. Specify the files you want to exclude from your tests
run_settings system_env_vars Set and apply any system level environment variables to BrowserStack remote instances. Define environment variables
run_settings record




record-key




projectId
Set True to generate test recording and publish to the Cypress dashboard.

record-key generated for the project that can be found on the Cypress dashboard.

projectId generated for the project that can be found on the Cypress dashboard.
Generate test results on the Cypress dashboard



Record key from the Cypress dashboard



Project ID from the Cypress dashboard
browsers os


browser



versions
Specify the OS where you want to run tests.

Specify the browser where you want to run tests.

Specify the browser version where you want to run tests.
Name of the operating system

Name of the browser



Version of the browser
disable_usage_reporting na Set as True by default and is used by the CLI to collect anonymized usage data. Enable or disable usage reporting

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

Is this page helping you?

Yes
No

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!

Talk to an Expert
Talk to an Expert