Skip to content

Commit f5d4a8e

Browse files
committed
video-config-fix
1 parent 7e703fd commit f5d4a8e

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

bin/helpers/utils.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,15 +1754,14 @@ exports.getVideoConfig = (cypressConfig, bsConfig = {}) => {
17541754
video: true,
17551755
videoUploadOnPasses: true
17561756
}
1757-
// Reading bsconfig in case of enforce_settings
1758-
if ( this.isUndefined(bsConfig.run_settings) || this.isUndefinedOrFalse(bsConfig.run_settings.enforce_settings) ) {
1759-
if (!this.isUndefined(cypressConfig.video)) conf.video = cypressConfig.video;
1760-
if (!this.isUndefined(cypressConfig.videoUploadOnPasses)) conf.videoUploadOnPasses = cypressConfig.videoUploadOnPasses;
1761-
}
1762-
else {
1763-
if (!this.isUndefined(bsConfig.run_settings) && !this.isUndefined(bsConfig.run_settings.video)) conf.video = bsConfig.run_settings.video;
1764-
if (!this.isUndefined(bsConfig.run_settings) && !this.isUndefined(bsConfig.run_settings.videoUploadOnPasses)) conf.videoUploadOnPasses = bsConfig.run_settings.videoUploadOnPasses;
1765-
}
1757+
1758+
// here if we have enforce_setting: true then cypressConfig will be {} as we are not reading cypress.config.js file in that case
1759+
if (!this.isUndefined(bsConfig.run_settings) && !this.isUndefined(bsConfig.run_settings.video)) conf.video = bsConfig.run_settings.video;
1760+
if (!this.isUndefined(bsConfig.run_settings) && !this.isUndefined(bsConfig.run_settings.videoUploadOnPasses)) conf.videoUploadOnPasses = bsConfig.run_settings.videoUploadOnPasses;
1761+
if (!this.isUndefined(cypressConfig.video)) { conf.video = cypressConfig.video;}
1762+
if (!this.isUndefined(cypressConfig.videoUploadOnPasses)){ conf.videoUploadOnPasses = cypressConfig.videoUploadOnPasses;}
1763+
if (!this.isUndefined(cypressConfig.e2e) && !this.isUndefined(cypressConfig.e2e.video)) { conf.video = cypressConfig.e2e.video;}
1764+
if (!this.isUndefined(cypressConfig.e2e) && !this.isUndefined(cypressConfig.e2e.videoUploadOnPasses)){ conf.videoUploadOnPasses = cypressConfig.e2e.videoUploadOnPasses;}
17661765

17671766
// set video in cli config in case of cypress 13 or above as default value is false there.
17681767
this.setVideoCliConfig(bsConfig,conf);

0 commit comments

Comments
 (0)