You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Accessing test results](#accessing-test-results)
9
-
-[License](#license)
10
-
11
1
# BrowserStack Cypress CLI
12
-
You can now run your Cypress tests in BrowserStack using our `browserstack-cypress-cli`. BrowserStack currently supports Cypress 4 and you can start testing on the following browser combinations:
Note that we run tests that are written using Cypress 4.0 and above. Update to
32
+
a newer version if you are using an older version of Cypress and update your
33
+
tests if required.
34
+
35
+
Next, set up your BrowserStack credentials and configure the browsers that you
36
+
want to run your tests on. Use the `init` command to generate a sample
37
+
`browserstack.json` file, or alternatively create one from scratch.
38
+
37
39
```bash
38
-
#create a sample configuration file for configurations and capabilities
40
+
#Create a sample configuration file for configurations and capabilities
39
41
$ browserstack-cypress init
40
42
```
41
43
42
-
This will create a sample `browserstack.json` file. This file can be used to configure your test runs on BrowserStack. Below is the sample file that is generated for your reference.
44
+
Fill in the `auth`, `browsers`, `run_settings` values to be able to run your
45
+
tests. Refer to the [configuration options](#configuration-options) to learn
46
+
more about all the options you can use in `browserstack.json` and the possible
47
+
values.
48
+
49
+
Then, run your tests on BrowserStack:
50
+
51
+
```bash
52
+
$ browserstack-cypress run
53
+
```
54
+
55
+
You can access the test results on the [BrowserStack Automate dashboard](https://automate.browserstack.com/).
56
+
57
+
## Configuration Options
58
+
59
+
The `init` command will create a sample `browserstack.json` file. This file can
60
+
be used to configure your test runs on BrowserStack. Below is the sample file
61
+
that is generated for your reference.
43
62
44
63
```json
45
64
{
@@ -57,33 +76,149 @@ This will create a sample `browserstack.json` file. This file can be used to con
|`username`| This is your BrowserStack username. You can find this in your [Automate dashboard](https://automate.browserstack.com/)| - |
75
-
|`access_key`| This is your BrowserStack access key. You can find this in your [Automate dashboard](https://automate.browserstack.com/)| - |
76
-
|`os` <br/> (_case-sensitive_) | The operating system on which you want to run your test. |`OS X Mojave`, <br/> `OS X Catalina`, and <br/> `Windows 10`|
77
-
|`browser` <br/> (case-sensitive) | The browser on which you want to run your tests. |`chrome`, <br/> `firefox`, and <br/> `edge`|
78
-
|`versions`| A list of browser versions that you want to run your tests on. <br/><br/> **Example:** To run on versions 69, 67 and 65 provide `["69", "67", "65"]`| Right now edge 80 and all chrome versions from 66 to 78 are supported |
79
-
|`specs` <br/> (_deprecated_) | This param is deprecated in favour of a more complete `cypress_proj_dir` param. The path to the spec files that need to be run on BrowserStack | Takes a list of strings that point to location of the spec files |
80
-
|`cypress_proj_dir`| Path to the folder which contains `cypress.json` file. This path will be considered as the root path of the project. |- |
81
-
|`project`| Name of your project. This will be displayed in your Automate dashboard, and you'll be able to search & filter your tests based on the project name. | A string providing the name of the project |
82
-
|`customBuildName`| Helps in providing a custom name for the build. This will be displayed in your Automate dashboard, and you'll be able to search & filter your tests based on the build name. | A string providing the name of the build |
83
-
|`local`| Helps in testing websites that cannot be accessed in public network. If you set this to `true`, please download the Local binary and establish a local connection first (you can learn how to do so [here](https://www.browserstack.com/local-testing/automate#command-line)) | Boolean: `true` / `false`. Set this to `true` if you need to test a local website. Set this to `false` if the website is accessible publicly. |
84
-
|`localIdentifier`| The BrowserStack Local tunnel that should be used to resolve requests. This is applicable only when you start a Local binary with a local identifier. Your tests might fail if you use an invalid local identifier. This option will be ignored if `local` option is set to `false`. | A string if a tunnel identified by the Local identifier should be used (should be same as the one used to start the Local binary). Set this to `null` (default value) to resolve requests using Local without a Local identifier. |
210
+
Example:
211
+
212
+
```json
213
+
{
214
+
"disable_usage_reporting": "false"
215
+
}
216
+
```
217
+
218
+
## CLI Arguments & Flags
219
+
220
+
### Running the Tests
85
221
86
-
### Running the tests
87
222
You can start running your test build using the following command.
[3/24/2020, 2:31:11 PM] Stopping build with given buildId 06f28ce423d10314b32e98bb6f68e10b0d02a49a
@@ -208,16 +345,14 @@ Output:
208
345
}
209
346
```
210
347
211
-
### Limitations
212
-
213
-
-`exec` and `task` are not allowed.
214
-
- While using local, please make sure to create `/etc/hosts` entry pointing to some URL, and use that URL in the tests. The `localhost` URI doesn't work at the moment.
215
-
- Installing custom npm packages are not supported at this moment.
216
-
217
-
# Accessing test results
348
+
## Limitations
218
349
219
-
You can access your test results in [BrowserStack Automate dashboard](https://automate.browserstack.com/). The dashboard provides test details along with video, console logs and screenshots to help you debug any issues.
350
+
-`exec` and `task` are not allowed.
351
+
- While using local, please make sure to create `/etc/hosts` entry pointing to
352
+
some URL, and use that URL in the tests. The `localhost` URI doesn't work at
353
+
the moment. You can use `http://bs-local.com` instead, to replace `localhost`
354
+
- Installing custom npm packages are not supported at this moment on macOS.
220
355
221
-
# License
356
+
##License
222
357
223
358
This project is released under MIT License. Please refer the [LICENSE.md](LICENSE.md) for more details.
0 commit comments