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
Copy file name to clipboardExpand all lines: README.md
+33-9Lines changed: 33 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,19 @@ If you're getting an error `EACCES open ... BrowserStackLocal`, configure npm to
25
25
26
26
Where `[user]` is replaced with a local user with enough permissions.
27
27
28
+
CLI options:
29
+
30
+
`--path`: Can be used if a different test runner is needed other than the one present in the `browserstack.json` file.
31
+
32
+
`--pid`: Custom `pid` file that stores the pid's of the BrowserStackLocal instances created.
33
+
34
+
`--verbose` or `-v`: For verbose logging.
35
+
36
+
`--browsers` or `-b`: Space separated list of `cli_key` as defined in the `browserstack.json` file. This will run tests on the selected browsers only. If not present tests will run on all browsers present in the configuration file.
`browserstack-runner` can also be used as a module. To run your tests, inside your project do -
@@ -160,7 +173,11 @@ The structure of the `report` object is as follows -
160
173
161
174
To run browser tests on BrowserStack infrastructure, you need to create a `browserstack.json` file in project's root directory (the directory from which tests are run), by running this command:
162
175
163
-
browserstack-runner init
176
+
`browserstack-runner init [preset] [path]`
177
+
178
+
`preset`: Path of a custom preset file. Default: `presets/default.json`
179
+
180
+
`path`: Path to test file. Default: `path/to/test/runner`
164
181
165
182
### Parameters for `browserstack.json`
166
183
@@ -191,33 +208,37 @@ A sample configuration file:
191
208
"browser_version": "10.0",
192
209
"device": null,
193
210
"os": "Windows",
194
-
"os_version": "8"
211
+
"os_version": "8",
212
+
"cli_key": 1
195
213
},
196
214
{
197
215
"os": "android",
198
216
"os_version": "4.0",
199
-
"device": "Samsung Galaxy Nexus"
217
+
"device": "Samsung Galaxy Nexus",
218
+
"cli_key": 2
200
219
},
201
220
{
202
221
"os": "ios",
203
222
"os_version": "7.0",
204
-
"device": "iPhone 5S"
223
+
"device": "iPhone 5S",
224
+
"cli_key": 3
205
225
}
206
226
]
207
227
}
208
228
```
209
229
210
230
#### `browsers` parameter
211
231
212
-
`browsers` parameter is a list of objects, where each object contains the details of the browsers on which you want to run your tests. This object differs for browsers on desktop platforms and browsers on mobile platforms. Browsers on desktop platform should contain `browser`, `browser_version`, `os`, `os_version` parameters set as required.
232
+
`browsers` parameter is a list of objects, where each object contains the details of the browsers on which you want to run your tests. This object differs for browsers on desktop platforms and browsers on mobile platforms. Browsers on desktop platform should contain `browser`, `browser_version`, `os`, `os_version` parameters set as required and the `cli_key` parameter is optional and can be used in the command line when tests need to be run on a set of browsers from the `browserstack.json` file.
0 commit comments