22
33[ ![ npm version] ( https://badge.fury.io/js/browserstack-cypress-cli.svg )] ( https://badge.fury.io/js/browserstack-cypress-cli )
44
5+ > ** Note** : Running Cypress tests on BrowserStack is in private alpha. We will be launching a public beta very soon.
6+ >
7+ > As such, if you don't have an email from us confirming your access to the Cypress integration, you won't be able to run your Cypress tests on our platform just yet.
8+ >
9+ > We are actively working on including more users in the private alpha. If you are an existing Automate user, please write to your BrowserStack account manager or to support@browserstack.com to get early access to the platform before the public beta.
10+
511The ` browserstack-cypress-cli ` is BrowserStack's command-line interface (CLI) which
612allows you to run your Cypress tests on BrowserStack.
713
@@ -48,6 +54,9 @@ tests. Refer to the [configuration options](#configuration-options) to learn
4854more about all the options you can use in ` browserstack.json ` and the possible
4955values.
5056
57+ Make sure you specify the npm packages that your tests need to run using the
58+ ` npm_dependencies ` option in ` run_settings ` .
59+
5160Then, run your tests on BrowserStack:
5261
5362``` bash
@@ -75,14 +84,18 @@ specified folder.
7584 "browsers" : [
7685 {
7786 "browser" : " chrome" ,
78- "os" : " OS X Catalina " ,
79- "versions" : [" 69 " ," 66 " ]
87+ "os" : " Windows 10 " ,
88+ "versions" : [" 79 " ," 78 " ]
8089 }
8190 ],
8291 "run_settings" : {
8392 "cypress_proj_dir" : " /path/to/directory-that-contains-<cypress.json>-file" ,
8493 "project_name" : " my first project" ,
85- "build_name" : " build 1"
94+ "build_name" : " build 1" ,
95+ "npm_dependencies" : {
96+ "npm-package-you-need-to-run-tests-1" : " ^1.2.1" ,
97+ "npm-package-you-need-to-run-tests-2" : " ^7.1.6-beta.13" ,
98+ }
8699 },
87100 "connection_settings" : {
88101 "local" : false ,
@@ -97,7 +110,7 @@ Here are all the options that you can provide in the `browserstack.json`:
97110### Authentication
98111
99112You can use the ` auth ` option to specify your username and access keys. You
100- can find them in your [ Automate dashboard] ( https://automate.browserstack.com/ )
113+ can find them in your [ Automate dashboard] ( https://automate.browserstack.com/ )
101114
102115| Option | Description | Possible values |
103116| ------------ | ----------------------------- | --------------- |
@@ -120,11 +133,11 @@ Example:
120133You can use the ` browsers ` option to specify the list of OS, browser and browser
121134versions. Each browser combination should contain the following details:
122135
123- | Option | Description | Possible values |
124- | ---------- | ---------------------------------------------- | -------------------------------------------------------------- |
125- | ` os ` | Operating system you want to run the tests on. | ` Windows 10 ` , ` OS X Mojave ` and ` OS X Catalina ` |
126- | ` browser ` | Browser you want to run the tests on. | ` chrome ` , ` firefox ` and ` edge ` |
127- | ` versions ` | A list of supported browser versions. | Chrome: ` 66 ` to ` 80 ` <br />Firefox: ` 60 ` to ` 72 ` <br />Edge: ` 80 ` |
136+ | Option | Description | Possible values |
137+ | ---------- | ---------------------------------------------- | --------------------------------------------------------------------- |
138+ | ` os ` | Operating system you want to run the tests on. | ` Windows 10 ` |
139+ | ` browser ` | Browser you want to run the tests on. | ` chrome ` , ` firefox ` and ` edge ` |
140+ | ` versions ` | A list of supported browser versions. | Chrome: ` 66 ` to ` 81 ` <br />Firefox: ` 60 ` to ` 75 ` <br />Edge: ` 80 ` & ` 81 ` |
128141
129142Example:
130143
@@ -133,10 +146,10 @@ Example:
133146 "browsers" : [{
134147 "os" : " Windows 10" ,
135148 "browser" : " chrome" ,
136- "versions" : [" 69 " , " 66 " ]
149+ "versions" : [" 79 " , " 78 " ]
137150 },
138151 {
139- "os" : " OS X Mojave " ,
152+ "os" : " Windows 10 " ,
140153 "browser" : " firefox" ,
141154 "versions" : [" 69" , " 66" ]
142155 }
@@ -154,6 +167,7 @@ BrowserStack.
154167| ` cypress_proj_dir ` | Path to the folder which contains ` cypress.json ` file. | - |
155168| ` project_name ` | Name of your project. You'll be able to search & filter your tests on the dashboard using this. | - |
156169| ` build_name ` | Name of your build / CI run. You'll be able to search & filter your tests on the dashboard using this. username. | - |
170+ | ` npm_dependencies ` | A list of NPM packages that are required to run your Cypress tests along with their version numbers. | - |
157171
158172Example:
159173
@@ -162,7 +176,11 @@ Example:
162176 "run_settings" : {
163177 "cypress_proj_dir" : " /path/to/directory-that-contains-<cypress.json>-file" ,
164178 "project_name" : " my first project" ,
165- "build_name" : " build 1"
179+ "build_name" : " build 1" ,
180+ "npm_dependencies" : {
181+ "npm-package-you-need-to-run-tests-1" : " ^1.2.1" ,
182+ "npm-package-you-need-to-run-tests-2" : " ^7.1.6-beta.13" ,
183+ }
166184 }
167185}
168186```
@@ -412,8 +430,8 @@ $ browserstack-cypress --disable-usage-reporting <your-commands>
412430- While using local, please make sure to create ` /etc/hosts ` entry pointing to
413431 some URL, and use that URL in the tests. The ` localhost ` URI doesn't work at
414432 the moment. You can use ` http://bs-local.com ` instead, to replace ` localhost `
415- - Installing npm packages that your tests might require to run the tests are
416- not supported at this moment .
433+ - Installing npm packages using ` npm_dependencies ` is not supported for tests
434+ running on macOS .
417435
418436## License
419437
0 commit comments