diff --git a/src/cli/argument-parser.js b/src/cli/argument-parser.js index ce8e8151e48..cc2b88ba7e4 100644 --- a/src/cli/argument-parser.js +++ b/src/cli/argument-parser.js @@ -209,8 +209,8 @@ export default class CLIArgumentParser { } async _parseVideoOptions () { - this.opts.video = typeof this.opts.video === 'string' ? await getVideoOptions(this.opts.video) : {}; - this.opts.advancedVideoOptions = typeof this.opts.videoOptions === 'string' ? await getVideoOptions(this.opts.videoOptions) : {}; + this.opts.video = typeof this.opts.video === 'string' ? await getVideoOptions(this.opts.video) : null; + this.opts.advancedVideoOptions = typeof this.opts.videoOptions === 'string' ? await getVideoOptions(this.opts.videoOptions) : null; } _getProviderName () { diff --git a/src/configuration/index.js b/src/configuration/index.js index b845db155bc..60b523f84c4 100644 --- a/src/configuration/index.js +++ b/src/configuration/index.js @@ -99,12 +99,12 @@ export default class Configuration { } async _prepareSslOptions () { - let sslOptions = this._options[OPTION_NAMES.ssl]; + const sslOptions = this._options[OPTION_NAMES.ssl]; if (!sslOptions) return; - sslOptions = await getSSLOptions(sslOptions); + sslOptions.value = await getSSLOptions(sslOptions.value); } _ensureOption (name, value, source) { diff --git a/src/runner/index.js b/src/runner/index.js index cc4518caa3d..0d2b2245cdd 100644 --- a/src/runner/index.js +++ b/src/runner/index.js @@ -218,7 +218,7 @@ export default class Runner extends EventEmitter { if (!videoConfig) return; - videoConfig.basePath = resolvePath(videoConfig.basePath); + videoConfig.basePath = resolvePath(videoConfig.basePath || ''); if (videoConfig.ffmpegPath) videoConfig.ffmpegPath = resolvePath(videoConfig.ffmpegPath); diff --git a/src/utils/convert-to-best-fit-type.js b/src/utils/convert-to-best-fit-type.js index 507ea51e9e2..6281f65feb1 100644 --- a/src/utils/convert-to-best-fit-type.js +++ b/src/utils/convert-to-best-fit-type.js @@ -4,7 +4,7 @@ const BOOLEAN_STRING_VALUES = ['true', 'false']; export default function (valueStr) { if (typeof valueStr !== 'string') - return void 0; + return valueStr; else if (NUMBER_REG_EX.test(valueStr)) return parseFloat(valueStr); diff --git a/test/server/cli-argument-parser-test.js b/test/server/cli-argument-parser-test.js index f572b4aa8ff..fca852d2fe5 100644 --- a/test/server/cli-argument-parser-test.js +++ b/test/server/cli-argument-parser-test.js @@ -476,7 +476,9 @@ describe('CLI argument parser', function () { { long: '--color' }, { long: '--no-color' }, { long: '--stop-on-first-fail', short: '--sf' }, - { long: '--disable-test-syntax-validation' } + { long: '--disable-test-syntax-validation' }, + { long: '--video' }, + { long: '--video-options' } ]; const parser = new CliArgumentParser(''); diff --git a/test/server/path-pattern-test.js b/test/server/path-pattern-test.js index 06013b9425a..e63f0a33007 100644 --- a/test/server/path-pattern-test.js +++ b/test/server/path-pattern-test.js @@ -26,13 +26,13 @@ describe('Screenshot path pattern', () => { it('Normal run', () => { const pathPattern = createPathPattern(); - expect(pathPattern.pattern).eql('${DATE}_${TIME}\\test-${TEST_INDEX}\\${USERAGENT}\\${FILE_INDEX}.png'); + expect(pathPattern.pattern).eql('${DATE}_${TIME}\\test-${TEST_INDEX}\\${USERAGENT}\\${FILE_INDEX}'); }); it('Quarantine mode', () => { const pathPattern = createPathPattern(void 0, { quarantineAttempt: 1 }); - expect(pathPattern.pattern).eql('${DATE}_${TIME}\\test-${TEST_INDEX}\\run-${QUARANTINE_ATTEMPT}\\${USERAGENT}\\${FILE_INDEX}.png'); + expect(pathPattern.pattern).eql('${DATE}_${TIME}\\test-${TEST_INDEX}\\run-${QUARANTINE_ATTEMPT}\\${USERAGENT}\\${FILE_INDEX}'); }); });