From 6e2ef8b20d8b46d0ececb9d3730e0da687f692c1 Mon Sep 17 00:00:00 2001 From: Blackbaud-PatrickOFriel Date: Wed, 16 Nov 2016 14:28:42 -0500 Subject: [PATCH 1/7] update browserstack local with new commands --- README.md | 13 +++------- lib/Local.js | 64 ++++++++++++++++++++++++++--------------------- node-example.js | 2 +- test/local.js | 66 ++++++++++++++++++++++++++++++++++++------------- 4 files changed, 89 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 38f16e1..fde7e7b 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Apart from the key, all other BrowserStack Local modifiers are optional. For the #### Verbose Logging To enable verbose logging - ```node -bs_local_args = { 'key': '', 'v': 'true' } +bs_local_args = { 'key': '', 'verbose': 'true' } ``` #### Folder Testing @@ -67,7 +67,7 @@ bs_local_args = { 'key': '', 'onlyAutomate': 'true' } #### Force Local To route all traffic via local(your) machine - ```node -bs_local_args = { 'key': '', 'forcelocal': 'true' } +bs_local_args = { 'key': '', 'forceLocal': 'true' } ``` #### Proxy @@ -90,19 +90,12 @@ bs_local_args = { 'key': '', 'localIdentifier': 'randoms ## Additional Arguments -#### Binary Path - -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. -Path to specify local Binary path - -```node -bs_local_args = { 'key': '', 'binarypath': '/browserstack/BrowserStackLocal' } -``` #### Logfile 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. To specify the path to file where the logs will be saved - ```node -bs_local_args = { 'key': '', 'v': 'true', 'logfile': '/browserstack/logs.txt' } +bs_local_args = { 'key': '', 'verbose': 'true', 'logFile': '/browserstack/logs.txt' } ``` ## Contribute diff --git a/lib/Local.js b/lib/Local.js index ce12b0f..3610bde 100644 --- a/lib/Local.js +++ b/lib/Local.js @@ -121,29 +121,33 @@ function Local(){ this.key = value; break; - case 'v': - if(value) - this.verboseFlag = '-vvv'; + case 'verbose': + if(value.toString() !== 'true') + this.verboseFlag = value; + else { + this.verboseFlag = 1; + } break; case 'force': if(value) - this.forceFlag = '-force'; + this.forceFlag = '--force'; break; case 'only': if(value) - this.onlyFlag = '-only'; + this.onlyHosts = value; break; case 'onlyAutomate': if(value) - this.onlyAutomateFlag = '-onlyAutomate'; + this.onlyAutomateFlag = '--only-automate'; break; case 'forcelocal': + case 'forceLocal': if(value) - this.forceLocalFlag = '-forcelocal'; + this.forceLocalFlag = '--force-local'; break; case 'localIdentifier': @@ -152,6 +156,7 @@ function Local(){ break; case 'f': + case 'folder': if(value){ this.folderFlag = '-f'; this.folderPath = value; @@ -179,30 +184,27 @@ function Local(){ break; case 'forceproxy': + case 'forceProxy': if(value) - this.forceProxyFlag = '-forceproxy'; - break; - - case 'hosts': - if(value) - this.hosts = value; + this.forceProxyFlag = '--force-proxy'; break; case 'logfile': + case 'logFile': if(value) this.logfile = value; break; - case 'binarypath': + case 'parallelRuns': if(value) - this.binaryPath = value; + this.parallelRunsFlag = value; break; default: if(value.toString().toLowerCase() == 'true'){ - this.userArgs.push('-' + key); + this.userArgs.push('--' + key); } else { - this.userArgs.push('-' + key); + this.userArgs.push('--' + key); this.userArgs.push(value); } break; @@ -226,36 +228,44 @@ function Local(){ }; this.getBinaryArgs = function(){ - var args = ['-d', this.opcode, '-logFile', this.logfile]; + var args = ['--daemon', this.opcode, '--log-file', this.logfile]; if(this.folderFlag) args.push(this.folderFlag); - args.push(this.key); + if(this.key) { + args.push('--key'); + args.push(this.key); + } if(this.folderPath) args.push(this.folderPath); if(this.forceLocalFlag) args.push(this.forceLocalFlag); if(this.localIdentifierFlag){ - args.push('-localIdentifier'); + args.push('--local-identifier'); args.push(this.localIdentifierFlag); } - if(this.onlyFlag) - args.push(this.onlyFlag); + if(this.parallelRunsFlag){ + args.push('--parallel-runs'); + args.push(this.parallelRunsFlag); + } + if(this.onlyHosts) + args.push('--only'); + args.push(this.onlyHosts); if(this.onlyAutomateFlag) args.push(this.onlyAutomateFlag); if(this.proxyHost){ - args.push('-proxyHost'); + args.push('--proxy-host'); args.push(this.proxyHost); } if(this.proxyPort){ - args.push('-proxyPort'); + args.push('--proxy-port'); args.push(this.proxyPort); } if(this.proxyUser){ - args.push('-proxyUser'); + args.push('--proxy-user'); args.push(this.proxyUser); } if(this.proxyPass){ - args.push('-proxyPass'); + args.push('--proxy-pass'); args.push(this.proxyPass); } if(this.forceProxyFlag) @@ -264,8 +274,6 @@ function Local(){ args.push(this.forceFlag); if(this.verboseFlag) args.push(this.verboseFlag); - if(this.hosts) - args.push(this.hosts); for(var i in this.userArgs){ args.push(this.userArgs[i]); } diff --git a/node-example.js b/node-example.js index 511959c..af07f00 100644 --- a/node-example.js +++ b/node-example.js @@ -13,7 +13,7 @@ var capabilities = { } var options = { - '-key': process.env.BROWSERSTACK_ACCESS_KEY, + 'key': process.env.BROWSERSTACK_ACCESS_KEY, //hosts: [{ // name: 'localhost', // port: 8080, diff --git a/test/local.js b/test/local.js index 02a5e6a..96d3135 100644 --- a/test/local.js +++ b/test/local.js @@ -50,8 +50,17 @@ describe('Local', function () { }); it('should enable verbose', function (done) { - bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'v': true }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-vvv')).to.not.equal(-1); + bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'verbose': true }, function(){ + expect(bsLocal.getBinaryArgs().indexOf('--verbose')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('1')).to.not.equal(-1); + done(); + }); + }); + + it('should enable verbose with log level', function (done) { + bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'verbose': 2 }, function(){ + expect(bsLocal.getBinaryArgs().indexOf('--verbose')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('2')).to.not.equal(-1); done(); }); }); @@ -64,47 +73,62 @@ describe('Local', function () { }); }); + it('should set folder testing with folder option', function (done) { + bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'folder': '/var/html' }, function(){ + expect(bsLocal.getBinaryArgs().indexOf('-f')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('/var/html')).to.not.equal(-1); + done(); + }); + }); + it('should enable force', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'force': true }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-force')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--force')).to.not.equal(-1); done(); }); }); it('should enable only', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'only': true }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-only')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--only')).to.not.equal(-1); done(); }); }); it('should enable onlyAutomate', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'onlyAutomate': true }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-onlyAutomate')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--only-automate')).to.not.equal(-1); done(); }); }); it('should enable forcelocal', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'forcelocal': true }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-forcelocal')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--force-local')).to.not.equal(-1); + done(); + }); + }); + + it('should enable forcelocal with camel case', function (done) { + bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'forceLocal': true }, function(){ + expect(bsLocal.getBinaryArgs().indexOf('--force-local')).to.not.equal(-1); done(); }); }); it('should enable custom boolean args', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'boolArg1': true, 'boolArg2': true }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-boolArg1')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf('-boolArg2')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--boolArg1')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--boolArg2')).to.not.equal(-1); done(); }); }); it('should enable custom keyval args', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'customKey1': 'custom value1', 'customKey2': 'custom value2' }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-customKey1')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--customKey1')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf('custom value1')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf('-customKey2')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--customKey2')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf('custom value2')).to.not.equal(-1); done(); }); @@ -112,7 +136,14 @@ describe('Local', function () { it('should enable forceproxy', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'forceproxy': true }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-forceproxy')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--force-proxy')).to.not.equal(-1); + done(); + }); + }); + + it('should enable forceproxy with camel case', function (done) { + bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'forceProxy': true }, function(){ + expect(bsLocal.getBinaryArgs().indexOf('--force-proxy')).to.not.equal(-1); done(); }); }); @@ -120,7 +151,7 @@ describe('Local', function () { it('should set localIdentifier', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'localIdentifier': 'abcdef' }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-localIdentifier')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--local-identifier')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf('abcdef')).to.not.equal(-1); done(); }); @@ -135,20 +166,21 @@ describe('Local', function () { 'proxyUser': 'user', 'proxyPass': 'pass' }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-proxyHost')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--proxy-host')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf('localhost')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf('-proxyPort')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--proxy-port')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf(8080)).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf('-proxyUser')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--proxy-user')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf('user')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf('-proxyPass')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--proxy-pass')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf('pass')).to.not.equal(-1); done(); }); }); it('should set hosts', function (done) { - bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'hosts': 'localhost,8000,0' }, function(){ + bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: 'localhost,8000,0'}, function(){ + expect(bsLocal.getBinaryArgs().indexOf('--only')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf('localhost,8000,0')).to.not.equal(-1); done(); }); From c70f1d889f0ca393010d65bc729db607714ed5cb Mon Sep 17 00:00:00 2001 From: Blackbaud-PatrickOFriel Date: Wed, 16 Nov 2016 14:33:31 -0500 Subject: [PATCH 2/7] fix lint errors --- lib/Local.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Local.js b/lib/Local.js index 3610bde..062737b 100644 --- a/lib/Local.js +++ b/lib/Local.js @@ -121,11 +121,11 @@ function Local(){ this.key = value; break; - case 'verbose': + case 'verbose': if(value.toString() !== 'true') this.verboseFlag = value; else { - this.verboseFlag = 1; + this.verboseFlag = 1; } break; @@ -195,7 +195,7 @@ function Local(){ this.logfile = value; break; - case 'parallelRuns': + case 'parallelRuns': if(value) this.parallelRunsFlag = value; break; @@ -232,8 +232,8 @@ function Local(){ if(this.folderFlag) args.push(this.folderFlag); if(this.key) { - args.push('--key'); - args.push(this.key); + args.push('--key'); + args.push(this.key); } if(this.folderPath) args.push(this.folderPath); @@ -247,9 +247,10 @@ function Local(){ args.push('--parallel-runs'); args.push(this.parallelRunsFlag); } - if(this.onlyHosts) + if(this.onlyHosts) { args.push('--only'); args.push(this.onlyHosts); + } if(this.onlyAutomateFlag) args.push(this.onlyAutomateFlag); if(this.proxyHost){ From 0344610b542f0bc1a8fb3e564dbfd264c0ae1c65 Mon Sep 17 00:00:00 2001 From: Blackbaud-PatrickOFriel Date: Wed, 16 Nov 2016 14:42:41 -0500 Subject: [PATCH 3/7] correct only and verbose test --- lib/Local.js | 4 +++- test/local.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Local.js b/lib/Local.js index 062737b..dd192fd 100644 --- a/lib/Local.js +++ b/lib/Local.js @@ -273,8 +273,10 @@ function Local(){ args.push(this.forceProxyFlag); if(this.forceFlag) args.push(this.forceFlag); - if(this.verboseFlag) + if(this.verboseFlag){ + args.push('--verbose'); args.push(this.verboseFlag); + } for(var i in this.userArgs){ args.push(this.userArgs[i]); } diff --git a/test/local.js b/test/local.js index 96d3135..33b19b3 100644 --- a/test/local.js +++ b/test/local.js @@ -179,7 +179,7 @@ describe('Local', function () { }); it('should set hosts', function (done) { - bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: 'localhost,8000,0'}, function(){ + bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'only': 'localhost,8000,0'}, function(){ expect(bsLocal.getBinaryArgs().indexOf('--only')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf('localhost,8000,0')).to.not.equal(-1); done(); From f1fc10d63fdf9a112e8979f763613bf4b58792bc Mon Sep 17 00:00:00 2001 From: Blackbaud-PatrickOFriel Date: Wed, 16 Nov 2016 14:49:49 -0500 Subject: [PATCH 4/7] Fix verbose test --- test/local.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/local.js b/test/local.js index 33b19b3..2a0de7f 100644 --- a/test/local.js +++ b/test/local.js @@ -52,7 +52,7 @@ describe('Local', function () { it('should enable verbose', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'verbose': true }, function(){ expect(bsLocal.getBinaryArgs().indexOf('--verbose')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf('1')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf(1)).to.not.equal(-1); done(); }); }); @@ -60,7 +60,7 @@ describe('Local', function () { it('should enable verbose with log level', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'verbose': 2 }, function(){ expect(bsLocal.getBinaryArgs().indexOf('--verbose')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf('2')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf(2)).to.not.equal(-1); done(); }); }); From dc30cee73ed6b7a634713a27fca5fdb706955cad Mon Sep 17 00:00:00 2001 From: Blackbaud-PatrickOFriel Date: Wed, 16 Nov 2016 17:14:55 -0500 Subject: [PATCH 5/7] only pass string values to args --- lib/Local.js | 6 +++--- test/local.js | 28 ++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/lib/Local.js b/lib/Local.js index dd192fd..cd232ee 100644 --- a/lib/Local.js +++ b/lib/Local.js @@ -125,7 +125,7 @@ function Local(){ if(value.toString() !== 'true') this.verboseFlag = value; else { - this.verboseFlag = 1; + this.verboseFlag = '1'; } break; @@ -245,7 +245,7 @@ function Local(){ } if(this.parallelRunsFlag){ args.push('--parallel-runs'); - args.push(this.parallelRunsFlag); + args.push(this.parallelRunsFlag.toString()); } if(this.onlyHosts) { args.push('--only'); @@ -275,7 +275,7 @@ function Local(){ args.push(this.forceFlag); if(this.verboseFlag){ args.push('--verbose'); - args.push(this.verboseFlag); + args.push(this.verboseFlag.toString()); } for(var i in this.userArgs){ args.push(this.userArgs[i]); diff --git a/test/local.js b/test/local.js index 2a0de7f..5498387 100644 --- a/test/local.js +++ b/test/local.js @@ -52,7 +52,7 @@ describe('Local', function () { it('should enable verbose', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'verbose': true }, function(){ expect(bsLocal.getBinaryArgs().indexOf('--verbose')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf(1)).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('1')).to.not.equal(-1); done(); }); }); @@ -60,7 +60,15 @@ describe('Local', function () { it('should enable verbose with log level', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'verbose': 2 }, function(){ expect(bsLocal.getBinaryArgs().indexOf('--verbose')).to.not.equal(-1); - expect(bsLocal.getBinaryArgs().indexOf(2)).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('2')).to.not.equal(-1); + done(); + }); + }); + + it('should enable verbose with log level string', function (done) { + bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'verbose': '2' }, function(){ + expect(bsLocal.getBinaryArgs().indexOf('--verbose')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('2')).to.not.equal(-1); done(); }); }); @@ -157,6 +165,22 @@ describe('Local', function () { }); }); + it('should set parallelRuns', function (done) { + bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'parallelRuns': '10' }, function(){ + expect(bsLocal.getBinaryArgs().indexOf('-parallel-runs')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('10')).to.not.equal(-1); + done(); + }); + }); + + it('should set parallelRuns with integer value', function (done) { + bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'parallelRuns': 10 }, function(){ + expect(bsLocal.getBinaryArgs().indexOf('-parallel-runs')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('10')).to.not.equal(-1); + done(); + }); + }); + it('should set proxy', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, From d7e92e05ca4b0259aa973a48d015c3d0fd5b413f Mon Sep 17 00:00:00 2001 From: Blackbaud-PatrickOFriel Date: Wed, 16 Nov 2016 17:18:15 -0500 Subject: [PATCH 6/7] Fix parallel runs test --- test/local.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/local.js b/test/local.js index 5498387..b4e20d9 100644 --- a/test/local.js +++ b/test/local.js @@ -167,7 +167,7 @@ describe('Local', function () { it('should set parallelRuns', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'parallelRuns': '10' }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-parallel-runs')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--parallel-runs')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf('10')).to.not.equal(-1); done(); }); @@ -175,7 +175,7 @@ describe('Local', function () { it('should set parallelRuns with integer value', function (done) { bsLocal.start({ 'key': process.env.BROWSERSTACK_ACCESS_KEY, onlyCommand: true, 'parallelRuns': 10 }, function(){ - expect(bsLocal.getBinaryArgs().indexOf('-parallel-runs')).to.not.equal(-1); + expect(bsLocal.getBinaryArgs().indexOf('--parallel-runs')).to.not.equal(-1); expect(bsLocal.getBinaryArgs().indexOf('10')).to.not.equal(-1); done(); }); From 9dd6ad2ea454c0ba341dbf4432499a9b3aac91f6 Mon Sep 17 00:00:00 2001 From: Blackbaud-PatrickOFriel Date: Mon, 21 Nov 2016 11:55:32 -0500 Subject: [PATCH 7/7] Add binarypath back to readme and getBinaryArgs --- README.md | 7 +++++++ lib/Local.js | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index fde7e7b..8b3e84a 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,13 @@ bs_local_args = { 'key': '', 'localIdentifier': 'randoms ## Additional Arguments +#### Binary Path + + 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. + Path to specify local Binary path - + ```node + bs_local_args = { 'key': '', 'binarypath': '/browserstack/BrowserStackLocal' } + ``` #### Logfile 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. diff --git a/lib/Local.js b/lib/Local.js index cd232ee..4549cdf 100644 --- a/lib/Local.js +++ b/lib/Local.js @@ -200,6 +200,11 @@ function Local(){ this.parallelRunsFlag = value; break; + case 'binarypath': + if(value) + this.binaryPath = value; + break; + default: if(value.toString().toLowerCase() == 'true'){ this.userArgs.push('--' + key);