Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gustavo-meilus opened this issue Jan 17, 2025 · 0 comments

Comments

@gustavo-meilus
Copy link

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 added a commit to gustavo-meilus/eslint-plugin-playwright that referenced this issue Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant