Skip to content

noPlaywrightNetworkidle

biome.json
{
"linter": {
"rules": {
"nursery": {
"noPlaywrightNetworkidle": "error"
}
}
}
}

Disallow usage of the networkidle option.

Using networkidle is discouraged in favor of using web-first assertions. The networkidle event is unreliable and can lead to flaky tests.

await page.waitForLoadState('networkidle');
code-block.js:1:7 lint/nursery/noPlaywrightNetworkidle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unexpected use of networkidle option.

> 1 │ await page.waitForLoadState(‘networkidle’);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

The networkidle event is unreliable and can lead to flaky tests.

Use web-first assertions or wait for specific elements 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.goto('https://example.com', { waitUntil: 'networkidle' });
code-block.js:1:7 lint/nursery/noPlaywrightNetworkidle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unexpected use of networkidle option.

> 1 │ await page.goto(‘https://example.com’, { waitUntil: ‘networkidle’ });
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │

The networkidle event is unreliable and can lead to flaky tests.

Use web-first assertions or wait for specific elements 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.waitForLoadState('load');
await page.goto('https://example.com');
await page.locator('.content').waitFor();