File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ module.exports = function run(args) {
2424 // accept the build name from command line if provided
2525 utils . setBuildName ( bsConfig , args ) ;
2626
27+ // accept the specs list from command line if provided
28+ utils . setUserSpecs ( bsConfig , args ) ;
29+
30+ // accept the env list from command line and set it
31+ utils . setTestEnvs ( bsConfig , args ) ;
32+
2733 // Validate browserstack.json values and parallels specified via arguments
2834 return capabilityHelper . validate ( bsConfig , args ) . then ( function ( validated ) {
2935 logger . info ( validated ) ;
Original file line number Diff line number Diff line change @@ -95,6 +95,21 @@ exports.setBuildName = (bsConfig, args) => {
9595 }
9696}
9797
98+ exports . setUserSpecs = ( bsConfig , args ) => {
99+ if ( ! this . isUndefined ( args . specs ) ) {
100+ bsConfig [ 'run_settings' ] [ 'specs' ] = args . specs ;
101+ }
102+ }
103+
104+ // env option must be set only from args
105+ exports . setTestEnvs = ( bsConfig , args ) => {
106+ if ( ! this . isUndefined ( args . env ) ) {
107+ bsConfig [ 'run_settings' ] [ 'env' ] = args . env ;
108+ } else {
109+ bsConfig [ 'run_settings' ] [ 'env' ] = null ;
110+ }
111+ }
112+
98113exports . isUndefined = value => ( value === undefined || value === null ) ;
99114
100115exports . isFloat = value => ( Number ( value ) && Number ( value ) % 1 !== 0 ) ;
You can’t perform that action at this time.
0 commit comments