From 0b5e4f267fa242ce40a5c06f15119952b8eba43e Mon Sep 17 00:00:00 2001 From: Nidhi Makhijani Date: Fri, 22 Apr 2016 12:07:12 +0530 Subject: [PATCH 1/5] Update README.md --- README.md | 132 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 102 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index c86815b..87c8e3a 100644 --- a/README.md +++ b/README.md @@ -2,49 +2,121 @@ [![Build Status](https://travis-ci.org/browserstack/browserstack-local-nodejs.svg?branch=master)](https://travis-ci.org/browserstack/browserstack-local-nodejs) -## Setup +A simple Ruby wrapper for BrowserStack Local Binary. +## Installation: + +``` +gem install browserstack-local +``` + +## Example: + +``` +require 'browserstack-local' + +#creates an instance of Local +bs_local = BrowserStack::Local.new + +#replace with your key. +# you may not add it if you have 'BROWSERSTACK_ACCESS_KEY' in your environment variables. +bs_local_args = { "key" => "" } + +#starts the Local instance with the required arguments +bs_local.start(bs_local_args) + +#check if BrowserStack local instance is running +bs_local.isRunning + +#stop the Local instance +bs_local.stop + +``` + +## Additional Arguments + +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 - + +#### Verbose Logging +To enable verbose logging - +``` +bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "v" => "true"} +``` + +#### Folder Testing +To test local folder rather internal server, provide path to folder as value of this option - +``` +bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "f" => "/my/awesome/folder"} ``` -npm install browserstack + +#### Force Start +To kill other running Browserstack Local instances - +``` +bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "force" => "true"} +``` + +#### Only Automate +To disable local testing for Live and Screenshots, and enable only Automate - +``` +bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "onlyAutomate" => "true"} +``` + +#### Force Local +To route all traffic via local(your) machine - +``` +bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "forcelocal" => "true"} +``` + +### Proxy +To use a proxy for local testing - + +* proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent +* proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used +* proxyUser: Username for connecting to proxy (Basic Auth Only) +* proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified + +``` +bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY", "proxyHost" => "127.0.0.1", "proxyPort" => "8000", "proxyUser" => "user", "proxyPass" => "password"} +``` + +### Local Identifier +If doing simultaneous multiple local testing connections, set this uniquely for different processes - +``` +bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "localIdentifier" => "randomstring"} ``` -## API +### Binary Path +Path to specify local Binary path - +``` +bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "binarypath" => "/browserstack/BrowserStackLocal"} +``` -### Constructor +### Logfile +To specify the path to file where the logs will be saved - +``` +bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "logfile" => "/browserstack/logs.txt"} +``` -* `new browserstack.Local()`: creates an instance of Local +## Contribute -### Methods +### Build Instructions -* `start(options, callback)`: starts Local instance with options. The options available are detailed below. -* `stop(callback)`: stops the Local instance -* `isRunning()`: checks if Local instance is running and returns a corresponding boolean value +To build gem, `rake build`. -The first and only argument to any callback function will be an error object. +To run the test suite run, `rake test`. -### Options +### Reporting bugs -* `key`: BrowserStack Access Key -* `v`: Provides verbose logging -* `f`: If you want to test local folder rather internal server, provide path to folder as value of this option -* `force`: Kill other running Browserstack Local -* `only`: Restricts Local Testing access to specified local servers and/or folders -* `forcelocal`: Route all traffic via local machine -* `onlyAutomate`: Disable Live Testing and Screenshots, just test Automate -* `proxyHost`: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent -* `proxyPort`: Port for the proxy, defaults to 3128 when -proxyHost is used -* `proxyUser`: Username for connecting to proxy (Basic Auth Only) -* `proxyPass`: Password for USERNAME, will be ignored if USERNAME is empty or not specified -* `localIdentifier`: If doing simultaneous multiple local testing connections, set this uniquely for different processes -* `hosts`: List of hosts and ports where Local must be enabled for eg. localhost,3000,1,localhost,3001,0 -* `logfile`: Path to file where Local logs be saved to -* `binarypath`: Optional path to Local binary +You can submit bug reports either in the Github issue tracker. +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. -## Tests +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. -To run the test suite run - `npm test`. +### Pull Requests -## Example +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. -To run the example run - `node node-example.js`. +* Adhere to the coding conventions you see in the surrounding code. +* Include tests, and make sure all tests pass. +* 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. From fae190182ad4ee109db9c1a350dd0b2528950769 Mon Sep 17 00:00:00 2001 From: Vibhaj Rajan Date: Sun, 1 May 2016 14:52:46 +0530 Subject: [PATCH 2/5] changed title --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 896d3c2..885390d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/browserstack/browserstack-local-nodejs.svg?branch=master)](https://travis-ci.org/browserstack/browserstack-local-nodejs) -A simple Nodejs wrapper for BrowserStack Local Binary. +Ruby bindings for BrowserStack Local ## Installation From 641473cac6235bc0fda345b705088a22e5c18850 Mon Sep 17 00:00:00 2001 From: Vibhaj Rajan Date: Sun, 1 May 2016 14:54:18 +0530 Subject: [PATCH 3/5] updated title --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ac5a415..a3a69df 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/browserstack/browserstack-local-nodejs.svg?branch=master)](https://travis-ci.org/browserstack/browserstack-local-nodejs) -Ruby bindings for BrowserStack Local +Nodejs bindings for BrowserStack Local ## Installation: From 864f4619630623f14eec329c4bf5bdfe89c26ecb Mon Sep 17 00:00:00 2001 From: Vibhaj Rajan Date: Sun, 1 May 2016 15:09:36 +0530 Subject: [PATCH 4/5] updated package.json and added LICENSE --- MIT-LICENSE.txt | 22 ++++++++++++++++++++++ package.json | 7 +++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 MIT-LICENSE.txt diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt new file mode 100644 index 0000000..e070d10 --- /dev/null +++ b/MIT-LICENSE.txt @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2016 BrowserStack + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/package.json b/package.json index 8dc9ee0..a087691 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { - "name": "browserstack", + "name": "browserstack-local", "version": "0.1.0", - "description": "Node client to run selenium tests on BrowserStack", + "description": "Nodejs bindings for BrowserStack Local", + "engine": "^0.10.44", "main": "index.js", "scripts": { "pretest": "./node_modules/.bin/eslint lib/* index.js", @@ -9,6 +10,7 @@ }, "keywords": [ "BrowserStack", + "Local", "selenium", "testing" ], @@ -24,3 +26,4 @@ "mocks": "0.0.15" } } + From e393a51a7434ec415ab3c3b4094d7c71e0bee780 Mon Sep 17 00:00:00 2001 From: Vibhaj Rajan Date: Sun, 1 May 2016 15:13:53 +0530 Subject: [PATCH 5/5] make readme proper --- README.md | 119 +----------------------------------------------------- 1 file changed, 2 insertions(+), 117 deletions(-) diff --git a/README.md b/README.md index a3a69df..f48f6a6 100644 --- a/README.md +++ b/README.md @@ -2,53 +2,11 @@ [![Build Status](https://travis-ci.org/browserstack/browserstack-local-nodejs.svg?branch=master)](https://travis-ci.org/browserstack/browserstack-local-nodejs) -Nodejs bindings for BrowserStack Local +Nodejs bindings for BrowserStack Local. -## Installation: +## Installation ``` -gem install browserstack-local -``` - -## Example: - -``` -require 'browserstack-local' - -#creates an instance of Local -bs_local = BrowserStack::Local.new - -#replace with your key. -# you may not add it if you have 'BROWSERSTACK_ACCESS_KEY' in your environment variables. -bs_local_args = { "key" => "" } - -#starts the Local instance with the required arguments -bs_local.start(bs_local_args) - -#check if BrowserStack local instance is running -bs_local.isRunning - -#stop the Local instance -bs_local.stop - -``` - -## Additional Arguments - -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 - - -#### Verbose Logging -To enable verbose logging - -``` -bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "v" => "true"} -``` - -#### Folder Testing -To test local folder rather internal server, provide path to folder as value of this option - -``` -bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "f" => "/my/awesome/folder"} -``` -<<<<<<< HEAD npm install browserstack-local ``` @@ -168,77 +126,4 @@ We love pull requests! We are very happy to work with you to get your changes me * Adhere to the coding conventions you see in the surrounding code. * Include tests, and make sure all tests pass. * 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. -======= - -#### Force Start -To kill other running Browserstack Local instances - -``` -bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "force" => "true"} -``` - -#### Only Automate -To disable local testing for Live and Screenshots, and enable only Automate - -``` -bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "onlyAutomate" => "true"} -``` - -#### Force Local -To route all traffic via local(your) machine - -``` -bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "forcelocal" => "true"} -``` - -### Proxy -To use a proxy for local testing - - -* proxyHost: Hostname/IP of proxy, remaining proxy options are ignored if this option is absent -* proxyPort: Port for the proxy, defaults to 3128 when -proxyHost is used -* proxyUser: Username for connecting to proxy (Basic Auth Only) -* proxyPass: Password for USERNAME, will be ignored if USERNAME is empty or not specified - -``` -bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY", "proxyHost" => "127.0.0.1", "proxyPort" => "8000", "proxyUser" => "user", "proxyPass" => "password"} -``` - -### Local Identifier -If doing simultaneous multiple local testing connections, set this uniquely for different processes - -``` -bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "localIdentifier" => "randomstring"} -``` - -### Binary Path -Path to specify local Binary path - -``` -bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "binarypath" => "/browserstack/BrowserStackLocal"} -``` -### Logfile -To specify the path to file where the logs will be saved - -``` -bs_local_args = { "key" => "BROWSERSTACK_ACCESS_KEY" , "logfile" => "/browserstack/logs.txt"} -``` - -## Contribute - -### Build Instructions - -To build gem, `rake build`. - -To run the test suite run, `rake test`. - -### Reporting bugs - -You can submit bug reports either in the Github issue tracker. - -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. - -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. - -### Pull Requests - -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. - -* Adhere to the coding conventions you see in the surrounding code. -* Include tests, and make sure all tests pass. -* 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. ->>>>>>> 0b5e4f267fa242ce40a5c06f15119952b8eba43e