@@ -12,24 +12,24 @@ npm install browserstack-local
12
12
13
13
## Example
14
14
15
- ```
15
+ ``` node
16
16
var browserstack = require (' browserstack-local' );
17
17
18
- # creates an instance of Local
18
+ // creates an instance of Local
19
19
var bs_local = new browserstack.Local ();
20
20
21
- # replace <browserstack-accesskey> with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY".
21
+ // replace <browserstack-accesskey> with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY".
22
22
var bs_local_args = { ' key' : ' <browserstack-accesskey>' };
23
23
24
- # starts the Local instance with the required arguments
24
+ // starts the Local instance with the required arguments
25
25
bs_local .start (bs_local_args, function () {
26
26
console .log (" Started BrowserStackLocal" );
27
27
});
28
28
29
- # check if BrowserStack local instance is running
29
+ // check if BrowserStack local instance is running
30
30
console .log (bs_local .isRunning ());
31
31
32
- # stop the Local instance
32
+ // stop the Local instance
33
33
bs_local .stop (function () {
34
34
console .log (" Stopped BrowserStackLocal" );
35
35
});
@@ -42,31 +42,31 @@ Apart from the key, all other BrowserStack Local modifiers are optional. For the
42
42
43
43
#### Verbose Logging
44
44
To enable verbose logging -
45
- ```
45
+ ``` node
46
46
bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' v' : ' true' }
47
47
```
48
48
49
49
#### Folder Testing
50
50
To test local folder rather internal server, provide path to folder as value of this option -
51
- ```
51
+ ``` node
52
52
bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' f' : ' /my/awesome/folder' }
53
53
```
54
54
55
55
#### Force Start
56
56
To kill other running Browserstack Local instances -
57
- ```
57
+ ``` node
58
58
bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' force' : ' true' }
59
59
```
60
60
61
61
#### Only Automate
62
62
To disable local testing for Live and Screenshots, and enable only Automate -
63
- ```
63
+ ``` node
64
64
bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' onlyAutomate' : ' true' }
65
65
```
66
66
67
67
#### Force Local
68
68
To route all traffic via local(your) machine -
69
- ```
69
+ ``` node
70
70
bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' forcelocal' : ' true' }
71
71
```
72
72
@@ -78,13 +78,13 @@ To use a proxy for local testing -
78
78
* proxyUser: Username for connecting to proxy (Basic Auth Only)
79
79
* proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
80
80
81
- ```
81
+ ``` node
82
82
bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' proxyHost' : ' 127.0.0.1' , ' proxyPort' : ' 8000' , ' proxyUser' : ' user' , ' proxyPass' : ' password' }
83
83
```
84
84
85
85
#### Local Identifier
86
86
If doing simultaneous multiple local testing connections, set this uniquely for different processes -
87
- ```
87
+ ``` node
88
88
bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' localIdentifier' : ' randomstring' }
89
89
```
90
90
@@ -94,14 +94,14 @@ bs_local_args = { 'key': '<browserstack-accesskey>', 'localIdentifier': 'randoms
94
94
95
95
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.
96
96
Path to specify local Binary path -
97
- ```
97
+ ``` node
98
98
bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' binarypath' : ' /browserstack/BrowserStackLocal' }
99
99
```
100
100
101
101
#### Logfile
102
102
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.
103
103
To specify the path to file where the logs will be saved -
104
- ```
104
+ ``` node
105
105
bs_local_args = { ' key' : ' <browserstack-accesskey>' , ' v' : ' true' , ' logfile' : ' /browserstack/logs.txt' }
106
106
```
107
107
0 commit comments