Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 680208d

Browse files
Samuel-StOCopilot
authored andcommitted
fix(playwright): relaunch browser correctly with restart: 'session' in run-workers --by pool (#5118)
* fix: Reset browser context and state on close * test: add acceptance tests
1 parent 4a71c75 commit 680208d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

‎.github/workflows/playwright.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ jobs:
4848
run: './bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug'
4949
- name: run chromium with restart==browser tests
5050
run: 'BROWSER_RESTART=browser ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug'
51-
- name: run chromium with restart==session tests
51+
- name: run chromium with restart==session tests on 2 workers split by pool
52+
run: 'BROWSER_RESTART=session ./bin/codecept.js run-workers 2 -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug --by=pool'
53+
- name: run chromium with restart==session tests and
5254
run: 'BROWSER_RESTART=session ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug'
5355
- name: run firefox tests
5456
run: 'BROWSER=firefox node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug'

‎lib/helper/Playwright.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,10 @@ class Playwright extends Helper {
10311031
this.frame = null
10321032
popupStore.clear()
10331033
if (this.options.recordHar) await this.browserContext.close()
1034+
this.browserContext = null
10341035
await this.browser.close()
1036+
this.browser = null
1037+
this.isRunning = false
10351038
}
10361039

10371040
async _evaluateHandeInContext(...args) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /