src/content/docs/linter/rules/no-playwright-networkidle.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JavaScript (and super languages)" icon="seti:javascript"> :::caution This rule is part of the [nursery](/linter/#nursery) group. This means that it is experimental and the behavior can change at any time. ::: ## Summary - Rule available since: `v2.4.2` - Diagnostic Category: [`lint/nursery/noPlaywrightNetworkidle`](/reference/diagnostics#diagnostic-category) - This rule doesn't have a fix. - The default severity of this rule is [**information**](/reference/diagnostics#information). - This rule belongs to the following domains: - [`playwright`](/linter/domains#playwright) - Sources: - Same as [`playwright/no-networkidle`](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-networkidle.md){
"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');
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.waitForLoadState('load');
await page.goto('https://example.com');
await page.locator('.content').waitFor();