eslint-plugin-playwright icon indicating copy to clipboard operation
eslint-plugin-playwright copied to clipboard

Feature request: Rule for .toPass function to ensure that it defines a timeout on it.

Open gustavo-meilus opened this issue 11 months ago • 0 comments

When retrying an action or a series of actions, I often use expect(async () => ...).toPass(). However, it would be useful to have a rule that warns or shows an error if .toPass() is used without explicitly defining a timeout. The Playwright documentation notes that:

By default, .toPass() has a timeout of 0 and does not respect the custom [expect timeout](https://playwright.dev/docs/test-timeouts#expect-timeout).

This behavior can lead to unwanted delays, as the default timeout of 0 may cause tests to wait until the test's overall timeout, rather than failing early as expected.

Playwright Documentation:

.toPass() Assertion

gustavo-meilus avatar Jan 17 '25 01:01 gustavo-meilus