Skip to content

Commit 0e16d31

Browse files
committed
Addressed review comments.
1 parent 2f4c1fb commit 0e16d31

File tree

1 file changed

+43
-41
lines changed

1 file changed

+43
-41
lines changed

user/browserstack.md

+43-41
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ like Selenium, Karma and others.
1010
This add-on automatically sets up Local Testing which allows you to test your private servers, alongside public
1111
URLs, using the BrowserStack cloud. To do this it uses the BrowserStackLocal binary for your build platform.
1212

13+
[BrowserStack Local Testing][local-testing] establishes a secure connection between your Travis build container/VM
14+
and BrowserStack servers. Local Testing also has support for firewalls, proxies and Active Directory.
15+
Once the secure connection is setup, all URLs work out of the box, including your webserver, local folders, as well as
16+
URLs with HTTPS.
17+
1318
[local-testing]: https://www.browserstack.com/local-testing
1419
[open-source-browserstack]: https://www.browserstack.com/pricing
1520
[account-settings]: https://www.browserstack.com/accounts/settings
@@ -19,40 +24,35 @@ URLs, using the BrowserStack cloud. To do this it uses the BrowserStackLocal bin
1924

2025
## Setting up BrowserStack
2126

22-
[BrowserStack Local Testing][local-testing] establishes a secure connection between your Travis build container/VM
23-
and BrowserStack servers. Local Testing also has support for firewalls, proxies and Active Directory.
24-
Once the secure connection is setup, all URLs work out of the box, including your webserver, local folders, as well as
25-
URLs with HTTPS.
26-
27-
Before you move ahead please sign up for a BrowserStack account if you haven't already, it's
27+
Please sign up for a BrowserStack account if you haven't already; it's
2828
[free][open-source-browserstack] for Open Source projects. Once you have signed up get your username and access key from
29-
the [account settings][account-settings] page. Your username and access key will be required in configuring
30-
your projects .travis.yml file.
29+
the [account settings][account-settings] page. Your username and access key are required to configure the `.travis.yml`
30+
file of your project.
3131

32-
Choose whether you want to store your access key as plain text or in secure/encrypted form. For open source projects we recommend
33-
storing the access key in secure form so that pull requests cannot use the keys stored in your .travis.yml.
32+
Choose whether you want to store your access key as plain text or in a secure/encrypted form. For open source projects we recommend
33+
storing the access key in a secure form so that pull requests cannot use the keys stored in your .travis.yml.
3434
For more information see the [pull requests page](http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests).
3535

3636

3737
### Plain Text Access Key
3838

3939

40-
To keep your access key in plain text add the following configuration to your .travis.yml file,
40+
To store your access key in plain text format, add the following configuration to your .travis.yml file:
4141

4242
addons:
4343
browserstack:
4444
username: "Your BrowserStack username"
4545
access_key: "Your BrowserStack access key"
4646
4747

48-
Note, this keeps your access key in plain text and other users that have access to your repository can read and use
49-
the same access key to test on BrowserStack. If you want to prevent this you can encrypt your access key as explained below.
48+
Note: Other users that have access to your repository can read and use your plain text
49+
access keys to test on BrowserStack. If you want to prevent this you should encrypt your access key as explained below.
5050

5151
### Encrypted Access Key
5252

53-
To encrypt your access key for use in .travis.yml you can encrypt it using `travis encrypt "your BrowserStack access key"`.
53+
To encrypt your access key for use in .travis.yml you can use `travis encrypt "your BrowserStack access key"`.
5454
You need to have the travis cli installed to be able to do this (see [Encryption Keys][encryption-keys] for more details).
55-
Once your access key is encrypted you can add the secure string as,
55+
Once your access key is encrypted you can add the secure string:
5656

5757
addons:
5858
browserstack: "Your BrowserStack username"
@@ -62,11 +62,12 @@ Once your access key is encrypted you can add the secure string as,
6262

6363
### Local Identifier
6464

