- Symptom
- Assertions after click() plus waitForLoadState() read the previous pageFlaky failures that disappear when a fixed wait is added
- Cause
- waitForLoadState checks the document that is current when it is called. If the navigation has not committed yet, the old page already counts as loaded, so it resolves at once.
- Fix
- Wait for the destination itself with waitForURL or a web-first assertion on the new page.
- Apply
await page.getByRole('button', { name: 'Save' }).click() await page.waitForURL('**/orders/*') await expect(page.getByText('Order saved')).toBeVisible()- Affected
- All Playwright versions
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders