Skip to content

Commit 190ae7b

Browse files
committed
Update documentation with browser auto-initialization fix
- Document fix for Before() hook navigation issue - Reorganize sections to reflect chronological fixes - All major issues now resolved or documented
1 parent ec2579c commit 190ae7b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

PLAYWRIGHT_WORKER_FIXES.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
- **Fix**: Added `await` keyword: `const baseConfig = await getConfig(options.config || testRoot)`
99
- **Impact**: Custom locator tests now pass (20 passed, 2 skipped - was 2 passed, 18 failed)
1010

11-
### 2. ⚠️ Per-Test Config with Session Mode + Workers (LIMITATION DOCUMENTED)
11+
### 2. ✅ Browser Auto-Initialization (FIXED)
12+
**Problem**: "Cannot navigate: browser is not running" error in `Before()` hooks with BROWSER_RESTART=browser
13+
- **Root Cause**: `Before()` hooks run before helper's `_before()` method, so browser not started yet
14+
- **File**: `lib/helper/Playwright.js` line 1508
15+
- **Fix**: Allow auto-initialization when `manualStart` is false
16+
- **Impact**: Tests with `Before()` hooks now work properly with restart=browser mode
17+
18+
### 3. ⚠️ Per-Test Config with Session Mode + Workers (LIMITATION DOCUMENTED)
1219
**Problem**: Per-test `.config()` doesn't work in BROWSER_RESTART=session mode with workers
1320
- **Root Cause**: `teardown()` afterEach hooks don't execute in worker/pool mode
1421
- **Evidence**: File logging showed config changes applied but restore callbacks never fired
@@ -20,7 +27,7 @@
2027
- **Affected Tests**: 18 tests from `config_test.js` and `session_test.js`
2128
- **Workaround Applied**: Changed CI workflow to avoid the problematic combination
2229

23-
### 3. ⚠️ Selector Registration Conflicts (NEW ISSUE)
30+
### 4. ⚠️ Selector Registration Conflicts (NEW ISSUE)
2431
**Problem**: BROWSER_RESTART=context with workers causes selector registration conflicts
2532
- **Error**: `browser.newContext: "__value" selector engine has been already registered`
2633
- **Root Cause**: Custom selectors are registered globally on the Playwright module instance (module-level variable)

0 commit comments

Comments
 (0)