From 06debd770ca3e3b73784b7e4fbb678c8165f3492 Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Mon, 6 Nov 2023 15:26:24 +0100 Subject: [PATCH] fix: UTs --- lib/helper/Puppeteer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/helper/Puppeteer.js b/lib/helper/Puppeteer.js index 05d96dfbb..76f1ac2b5 100644 --- a/lib/helper/Puppeteer.js +++ b/lib/helper/Puppeteer.js @@ -659,10 +659,11 @@ class Puppeteer extends Helper { this.isAuthenticated = true; } } - const fileName = `${`${global.output_dir}${path.sep}trace${path.sep}${uuidv4()}_${clearString(this.currentRunningTest.title)}`.slice(0, 245)}.json`; - const dir = path.dirname(fileName); - if (!fileExists(dir)) fs.mkdirSync(dir); + if (this.options.trace) { + const fileName = `${`${global.output_dir}${path.sep}trace${path.sep}${uuidv4()}_${clearString(this.currentRunningTest.title)}`.slice(0, 245)}.json`; + const dir = path.dirname(fileName); + if (!fileExists(dir)) fs.mkdirSync(dir); await this.page.tracing.start({ screenshots: true, path: fileName }); this.currentRunningTest.artifacts.trace = fileName; }