Merge pull request 'fix: tests/setup/navigate.ts: bare 500ms timeout after pushState is fragile under CPU pressure (#390)' (#417) from fix/issue-390 into master
This commit is contained in:
commit
afcf13bc84
1 changed files with 5 additions and 2 deletions
|
|
@ -12,6 +12,9 @@ export async function navigateSPA(page: Page, path: string): Promise<void> {
|
|||
window.history.pushState({}, '', p);
|
||||
window.dispatchEvent(new PopStateEvent('popstate'));
|
||||
}, path);
|
||||
// Give Vue Router time to resolve the route and render
|
||||
await page.waitForTimeout(500);
|
||||
// waitForURL would resolve immediately (pushState already updated the URL
|
||||
// synchronously), so wait for networkidle instead: that fires once Vue Router
|
||||
// has processed the popstate event, mounted the new view, and any route-
|
||||
// triggered data fetches have settled.
|
||||
await page.waitForLoadState('networkidle', { timeout: 10_000 });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue