playwright
playwright copied to clipboard
[Feature] expect.toHaveCountGreaterThan() and expect.toHaveCountLowerThan()
Let us know what functionality you'd like to see in Playwright and what your use case is. Do you think others might benefit from this as well?
I consider it worthwhile to introduce new kinds of matchers to expect the number of elements that locator.count() returns.
const locator = page.locator('.selector')
await expect(locator).toHaveCount(2) // already implemented
await expect(locator).toHaveCountGreaterThan(5)
await expect(locator).toHaveCountLowerThan(10)