@@ -50,8 +50,25 @@ describe('Local', function () {
5050 } ) ;
5151
5252 it ( 'should enable verbose' , function ( done ) {
53- bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'v' : true } , function ( ) {
54- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-vvv' ) ) . to . not . equal ( - 1 ) ;
53+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'verbose' : true } , function ( ) {
54+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--verbose' ) ) . to . not . equal ( - 1 ) ;
55+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '1' ) ) . to . not . equal ( - 1 ) ;
56+ done ( ) ;
57+ } ) ;
58+ } ) ;
59+
60+ it ( 'should enable verbose with log level' , function ( done ) {
61+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'verbose' : 2 } , function ( ) {
62+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--verbose' ) ) . to . not . equal ( - 1 ) ;
63+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '2' ) ) . to . not . equal ( - 1 ) ;
64+ done ( ) ;
65+ } ) ;
66+ } ) ;
67+
68+ it ( 'should enable verbose with log level string' , function ( done ) {
69+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'verbose' : '2' } , function ( ) {
70+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--verbose' ) ) . to . not . equal ( - 1 ) ;
71+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '2' ) ) . to . not . equal ( - 1 ) ;
5572 done ( ) ;
5673 } ) ;
5774 } ) ;
@@ -64,68 +81,106 @@ describe('Local', function () {
6481 } ) ;
6582 } ) ;
6683
84+ it ( 'should set folder testing with folder option' , function ( done ) {
85+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'folder' : '/var/html' } , function ( ) {
86+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-f' ) ) . to . not . equal ( - 1 ) ;
87+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '/var/html' ) ) . to . not . equal ( - 1 ) ;
88+ done ( ) ;
89+ } ) ;
90+ } ) ;
91+
6792 it ( 'should enable force' , function ( done ) {
6893 bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'force' : true } , function ( ) {
69- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-force' ) ) . to . not . equal ( - 1 ) ;
94+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- force' ) ) . to . not . equal ( - 1 ) ;
7095 done ( ) ;
7196 } ) ;
7297 } ) ;
7398
7499 it ( 'should enable only' , function ( done ) {
75100 bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'only' : true } , function ( ) {
76- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-only' ) ) . to . not . equal ( - 1 ) ;
101+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- only' ) ) . to . not . equal ( - 1 ) ;
77102 done ( ) ;
78103 } ) ;
79104 } ) ;
80105
81106 it ( 'should enable onlyAutomate' , function ( done ) {
82107 bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'onlyAutomate' : true } , function ( ) {
83- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-onlyAutomate ' ) ) . to . not . equal ( - 1 ) ;
108+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--only-automate ' ) ) . to . not . equal ( - 1 ) ;
84109 done ( ) ;
85110 } ) ;
86111 } ) ;
87112
88113 it ( 'should enable forcelocal' , function ( done ) {
89114 bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'forcelocal' : true } , function ( ) {
90- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-forcelocal' ) ) . to . not . equal ( - 1 ) ;
115+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--force-local' ) ) . to . not . equal ( - 1 ) ;
116+ done ( ) ;
117+ } ) ;
118+ } ) ;
119+
120+ it ( 'should enable forcelocal with camel case' , function ( done ) {
121+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'forceLocal' : true } , function ( ) {
122+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--force-local' ) ) . to . not . equal ( - 1 ) ;
91123 done ( ) ;
92124 } ) ;
93125 } ) ;
94126
95127 it ( 'should enable custom boolean args' , function ( done ) {
96128 bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'boolArg1' : true , 'boolArg2' : true } , function ( ) {
97- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-boolArg1' ) ) . to . not . equal ( - 1 ) ;
98- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-boolArg2' ) ) . to . not . equal ( - 1 ) ;
129+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- boolArg1' ) ) . to . not . equal ( - 1 ) ;
130+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- boolArg2' ) ) . to . not . equal ( - 1 ) ;
99131 done ( ) ;
100132 } ) ;
101133 } ) ;
102134
103135 it ( 'should enable custom keyval args' , function ( done ) {
104136 bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'customKey1' : 'custom value1' , 'customKey2' : 'custom value2' } , function ( ) {
105- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-customKey1' ) ) . to . not . equal ( - 1 ) ;
137+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- customKey1' ) ) . to . not . equal ( - 1 ) ;
106138 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'custom value1' ) ) . to . not . equal ( - 1 ) ;
107- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-customKey2' ) ) . to . not . equal ( - 1 ) ;
139+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- customKey2' ) ) . to . not . equal ( - 1 ) ;
108140 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'custom value2' ) ) . to . not . equal ( - 1 ) ;
109141 done ( ) ;
110142 } ) ;
111143 } ) ;
112144
113145 it ( 'should enable forceproxy' , function ( done ) {
114146 bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'forceproxy' : true } , function ( ) {
115- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-forceproxy' ) ) . to . not . equal ( - 1 ) ;
147+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--force-proxy' ) ) . to . not . equal ( - 1 ) ;
148+ done ( ) ;
149+ } ) ;
150+ } ) ;
151+
152+ it ( 'should enable forceproxy with camel case' , function ( done ) {
153+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'forceProxy' : true } , function ( ) {
154+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--force-proxy' ) ) . to . not . equal ( - 1 ) ;
116155 done ( ) ;
117156 } ) ;
118157 } ) ;
119158
120159
121160 it ( 'should set localIdentifier' , function ( done ) {
122161 bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'localIdentifier' : 'abcdef' } , function ( ) {
123- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-localIdentifier ' ) ) . to . not . equal ( - 1 ) ;
162+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--local-identifier ' ) ) . to . not . equal ( - 1 ) ;
124163 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'abcdef' ) ) . to . not . equal ( - 1 ) ;
125164 done ( ) ;
126165 } ) ;
127166 } ) ;
128167
168+ it ( 'should set parallelRuns' , function ( done ) {
169+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'parallelRuns' : '10' } , function ( ) {
170+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--parallel-runs' ) ) . to . not . equal ( - 1 ) ;
171+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '10' ) ) . to . not . equal ( - 1 ) ;
172+ done ( ) ;
173+ } ) ;
174+ } ) ;
175+
176+ it ( 'should set parallelRuns with integer value' , function ( done ) {
177+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'parallelRuns' : 10 } , function ( ) {
178+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--parallel-runs' ) ) . to . not . equal ( - 1 ) ;
179+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '10' ) ) . to . not . equal ( - 1 ) ;
180+ done ( ) ;
181+ } ) ;
182+ } ) ;
183+
129184 it ( 'should set proxy' , function ( done ) {
130185 bsLocal . start ( {
131186 'key' : process . env . BROWSERSTACK_ACCESS_KEY ,
@@ -135,20 +190,21 @@ describe('Local', function () {
135190 'proxyUser' : 'user' ,
136191 'proxyPass' : 'pass'
137192 } , function ( ) {
138- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-proxyHost ' ) ) . to . not . equal ( - 1 ) ;
193+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--proxy-host ' ) ) . to . not . equal ( - 1 ) ;
139194 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'localhost' ) ) . to . not . equal ( - 1 ) ;
140- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-proxyPort ' ) ) . to . not . equal ( - 1 ) ;
195+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--proxy-port ' ) ) . to . not . equal ( - 1 ) ;
141196 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 8080 ) ) . to . not . equal ( - 1 ) ;
142- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-proxyUser ' ) ) . to . not . equal ( - 1 ) ;
197+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--proxy-user ' ) ) . to . not . equal ( - 1 ) ;
143198 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'user' ) ) . to . not . equal ( - 1 ) ;
144- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-proxyPass ' ) ) . to . not . equal ( - 1 ) ;
199+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--proxy-pass ' ) ) . to . not . equal ( - 1 ) ;
145200 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'pass' ) ) . to . not . equal ( - 1 ) ;
146201 done ( ) ;
147202 } ) ;
148203 } ) ;
149204
150205 it ( 'should set hosts' , function ( done ) {
151- bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'hosts' : 'localhost,8000,0' } , function ( ) {
206+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'only' : 'localhost,8000,0' } , function ( ) {
207+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--only' ) ) . to . not . equal ( - 1 ) ;
152208 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'localhost,8000,0' ) ) . to . not . equal ( - 1 ) ;
153209 done ( ) ;
154210 } ) ;
0 commit comments