-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Clear and concise description of the problem
To test that a locator matches a given number of elements, in polling mode, we currently have to do (unless I'm mistaken)
await expect.poll(() => locator.elements().length).toBe(3);
I think that kind of assertion is quite frequent, and Playwright hass a toHaveCount()assertion: https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-count
Suggested solution
Introduce a similar toHaveCount assertion in vitest, so that we can instead write
await expect.element(locator).toHaveCount(3);
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.