Skip to content

Commit 54690fe

Browse files
authored
Merge pull request #100 from JankariTech/debug
allow to show browser console output in tests
2 parents 9116b3b + ba1907b commit 54690fe

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/e2e/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const config = {
88
slowMo: parseInt(process.env.SLOW_MO) || 0,
99
timeout: parseInt(process.env.TIMEOUT) || 60,
1010
minTimeout: parseInt(process.env.MIN_TIMEOUT) || 5,
11-
headless: process.env.HEADLESS === 'true'
11+
headless: process.env.HEADLESS === 'true',
12+
debug: process.env.DEBUG === 'true'
1213
}
1314

1415
module.exports = config

tests/e2e/hooks.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ AfterAll(async function () {
2323
Before(async function () {
2424
global.context = await global.browser.newContext({ ignoreHTTPSErrors: true })
2525
global.page = await global.context.newPage()
26+
if (config.debug) {
27+
global.page.on('console', (msg) => console.log(msg.text()))
28+
}
2629
})
2730

2831
// Cleanup after each scenario

0 commit comments

Comments
 (0)