Skip to content

Commit d1e38dd

Browse files
author
Rohan Jain
committed
Add documentation for browserstack-runner configuration
1 parent 4562270 commit d1e38dd

File tree

1 file changed

+79
-3
lines changed

1 file changed

+79
-3
lines changed

README.md

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,87 @@ For development,
1414
npm link
1515

1616
## Configuration
17-
To run browser tests on BrowserStack infrastructure, copy
18-
`browserstack.sample.json` to your repository as `browserstack.json`
19-
and modify the parameters based on your requirements.
17+
To run browser tests on BrowserStack infrastructure, you need to
18+
create a `browserstack.json` file in project's root directory (the
19+
directory from which tests are run).
2020

21+
### Parameters
22+
23+
- *username*: BrowserStack username
24+
(Alternatively: use `BROWSERSTACK_UESRNAME` environment variable)
25+
26+
- *key*: BrowserStack key
27+
(Alternatively: use `BROWSERSTACK_KEY` environment variable)
28+
29+
- *test_path*: Path to the which will execute the tests when opened
30+
in a browser.
31+
32+
- *browsers*: A list of browsers on which tests are to be run.
33+
34+
A sample configuration file:
35+
36+
{
37+
"username": "<username>",
38+
"key": "<key>",
39+
"test_path": "relative/path/to/test/page",
40+
"browsers": [{
41+
"browser": "firefox",
42+
"browser_version": "15.0",
43+
"device": null,
44+
"os": "OS X",
45+
"os_version": "Snow Leopard"
46+
},
47+
{
48+
"browser": "firefox",
49+
"browser_version": "16.0",
50+
"device": null,
51+
"os": "Windows",
52+
"os_version": "7"
53+
},
54+
{
55+
"browser": "firefox",
56+
"browser_version": "17.0",
57+
"device": null,
58+
"os": "Windows",
59+
"os_version": "8"
60+
},
61+
{
62+
"browser": "ie",
63+
"browser_version": "8.0",
64+
"device": null,
65+
"os": "Windows",
66+
"os_version": "7"
67+
},
68+
{
69+
"browser": "ie",
70+
"browser_version": "9.0",
71+
"device": null,
72+
"os": "Windows",
73+
"os_version": "7"
74+
},
75+
{
76+
"browser": "ie",
77+
"browser_version": "10.0",
78+
"device": null,
79+
"os": "Windows",
80+
"os_version": "8"
81+
}]
82+
}
83+
84+
85+
### Secure Information
86+
87+
To prevent checking in the BrowserStack `username` and `key` in your
88+
source control, the corresponding environment variables can be used.
89+
90+
The environment variables then can be safely provided in the build
91+
configuration. For example, with travis-ci you can follow:
92+
93+
http://about.travis-ci.org/docs/user/build-configuration/#Secure-environment-variables
2194

2295
## Running tests
2396
Run `browserstack-runner` to run the tests on all the browsers mentioned
2497
in the configuration.
98+
99+
You can include this in your test script to automatically run cross
100+
browser tests on every build.

0 commit comments

Comments
 (0)