playwright: [BUG:Webkit] `page.goto() / page.waitForLoadState()` method does not wait for the `load` event
Context:
- Playwright Version: 1.14.0
- Operating System: Ubuntu 18
- Node.js version: v12.22.5
Bug appears only with Webkit launcher.
Steps to reproduce (reduced to a bare minimum):
- Clone this repo:
git clone https://github.com/canonic-epicure/playwright-8340-repro - In the checkout directory, run
npm install - In console, run
npx exec wds. This will launch the dev web server on port 8000 (should be free, port is hardcoded) - Now, run the
node server.jsin the separate shell. - Observe the
TypeError: window.CLIENT is not a functionexception - Uncomment this line in
server.js:await page.waitForFunction(() => document.readyState === 'complete')This line performs a “manual” waiting for theloadevent - Run
node server.jsagain and observe the exception is gone. - Comment that line back and make sure the exception appears again
- Comment these lines in
client.js:
import { it } from 'https://cdn.jsdelivr.net/npm/@bryntum/siesta@latest/index.js'
it('', () => {})
- Observe the exception disappears (probably, since its a race condition).
The rootcause of the issue seems to be that client.js is importing some other big external module.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 20 (10 by maintainers)
@unlikelyzero This is a different issues, specific to WebKit and async modules. #14897 fixes a race condition in Playwright code.