Skip to content

noPlaywrightWaitForNavigation (JavaScript)

Language JavaScript (and super languages)
biome.json
{
"linter": {
"rules": {
"nursery": {
"noPlaywrightWaitForNavigation": "error"
}
}
}
}

Disallow using page.waitForNavigation().

Playwright’s page.waitForNavigation() is deprecated and should be replaced with more reliable alternatives like page.waitForURL() or page.waitForLoadState().

await page.waitForNavigation();
code-block.js:1:7 lint/nursery/noPlaywrightWaitForNavigation ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ Unexpected use of page.waitForNavigation().

> 1 │ await page.waitForNavigation();
│ ^^^^^^^^^^^^^^^^^^^^^^^^
2 │

ℹ waitForNavigation() is deprecated because it can be unreliable.

ℹ Use page.waitForURL() or page.waitForLoadState() instead.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

await page.click('button');
await page.waitForNavigation({ waitUntil: 'networkidle' });
code-block.js:2:7 lint/nursery/noPlaywrightWaitForNavigation ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ Unexpected use of page.waitForNavigation().

1 │ await page.click('button');
> 2 │ await page.waitForNavigation({ waitUntil: 'networkidle' });
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 │

ℹ waitForNavigation() is deprecated because it can be unreliable.

ℹ Use page.waitForURL() or page.waitForLoadState() instead.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

await page.waitForURL('/home');
await page.waitForLoadState('networkidle');
await page.goto('/home');