|
1 | | -# Deprecation Note |
2 | | - |
3 | | -> The changes done as a part of this fork have now been merged into [@wdio/browserstack-service](https://www.npmjs.com/package/@wdio/browserstack-service), so we will be deprecating this package. Please install the service using: |
4 | | -
|
5 | | -```sh |
6 | | -npm install @wdio/browserstack-service --save-dev |
7 | | -``` |
8 | | - |
9 | | ---- |
10 | | - |
11 | | -<s># WebdriverIO Browserstack Service |
12 | | - |
13 | | -> The official BrowserStack WebdriverIO service that integrates your WebdriverIO test suite with BrowserStack. |
14 | | -
|
15 | | -## Installation |
16 | | - |
17 | | -You can simply do it by: |
18 | | - |
19 | | -```sh |
20 | | -npm install @browserstack/wdio-browserstack-service --save-dev |
21 | | -``` |
22 | | - |
23 | | -Instructions on how to install `WebdriverIO` can be found [here.](https://webdriver.io/docs/gettingstarted) |
24 | | - |
25 | | -## Configuration |
26 | | - |
27 | | -WebdriverIO has Browserstack support out of the box. You should simply set `user` and `key` in your `wdio.conf.js` file. This service plugin provides supports for [Browserstack Tunnel](https://www.browserstack.com/automate/node#setting-local-tunnel). Set `browserstackLocal: true` also to activate this feature. |
28 | | -Reporting of session status on BrowserStack will respect `strict` setting of Cucumber options. |
29 | | - |
30 | | -```js |
31 | | -// wdio.conf.js |
32 | | -export.config = { |
33 | | - // ... |
34 | | - user: process.env.BROWSERSTACK_USERNAME, |
35 | | - key: process.env.BROWSERSTACK_ACCESS_KEY, |
36 | | - services: [ |
37 | | - ['@browserstack/wdio-browserstack-service', { |
38 | | - browserstackLocal: true |
39 | | - }] |
40 | | - ], |
41 | | - // ... |
42 | | -}; |
43 | | -``` |
44 | | - |
45 | | -## Options |
46 | | - |
47 | | -In order to authorize to the BrowserStack service your config needs to contain a [`user`](https://webdriver.io/docs/options#user) and [`key`](https://webdriver.io/docs/options#key) option. |
48 | | - |
49 | | -### browserstackLocal |
50 | | - |
51 | | -Set this to true to enable routing connections from Browserstack cloud through your computer. |
52 | | - |
53 | | -Type: `Boolean`<br /> |
54 | | -Default: `false` |
55 | | - |
56 | | -### preferScenarioName |
57 | | - |
58 | | -Cucumber only. Set this to true to enable updating the session name to the Scenario name if only a single Scenario was ran. Useful when running in parallel with [wdio-cucumber-parallel-execution](https://github.com/SimitTomar/wdio-cucumber-parallel-execution). |
59 | | - |
60 | | -Type: `Boolean`<br /> |
61 | | -Default: `false` |
62 | | - |
63 | | -### opts |
64 | | - |
65 | | -Specified optional will be passed down to BrowserstackLocal. |
66 | | - |
67 | | -Type: `Object`<br /> |
68 | | -Default: `{}` |
69 | | - |
70 | | -List of available local testing modifiers to be passed as opts: |
71 | | - |
72 | | -#### Local Identifier |
73 | | - |
74 | | -If doing simultaneous multiple local testing connections, set this uniquely for different processes - |
75 | | - |
76 | | -```js |
77 | | -opts = { localIdentifier: 'randomstring' }; |
78 | | -``` |
79 | | - |
80 | | -#### Verbose Logging |
81 | | - |
82 | | -To enable verbose logging - |
83 | | - |
84 | | -```js |
85 | | -opts = { verbose: 'true' }; |
86 | | -``` |
87 | | - |
88 | | -Note - Possible values for 'verbose' modifier are '1', '2', '3' and 'true' |
89 | | - |
90 | | -#### Force Local |
91 | | - |
92 | | -To route all traffic via local(your) machine - |
93 | | - |
94 | | -```js |
95 | | -opts = { forceLocal: 'true' }; |
96 | | -``` |
97 | | - |
98 | | -#### Folder Testing |
99 | | - |
100 | | -To test local folder rather internal server, provide path to folder as value of this option - |
101 | | - |
102 | | -```js |
103 | | -opts = { f: '/my/awesome/folder' }; |
104 | | -``` |
105 | | - |
106 | | -#### Force Start |
107 | | - |
108 | | -To kill other running Browserstack Local instances - |
109 | | - |
110 | | -```js |
111 | | -opts = { force: 'true' }; |
112 | | -``` |
113 | | - |
114 | | -#### Only Automate |
115 | | - |
116 | | -To disable local testing for Live and Screenshots, and enable only Automate - |
117 | | - |
118 | | -```js |
119 | | -opts = { onlyAutomate: 'true' }; |
120 | | -``` |
121 | | - |
122 | | -#### Proxy |
123 | | - |
124 | | -To use a proxy for local testing - |
125 | | - |
126 | | -- proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent |
127 | | -- proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used |
128 | | -- proxyUser: Username for connecting to proxy (Basic Auth Only) |
129 | | -- proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified |
130 | | - |
131 | | -```js |
132 | | -opts = { |
133 | | - proxyHost: '127.0.0.1', |
134 | | - proxyPort: '8000', |
135 | | - proxyUser: 'user', |
136 | | - proxyPass: 'password', |
137 | | -}; |
138 | | -``` |
139 | | - |
140 | | -#### Local Proxy |
141 | | - |
142 | | -To use local proxy in local testing - |
143 | | - |
144 | | -- localProxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent |
145 | | -- localProxyPort: Port for the proxy, defaults to 8081 when -localProxyHost is used |
146 | | -- localProxyUser: Username for connecting to proxy (Basic Auth Only) |
147 | | -- localProxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified |
148 | | - |
149 | | -```js |
150 | | -opts = { |
151 | | - localProxyHost: '127.0.0.1', |
152 | | - localProxyPort: '8000', |
153 | | - localProxyUser: 'user', |
154 | | - localProxyPass: 'password', |
155 | | -}; |
156 | | -``` |
157 | | - |
158 | | -#### PAC (Proxy Auto-Configuration) |
159 | | - |
160 | | -To use PAC (Proxy Auto-Configuration) in local testing - |
161 | | - |
162 | | -- pac-file: PAC (Proxy Auto-Configuration) file’s absolute path |
163 | | - |
164 | | -```js |
165 | | -opts = { 'pac-file': '<pac_file_abs_path>' }; |
166 | | -``` |
167 | | - |
168 | | -#### Binary Path |
169 | | - |
170 | | -By default, BrowserStack local wrappers try downloading and executing the latest version of BrowserStack binary in ~/.browserstack or the present working directory or the tmp folder by order. But you can override these by passing the -binarypath argument. |
171 | | -Path to specify local Binary path - |
172 | | - |
173 | | -```js |
174 | | -opts = { binarypath: '/path/to/binary' }; |
175 | | -``` |
176 | | - |
177 | | -#### Logfile |
178 | | - |
179 | | -To save the logs to the file while running with the '-v' argument, you can specify the path of the file. By default the logs are saved in the local.log file in the present woring directory. |
180 | | -To specify the path to file where the logs will be saved - |
181 | | - |
182 | | -```js |
183 | | -opts = { verbose: 'true', logFile: './local.log' }; |
184 | | -``` |
185 | | - |
186 | | ---- |
187 | | - |
188 | | -For more information on WebdriverIO see the [homepage](https://webdriver.io). </s> |
| 1 | +Source code for the @browserstack/wdio-browserstack-service npm module |
0 commit comments