Skip to content

Commit bc1c500

Browse files
authored
[WIP] Popups triggered during a test execution are not isolated between sequentially executed tests, leading to state leakage (#5121)
1 parent 4270372 commit bc1c500

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/helper/Playwright.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@ class Playwright extends Helper {
642642
async _after() {
643643
if (!this.isRunning) return
644644

645+
// Clear popup state to prevent leakage between tests
646+
popupStore.clear()
647+
645648
if (this.isElectron) {
646649
this.browser.close()
647650
this.electronSessions.forEach(session => session.close())

lib/helper/Puppeteer.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ class Puppeteer extends Helper {
330330
async _after() {
331331
if (!this.isRunning) return
332332

333+
// Clear popup state to prevent leakage between tests
334+
popupStore.clear()
335+
333336
// close other sessions
334337
const contexts = this.browser.browserContexts()
335338
const defaultCtx = contexts.shift()

0 commit comments

Comments
 (0)