65-
A Local identifier is a unique identifier for each Local connection when multiple Local connections are connected.
66-
The add-on will **ALWAYS** create a local identifier for each local connection that is created,
67-
this local identifier MUST be added to the Selenium capabilities if Selenium is the testing framework being used.
68-
The local identifier is exposed as an environment variable `BROWSERSTACK_LOCAL_IDENTIFIER`. You can use this to set
69-
Selenium capabilities as, using Ruby's [selenium-webdriver][browserstack-ruby-bindings]
65+
A Local Identifier is a unique identifier for each Local connection when multiple Local connections are connected.
66+
The add-on will **ALWAYS** create a Local Identifier for each local connection that is created. If you are using the Selenium
67+
testing framework, the Local Identifier must be added to the Selenium capabilities.
68+
69+
The Local Identifier is exposed as an environment variable `BROWSERSTACK_LOCAL_IDENTIFIER`. You can use it to set
70+
the Selenium capability. See the following example which uses Ruby's [selenium-webdriver][browserstack-ruby-bindings]:
7071

7172
require 'rubygems'
7273
require 'selenium-webdriver'
@@ -82,14 +83,16 @@ Selenium capabilities as, using Ruby's [selenium-webdriver][browserstack-ruby-bi
8283
:url => "http://USERNAME:[email protected]/wd/hub",
8384
:desired_capabilities => caps)
8485

85-
Local identifiers are essential for [matrix builds][travis-matrix-builds]. Matrix builds in travis can be run on
86-
the same VM so to ensure that the correct local tunnel gets the correct requests we need to add the Local identifier
87-
when starting the connection.
86+
Local identifiers are essential for [matrix builds][travis-matrix-builds]. Since matrix builds in travis can be run on
87+
the same VM, we need to add the Local Identifier when starting the connection to ensure that the correct local tunnel
88+
gets the right requests.
89+
90+
## Additional Features
8891

8992
### Folder Testing
9093

9194
Local testing also allows you to test HTML in local folders. To enable folder testing you need to set the
92-
name of the local folders as,
95+
name of the local folders as:
9396

9497
addons:
9598
browserstack: "Your BrowserStack username"
@@ -100,35 +103,34 @@ name of the local folders as,
100103
You can then access the HTML files via the url
101104
`http://$BROWSERSTACK_USERNAME.browserstack.com/"Path to your HTML file with respect to the folder set."`
102105

106+
### Proxy
103107

104-
### Other Options
105-
106-
Other options that are supported by the add on are,
107-
* **force_local**: If this is set to true then all URLs will be resolved via the Travis container that your build is running in.
108-
* **only**: restricts Local testing access to the specified local servers and/or folders.
109-
110-
Example,
108+
Local testing also allows you to set the proxy host, port, username and password
109+
through which all urls will be resolved:
111110

112111
addons:
113112
browserstack: "Your BrowserStack username"
114113
access_key:
115114
secure: "The secure string output of `travis encrypt`"
116-
force_local: true
117-
only: dev.example.com,80,0,*.example.org,80,0
115+
proxy_host: "Proxy server host"
116+
proxy_port: "Proxy server port"
117+
proxy_user: "User to use when accessing proxy server"
118+
proxy_pass: "Password to use when accessing proxy server"
118119

119-
The format for the only flag is, `"Host pattern,Host Port,Flag for SSL True(1)/False(0)" and repeat.
120120

121-
### Proxy Options
121+
### More Options
122122

123-
Local testing also allows you to set the proxy host, port, username and password through which all
124-
urls will be resolved. You can set proxy settings as follows,
123+
Some other options that are supported by the add on -
124+
* **force_local**: If this is set to true then all URLs will be resolved via the Travis container that your build is running in.
125+
* **only**: restricts Local testing access to the specified local servers and/or folders.
126+
127+
Sample usage,
125128

126129
addons:
127130
browserstack: "Your BrowserStack username"
128131
access_key:
129132
secure: "The secure string output of `travis encrypt`"
130-
proxy_host: "Proxy server host"
131-
proxy_port: "Proxy server port"
132-
proxy_user: "User to use when accessing proxy server"
133-
proxy_pass: "Password to use when accessing proxy server"
133+
force_local: true
134+
only: dev.example.com,80,0,*.example.org,80,0
134135

136+
The format for the **only** flag is, `"Host pattern,Host Port,Flag for SSL True(1)/False(0)" and repeat.

0 commit comments

Comments
 (0)