From eb51b621573cbcbc866bec0b96c04d3eee0359b8 Mon Sep 17 00:00:00 2001 From: Thomas Hohn Date: Sat, 20 Sep 2025 13:01:28 +0200 Subject: [PATCH 1/2] Fix --- lib/utils.js | 8 ++++++-- test/acceptance/session_test.js | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index 3c9ad024e..408600000 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -476,8 +476,12 @@ module.exports.isNotSet = function (obj) { return false } -module.exports.emptyFolder = async directoryPath => { - require('child_process').execSync(`rm -rf ${directoryPath}/*`) +module.exports.emptyFolder = directoryPath => { + // Do not throw on non-existent directory, since it may be created later + if (!fs.existsSync(directoryPath)) return + for (const file of fs.readdirSync(directoryPath)) { + fs.rmSync(path.join(directoryPath, file), { recursive: true, force: true }) + } } module.exports.printObjectProperties = obj => { diff --git a/test/acceptance/session_test.js b/test/acceptance/session_test.js index 427cce264..247d7f629 100644 --- a/test/acceptance/session_test.js +++ b/test/acceptance/session_test.js @@ -217,6 +217,7 @@ Scenario('should return a value in @Puppeteer @Playwright', async ({ I }) => { }) I.fillField('Description', val) I.click('Submit') + I.wait(2) I.see('[description] => Information') }) @@ -228,6 +229,7 @@ Scenario('should return a value @Puppeteer @Playwright in async', async ({ I }) }) I.fillField('Description', val) I.click('Submit') + I.wait(2) I.see('[description] => Information') }) From b33aff404a61f5c1f533296978faa367efc9dd6d Mon Sep 17 00:00:00 2001 From: Thomas Hohn Date: Sat, 20 Sep 2025 16:05:21 +0200 Subject: [PATCH 2/2] Remove wait --- test/acceptance/session_test.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/acceptance/session_test.js b/test/acceptance/session_test.js index 247d7f629..427cce264 100644 --- a/test/acceptance/session_test.js +++ b/test/acceptance/session_test.js @@ -217,7 +217,6 @@ Scenario('should return a value in @Puppeteer @Playwright', async ({ I }) => { }) I.fillField('Description', val) I.click('Submit') - I.wait(2) I.see('[description] => Information') }) @@ -229,7 +228,6 @@ Scenario('should return a value @Puppeteer @Playwright in async', async ({ I }) }) I.fillField('Description', val) I.click('Submit') - I.wait(2) I.see('[description] => Information') })