noPlaywrightNetworkidle
此内容尚不支持你的语言。
Summary
Section titled “Summary”- Rule available since:
v2.4.2 - Diagnostic Category:
lint/nursery/noPlaywrightNetworkidle - This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
- Same as
playwright/no-networkidle
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noPlaywrightNetworkidle": "error" } } }}Description
Section titled “Description”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.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”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();Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.