Skip to content

Commit 490e923

Browse files
Ankit098francisf
authored andcommitted
chore: update local testing modifier opts in readme
1 parent 9bd50bc commit 490e923

File tree

1 file changed

+67
-36
lines changed

1 file changed

+67
-36
lines changed

README.md

Lines changed: 67 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
WebdriverIO Browserstack Service
2-
==========
1+
# WebdriverIO Browserstack Service
32

43
> The official BrowserStack WebdriverIO service that integrates your WebdriverIO test suite with BrowserStack.
54
65
## Installation
76

8-
97
You can simply do it by:
108

119
```sh
@@ -14,7 +12,6 @@ npm install @browserstack/wdio-browserstack-service --save-dev
1412

1513
Instructions on how to install `WebdriverIO` can be found [here.](https://webdriver.io/docs/gettingstarted)
1614

17-
1815
## Configuration
1916

2017
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.
@@ -40,108 +37,142 @@ export.config = {
4037
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.
4138

4239
### browserstackLocal
43-
Set this to true to enable routing connections from Browserstack cloud through your computer.
40+
41+
Set this to true to enable routing connections from Browserstack cloud through your computer.
4442

4543
Type: `Boolean`<br />
4644
Default: `false`
4745

4846
### preferScenarioName
47+
4948
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).
5049

5150
Type: `Boolean`<br />
5251
Default: `false`
5352

5453
### opts
55-
Specified optional will be passed down to BrowserstackLocal.
54+
55+
Specified optional will be passed down to BrowserstackLocal.
5656

5757
Type: `Object`<br />
5858
Default: `{}`
5959

6060
List of available local testing modifiers to be passed as opts:
61+
6162
#### Local Identifier
63+
6264
If doing simultaneous multiple local testing connections, set this uniquely for different processes -
65+
6366
```js
64-
opts = { 'localIdentifier': 'randomstring' }
67+
opts = { localIdentifier: "randomstring" };
6568
```
69+
6670
#### Verbose Logging
71+
6772
To enable verbose logging -
73+
6874
```js
69-
opts = { 'verbose': 'true' }
75+
opts = { verbose: "true" };
7076
```
77+
7178
Note - Possible values for 'verbose' modifier are '1', '2', '3' and 'true'
7279

80+
#### Force Local
81+
82+
To route all traffic via local(your) machine -
83+
84+
```js
85+
opts = { forceLocal: "true" };
86+
```
87+
7388
#### Folder Testing
89+
7490
To test local folder rather internal server, provide path to folder as value of this option -
91+
7592
```js
76-
opts = { 'f': '/my/awesome/folder' }
93+
opts = { f: "/my/awesome/folder" };
7794
```
7895

7996
#### Force Start
97+
8098
To kill other running Browserstack Local instances -
99+
81100
```js
82-
opts = { 'force': 'true' }
101+
opts = { force: "true" };
83102
```
84103

85104
#### Only Automate
105+
86106
To disable local testing for Live and Screenshots, and enable only Automate -
87-
```js
88-
opts = { 'onlyAutomate': 'true' }
89-
```
90107

91-
#### Force Local
92-
To route all traffic via local(your) machine -
93108
```js
94-
opts = { 'forceLocal': 'true' }
109+
opts = { onlyAutomate: "true" };
95110
```
96111

97112
#### Proxy
113+
98114
To use a proxy for local testing -
99115

100-
* proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
101-
* proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used
102-
* proxyUser: Username for connecting to proxy (Basic Auth Only)
103-
* proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
116+
- proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
117+
- proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used
118+
- proxyUser: Username for connecting to proxy (Basic Auth Only)
119+
- proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
104120

105121
```js
106-
opts = { 'proxyHost': '127.0.0.1', 'proxyPort': '8000', 'proxyUser': 'user', 'proxyPass': 'password' }
122+
opts = {
123+
proxyHost: "127.0.0.1",
124+
proxyPort: "8000",
125+
proxyUser: "user",
126+
proxyPass: "password",
127+
};
107128
```
108129

109130
#### Local Proxy
131+
110132
To use local proxy in local testing -
111133

112-
* localProxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
113-
* localProxyPort: Port for the proxy, defaults to 8081 when -localProxyHost is used
114-
* localProxyUser: Username for connecting to proxy (Basic Auth Only)
115-
* localProxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
134+
- localProxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
135+
- localProxyPort: Port for the proxy, defaults to 8081 when -localProxyHost is used
136+
- localProxyUser: Username for connecting to proxy (Basic Auth Only)
137+
- localProxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
116138

117139
```js
118-
opts = { 'localProxyHost': '127.0.0.1', 'localProxyPort': '8000', 'localProxyUser': 'user', 'localProxyPass': 'password' }
140+
opts = {
141+
localProxyHost: "127.0.0.1",
142+
localProxyPort: "8000",
143+
localProxyUser: "user",
144+
localProxyPass: "password",
145+
};
119146
```
120147

121148
#### PAC (Proxy Auto-Configuration)
149+
122150
To use PAC (Proxy Auto-Configuration) in local testing -
123151

124-
* pac-file: PAC (Proxy Auto-Configuration) file’s absolute path
152+
- pac-file: PAC (Proxy Auto-Configuration) file’s absolute path
125153

126154
```js
127-
opts = { 'pac-file': '<pac_file_abs_path>' }
155+
opts = { "pac-file": "<pac_file_abs_path>" };
128156
```
129157

130158
#### Binary Path
131-
132-
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.
133-
Path to specify local Binary path -
134-
```js
135-
opts = { 'binarypath': '/browserstack/BrowserStackLocal' }
136-
```
159+
160+
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.
161+
Path to specify local Binary path -
162+
163+
```js
164+
opts = { binarypath: "/path/to/binary" };
165+
```
137166

138167
#### Logfile
168+
139169
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.
140170
To specify the path to file where the logs will be saved -
171+
141172
```js
142-
opts = { 'verbose': 'true', 'logFile': '/browserstack/logs.txt' }
173+
opts = { verbose: "true", logFile: "./local.log" };
143174
```
144175

145-
----
176+
---
146177

147178
For more information on WebdriverIO see the [homepage](https://webdriver.io).

0 commit comments

Comments
 (0)