noPlaywrightForceOption
Ta treść nie jest jeszcze dostępna w Twoim języku.
Summary
Section titled “Summary”- Rule available since:
v2.4.2 - Diagnostic Category:
lint/nursery/noPlaywrightForceOption - 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-force-option
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noPlaywrightForceOption": "error" } } }}Description
Section titled “Description”Disallow usage of the { force: true } option.
Playwright’s force option bypasses actionability checks and can lead to unreliable tests.
Instead of using { force: true }, you should fix the underlying issue that requires forcing the action.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”await page.locator('button').click({ force: true });code-block.js:1:7 lint/nursery/noPlaywrightForceOption ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Unexpected use of { force: true } option.
> 1 │ await page.locator(‘button’).click({ force: true });
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │
ℹ The force option bypasses actionability checks and can lead to unreliable tests.
ℹ Fix the underlying issue instead of forcing the action.
ℹ 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.locator('check').check({ force: true });code-block.js:1:7 lint/nursery/noPlaywrightForceOption ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Unexpected use of { force: true } option.
> 1 │ await page.locator(‘check’).check({ force: true });
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │
ℹ The force option bypasses actionability checks and can lead to unreliable tests.
ℹ Fix the underlying issue instead of forcing the action.
ℹ 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.locator('input').fill('text', { force: true });code-block.js:1:7 lint/nursery/noPlaywrightForceOption ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Unexpected use of { force: true } option.
> 1 │ await page.locator(‘input’).fill(‘text’, { force: true });
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │
ℹ The force option bypasses actionability checks and can lead to unreliable tests.
ℹ Fix the underlying issue instead of forcing the action.
ℹ 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.locator('button').click();await page.locator('check').check();await page.locator('input').fill('text');Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.