Skip to content

Commit 7dc82ba

Browse files
committed
Fix Playwright hanging - always stop browser in _afterSuite
- Previously only stopped browser when restart strategies were enabled - This left browser running in session mode (restart:false) - Browser processes would prevent Node.js from exiting - Now always stops browser after suite completes regardless of restart mode
1 parent 8cbb511 commit 7dc82ba

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/helper/Playwright.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,10 @@ class Playwright extends Helper {
791791
}
792792

793793
async _afterSuite() {
794-
// Only stop browser if restart strategy requires it
795-
if ((restartsSession() || restartsContext() || restartsBrowser()) && this.isRunning) {
794+
// Stop browser after suite completes
795+
// For restart strategies: stop after each suite
796+
// For session mode (restart:false): stop after the last suite
797+
if (this.isRunning) {
796798
try {
797799
await this._stopBrowser()
798800
} catch (e) {

0 commit comments

Comments
 (0)