Skip to content

Commit eb51b62

Browse files
committed
Fix
1 parent 5c38989 commit eb51b62

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,12 @@ module.exports.isNotSet = function (obj) {
476476
return false
477477
}
478478

479-
module.exports.emptyFolder = async directoryPath => {
480-
require('child_process').execSync(`rm -rf ${directoryPath}/*`)
479+
module.exports.emptyFolder = directoryPath => {
480+
// Do not throw on non-existent directory, since it may be created later
481+
if (!fs.existsSync(directoryPath)) return
482+
for (const file of fs.readdirSync(directoryPath)) {
483+
fs.rmSync(path.join(directoryPath, file), { recursive: true, force: true })
484+
}
481485
}
482486

483487
module.exports.printObjectProperties = obj => {

test/acceptance/session_test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ Scenario('should return a value in @Puppeteer @Playwright', async ({ I }) => {
217217
})
218218
I.fillField('Description', val)
219219
I.click('Submit')
220+
I.wait(2)
220221
I.see('[description] => Information')
221222
})
222223

@@ -228,6 +229,7 @@ Scenario('should return a value @Puppeteer @Playwright in async', async ({ I })
228229
})
229230
I.fillField('Description', val)
230231
I.click('Submit')
232+
I.wait(2)
231233
I.see('[description] => Information')
232234
})
233235

0 commit comments

Comments
 (0)