@@ -50,8 +50,25 @@ describe('Local', function () {
50
50
} ) ;
51
51
52
52
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 ) ;
55
72
done ( ) ;
56
73
} ) ;
57
74
} ) ;
@@ -64,68 +81,106 @@ describe('Local', function () {
64
81
} ) ;
65
82
} ) ;
66
83
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
+
67
92
it ( 'should enable force' , function ( done ) {
68
93
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 ) ;
70
95
done ( ) ;
71
96
} ) ;
72
97
} ) ;
73
98
74
99
it ( 'should enable only' , function ( done ) {
75
100
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 ) ;
77
102
done ( ) ;
78
103
} ) ;
79
104
} ) ;
80
105
81
106
it ( 'should enable onlyAutomate' , function ( done ) {
82
107
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 ) ;
84
109
done ( ) ;
85
110
} ) ;
86
111
} ) ;
87
112
88
113
it ( 'should enable forcelocal' , function ( done ) {
89
114
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 ) ;
91
123
done ( ) ;
92
124
} ) ;
93
125
} ) ;
94
126
95
127
it ( 'should enable custom boolean args' , function ( done ) {
96
128
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 ) ;
99
131
done ( ) ;
100
132
} ) ;
101
133
} ) ;
102
134
103
135
it ( 'should enable custom keyval args' , function ( done ) {
104
136
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 ) ;
106
138
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 ) ;
108
140
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'custom value2' ) ) . to . not . equal ( - 1 ) ;
109
141
done ( ) ;
110
142
} ) ;
111
143
} ) ;
112
144
113
145
it ( 'should enable forceproxy' , function ( done ) {
114
146
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 ) ;
116
155
done ( ) ;
117
156
} ) ;
118
157
} ) ;
119
158
120
159
121
160
it ( 'should set localIdentifier' , function ( done ) {
122
161
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 ) ;
124
163
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'abcdef' ) ) . to . not . equal ( - 1 ) ;
125
164
done ( ) ;
126
165
} ) ;
127
166
} ) ;
128
167
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
+
129
184
it ( 'should set proxy' , function ( done ) {
130
185
bsLocal . start ( {
131
186
'key' : process . env . BROWSERSTACK_ACCESS_KEY ,
@@ -135,20 +190,21 @@ describe('Local', function () {
135
190
'proxyUser' : 'user' ,
136
191
'proxyPass' : 'pass'
137
192
} , function ( ) {
138
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-proxyHost ' ) ) . to . not . equal ( - 1 ) ;
193
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--proxy-host ' ) ) . to . not . equal ( - 1 ) ;
139
194
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 ) ;
141
196
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 ) ;
143
198
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 ) ;
145
200
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'pass' ) ) . to . not . equal ( - 1 ) ;
146
201
done ( ) ;
147
202
} ) ;
148
203
} ) ;
149
204
150
205
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 ) ;
152
208
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'localhost,8000,0' ) ) . to . not . equal ( - 1 ) ;
153
209
done ( ) ;
154
210
} ) ;
0 commit comments