@@ -1297,10 +1297,9 @@ 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 . debug ( 'Setting default video for cypress 13 and above' ) ;
13011300 let video_args = `video=${ videoConfig . video } ,videoUploadOnPasses=${ videoConfig . videoUploadOnPasses } ` ;
13021301 config_args = this . isUndefined ( config_args ) ? video_args : config_args + ',' + video_args ;
1303- logger . debug ( `Setting video true in cli for cypress version ${ user_cypress_version } with cli args - ${ config_args } ` )
1302+ logger . debug ( `Setting default video true for cypress 13 and above in cli for cypress version ${ user_cypress_version } with cli args - ${ config_args } ` )
13041303 }
13051304 if ( bsConfig . run_settings && this . isNotUndefined ( config_args ) ) bsConfig [ "run_settings" ] [ "config" ] = config_args ;
13061305}
@@ -1553,13 +1552,15 @@ exports.getVideoConfig = (cypressConfig, bsConfig = {}) => {
15531552 video : true ,
15541553 videoUploadOnPasses : true
15551554 }
1556- // Reading from bsconfig first to give precedance and cypress config will be empty in case of enforce_settings
1557- if ( ! this . isUndefined ( bsConfig . run_settings ) && ! this . isUndefined ( bsConfig . run_settings . video ) ) conf . video = bsConfig . run_settings . video ;
1558- if ( ! this . isUndefined ( bsConfig . run_settings ) && ! this . isUndefined ( bsConfig . run_settings . videoUploadOnPasses ) ) conf . videoUploadOnPasses = bsConfig . run_settings . videoUploadOnPasses ;
1555+ // Reading bsconfig in case of enforce_settings
15591556 if ( this . isUndefined ( bsConfig . run_settings ) || this . isUndefinedOrFalse ( bsConfig . run_settings . enforce_settings ) ) {
15601557 if ( ! this . isUndefined ( cypressConfig . video ) ) conf . video = cypressConfig . video ;
15611558 if ( ! this . isUndefined ( cypressConfig . videoUploadOnPasses ) ) conf . videoUploadOnPasses = cypressConfig . videoUploadOnPasses ;
15621559 }
1560+ else {
1561+ if ( ! this . isUndefined ( bsConfig . run_settings ) && ! this . isUndefined ( bsConfig . run_settings . video ) ) conf . video = bsConfig . run_settings . video ;
1562+ if ( ! this . isUndefined ( bsConfig . run_settings ) && ! this . isUndefined ( bsConfig . run_settings . videoUploadOnPasses ) ) conf . videoUploadOnPasses = bsConfig . run_settings . videoUploadOnPasses ;
1563+ }
15631564
15641565 // set video in cli config in case of cypress 13 or above as default value is false there.
15651566 this . setVideoCliConfig ( bsConfig , conf ) ;
0 commit comments