@@ -1297,7 +1297,7 @@ exports.setVideoCliConfig = (bsConfig, videoConfig) => {
12971297 let cypress_major_version = ( user_cypress_version && user_cypress_version . match ( / ^ ( \d + ) / ) ) ? user_cypress_version . split ( "." ) [ 0 ] : undefined ;
12981298 let config_args = ( bsConfig && bsConfig . run_settings && bsConfig . run_settings . config ) ? bsConfig . run_settings . config : undefined ;
12991299 if ( this . isUndefined ( user_cypress_version ) || this . isUndefined ( cypress_major_version ) || parseInt ( cypress_major_version ) >= 13 ) {
1300- logger . info ( 'Setting default video for cypress 13 and above' ) ;
1300+ logger . debug ( 'Setting default video for cypress 13 and above' ) ;
13011301 let video_args = `video=${ videoConfig . video } ,videoUploadOnPasses=${ videoConfig . videoUploadOnPasses } ` ;
13021302 config_args = this . isUndefined ( config_args ) ? video_args : config_args + ',' + video_args ;
13031303 logger . debug ( `Setting video true in cli for cypress version ${ user_cypress_version } with cli args - ${ config_args } ` )
@@ -1321,9 +1321,14 @@ exports.setEnforceSettingsConfig = (bsConfig) => {
13211321 logger . debug ( `Setting base_url_args for enforce_settings to ${ base_url_args } ` ) ;
13221322 }
13231323 // set specs in config of specpattern to override cypress config
1324- if ( this . isNotUndefined ( bsConfig . run_settings . specs ) && bsConfig . run_settings . cypressTestSuiteType === Constants . CYPRESS_V10_AND_ABOVE_TYPE ) {
1324+ if ( this . isNotUndefined ( bsConfig . run_settings . specs ) && bsConfig . run_settings . cypressTestSuiteType === Constants . CYPRESS_V10_AND_ABOVE_TYPE && ( this . isUndefined ( config_args ) || ! config_args . includes ( "specPattern" ) ) ) {
13251325 // doing this only for cypress 10 and above as --spec is given precedence for cypress 9.
1326- let spec_pattern_args = 'specPattern="' + bsConfig . run_settings . specs + '"' ;
1326+ let specConfigs = bsConfig . run_settings . specs ;
1327+ // if multiple specs are passed, convert it into an array.
1328+ if ( specConfigs && specConfigs . includes ( ',' ) ) {
1329+ specConfigs = JSON . stringify ( bsConfig . run_settings . specs . split ( ',' ) ) ;
1330+ }
1331+ let spec_pattern_args = 'specPattern="' + specConfigs + '"' ;
13271332 config_args = this . isUndefined ( config_args ) ? spec_pattern_args : config_args + ',' + spec_pattern_args ;
13281333 }
13291334 if ( this . isNotUndefined ( config_args ) ) bsConfig [ "run_settings" ] [ "config" ] = config_args ;
0 commit comments