Skip to content

Commit 35ffdce

Browse files
committed
Merge branch 'readme' of github.com:browserstack/browserstack-local-nodejs into readme
Conflicts: README.md
2 parents fae1901 + 0b5e4f2 commit 35ffdce

File tree

1 file changed

+117
-1
lines changed

1 file changed

+117
-1
lines changed

README.md

+117-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,51 @@
44

55
Ruby bindings for BrowserStack Local
66

7-
## Installation
7+
## Installation:
88

99
```
10+
gem install browserstack-local
11+
```
12+
13+
## Example:
14+
15+
```
16+
require 'browserstack-local'
17+
18+
#creates an instance of Local
19+
bs_local = BrowserStack::Local.new
20+
21+
#replace <browserstack-accesskey> with your key.
22+
# you may not add it if you have 'BROWSERSTACK_ACCESS_KEY' in your environment variables.
23+
bs_local_args = { "key" => "<browserstack-accesskey>" }
24+
25+
#starts the Local instance with the required arguments
26+
bs_local.start(bs_local_args)
27+
28+
#check if BrowserStack local instance is running
29+
bs_local.isRunning
30+
31+
#stop the Local instance
32+
bs_local.stop
33+
34+
```
35+
36+
## Additional Arguments
37+
38+
Apart from the key all other arguments are optional. For the full list of arguments, refer [BrowserStack Local modifiers](https://www.browserstack.com/local-testing#modifiers). To specify these arguments add them to the input hash for the BrowserStack::Local without the hyphen. For examples, refer below -
39+
40+
#### Verbose Logging
41+
To enable verbose logging -
42+
```
43+
bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "v" => "true"}
44+
```
45+
46+
#### Folder Testing
47+
To test local folder rather internal server, provide path to folder as value of this option -
48+
```
49+
bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "f" => "/my/awesome/folder"}
50+
```
51+
<<<<<<< HEAD
1052
npm install browserstack-local
1153
```
1254
@@ -126,3 +168,77 @@ We love pull requests! We are very happy to work with you to get your changes me
126168
* Adhere to the coding conventions you see in the surrounding code.
127169
* Include tests, and make sure all tests pass.
128170
* Before submitting a pull-request, clean up the git history by going over your commits and squashing together minor changes and fixes into the corresponding commits. You can do this using the interactive rebase command.
171+
=======
172+
173+
#### Force Start
174+
To kill other running Browserstack Local instances -
175+
```
176+
bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "force" => "true"}
177+
```
178+
179+
#### Only Automate
180+
To disable local testing for Live and Screenshots, and enable only Automate -
181+
```
182+
bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "onlyAutomate" => "true"}
183+
```
184+
185+
#### Force Local
186+
To route all traffic via local(your) machine -
187+
```
188+
bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "forcelocal" => "true"}
189+
```
190+
191+
### Proxy
192+
To use a proxy for local testing -
193+
194+
* proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent
195+
* proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used
196+
* proxyUser: Username for connecting to proxy (Basic Auth Only)
197+
* proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified
198+
199+
```
200+
bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY", "proxyHost" => "127.0.0.1", "proxyPort" => "8000", "proxyUser" => "user", "proxyPass" => "password"}
201+
```
202+
203+
### Local Identifier
204+
If doing simultaneous multiple local testing connections, set this uniquely for different processes -
205+
```
206+
bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "localIdentifier" => "randomstring"}
207+
```
208+
209+
### Binary Path
210+
Path to specify local Binary path -
211+
```
212+
bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "binarypath" => "/browserstack/BrowserStackLocal"}
213+
```
214+
215+
### Logfile
216+
To specify the path to file where the logs will be saved -
217+
```
218+
bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "logfile" => "/browserstack/logs.txt"}
219+
```
220+
221+
## Contribute
222+
223+
### Build Instructions
224+
225+
To build gem, `rake build`.
226+
227+
To run the test suite run, `rake test`.
228+
229+
### Reporting bugs
230+
231+
You can submit bug reports either in the Github issue tracker.
232+
233+
Before submitting an issue please check if there is already an existing issue. If there is, please add any additional information give it a "+1" in the comments.
234+
235+
When submitting an issue please describe the issue clearly, including how to reproduce the bug, which situations it appears in, what you expect to happen, what actually happens, and what platform (operating system and version) you are using.
236+
237+
### Pull Requests
238+
239+
We love pull requests! We are very happy to work with you to get your changes merged in, however please keep the following in mind.
240+
241+
* Adhere to the coding conventions you see in the surrounding code.
242+
* Include tests, and make sure all tests pass.
243+
* Before submitting a pull-request, clean up the history by going over your commits and squashing together minor changes and fixes into the corresponding commits. You can do this using the interactive rebase command.
244+
>>>>>>> 0b5e4f267fa242ce40a5c06f15119952b8eba43e

0 commit comments

Comments
 (0)