File tree Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Expand file tree Collapse file tree 4 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ module.exports = function run(args) {
15
15
return utils . validateBstackJson ( bsConfigPath ) . then ( function ( bsConfig ) {
16
16
utils . setUsageReportingFlag ( bsConfig , args . disableUsageReporting ) ;
17
17
18
+ // accept the username from command line if provided
19
+ utils . setUsername ( bsConfig , args ) ;
20
+
21
+ // accept the access key from command line if provided
22
+ utils . setAccessKey ( bsConfig , args ) ;
23
+
18
24
// Validate browserstack.json values and parallels specified via arguments
19
25
return capabilityHelper . validate ( bsConfig , args ) . then ( function ( validated ) {
20
26
logger . info ( validated ) ;
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ const caps = (bsConfig, zip) => {
66
66
obj . project = bsConfig . run_settings . project || bsConfig . run_settings . project_name ;
67
67
obj . customBuildName = bsConfig . run_settings . customBuildName || bsConfig . run_settings . build_name ;
68
68
obj . callbackURL = bsConfig . run_settings . callback_url ;
69
- obj . projectNotifyURL = bsConfig . run_settings . project_notify_URL ;
69
+ obj . projectNotifyURL = bsConfig . run_settings . build_callback_url ;
70
70
obj . parallels = bsConfig . run_settings . parallels ;
71
71
}
72
72
@@ -99,7 +99,7 @@ const validate = (bsConfig, args) => {
99
99
100
100
// validate parallels specified in browserstack.json if parallels are not specified via arguments
101
101
if ( ! Utils . isUndefined ( args ) && Utils . isUndefined ( args . parallels ) && ! Utils . isParallelValid ( bsConfig . run_settings . parallels ) ) reject ( Constants . validationMessages . INVALID_PARALLELS_CONFIGURATION ) ;
102
-
102
+
103
103
// if parallels specified via arguments validate only arguments
104
104
if ( ! Utils . isUndefined ( args ) && ! Utils . isUndefined ( args . parallels ) && ! Utils . isParallelValid ( args . parallels ) ) reject ( Constants . validationMessages . INVALID_PARALLELS_CONFIGURATION ) ;
105
105
@@ -111,7 +111,7 @@ const validate = (bsConfig, args) => {
111
111
} catch ( error ) {
112
112
reject ( Constants . validationMessages . INVALID_CYPRESS_JSON )
113
113
}
114
-
114
+
115
115
resolve ( Constants . validationMessages . VALIDATED ) ;
116
116
} ) ;
117
117
}
Original file line number Diff line number Diff line change @@ -76,6 +76,18 @@ exports.setParallels = (bsConfig, args) => {
76
76
}
77
77
}
78
78
79
+ exports . setUsername = ( bsConfig , args ) => {
80
+ if ( ! this . isUndefined ( args . username ) ) {
81
+ bsConfig [ 'auth' ] [ 'username' ] = args . username ;
82
+ }
83
+ }
84
+
85
+ exports . setAccessKey = ( bsConfig , args ) => {
86
+ if ( ! this . isUndefined ( args . key ) ) {
87
+ bsConfig [ 'auth' ] [ 'access_key' ] = args . key ;
88
+ }
89
+ }
90
+
79
91
exports . isUndefined = value => ( value === undefined || value === null ) ;
80
92
81
93
exports . isFloat = value => ( Number ( value ) && Number ( value ) % 1 !== 0 ) ;
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ describe("capabilityHelper.js", () => {
233
233
project_name : "sample project" ,
234
234
build_name : "sample build" ,
235
235
callback_url : "random url" ,
236
- project_notify_URL : "random url" ,
236
+ build_callback_url : "random url" ,
237
237
} ,
238
238
} ;
239
239
return capabilityHelper
@@ -374,7 +374,7 @@ describe("capabilityHelper.js", () => {
374
374
it ( "validate parallels present in bsconfig run settings (not a number) when not specified in arguments" , ( ) => {
375
375
376
376
bsConfig . run_settings . parallels = "cypress" ;
377
-
377
+
378
378
return capabilityHelper
379
379
. validate ( bsConfig , { parallels : undefined } )
380
380
. then ( function ( data ) {
You can’t perform that action at this time.
0 commit comments