@@ -10,6 +10,11 @@ like Selenium, Karma and others.
10
10
This add-on automatically sets up Local Testing which allows you to test your private servers, alongside public
11
11
URLs, using the BrowserStack cloud. To do this it uses the BrowserStackLocal binary for your build platform.
12
12
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
+
13
18
[ local-testing ] : https://www.browserstack.com/local-testing
14
19
[ open-source-browserstack ] : https://www.browserstack.com/pricing
15
20
[ 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
19
24
20
25
## Setting up BrowserStack
21
26
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
28
28
[ 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.
31
31
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.
34
34
For more information see the [ pull requests page] ( http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests ) .
35
35
36
36
37
37
### Plain Text Access Key
38
38
39
39
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:
41
41
42
42
addons:
43
43
browserstack:
44
44
username: "Your BrowserStack username"
45
45
access_key: "Your BrowserStack access key"
46
46
47
47
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.
50
50
51
51
### Encrypted Access Key
52
52
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" ` .
54
54
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:
56
56
57
57
addons:
58
58
browserstack: "Your BrowserStack username"
@@ -62,11 +62,12 @@ Once your access key is encrypted you can add the secure string as,
62
62
63
63
### Local Identifier
64
64
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 ] :
70
71
71
72
require 'rubygems'
72
73
require 'selenium-webdriver'
@@ -82,14 +83,16 @@ Selenium capabilities as, using Ruby's [selenium-webdriver][browserstack-ruby-bi
82
83
:url => "http://USERNAME:[email protected] /wd/hub",
83
84
:desired_capabilities => caps)
84
85
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
88
91
89
92
### Folder Testing
90
93
91
94
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:
93
96
94
97
addons:
95
98
browserstack: "Your BrowserStack username"
@@ -100,35 +103,34 @@ name of the local folders as,
100
103
You can then access the HTML files via the url
101
104
` http://$BROWSERSTACK_USERNAME.browserstack.com/"Path to your HTML file with respect to the folder set." `
102
105
106
+ ### Proxy
103
107
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:
111
110
112
111
addons:
113
112
browserstack: "Your BrowserStack username"
114
113
access_key:
115
114
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"
118
119
119
- The format for the only flag is, `"Host pattern,Host Port,Flag for SSL True(1)/False(0)" and repeat.
120
120
121
- ### Proxy Options
121
+ ### More Options
122
122
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,
125
128
126
129
addons:
127
130
browserstack: "Your BrowserStack username"
128
131
access_key:
129
132
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
134
135
136
+ The format for the ** only** flag is, `"Host pattern,Host Port,Flag for SSL True(1)/False(0)" and repeat.
0 commit comments