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

Count assertion API's #4424

Open
d4vidi opened this issue Mar 27, 2024 · 0 comments
Open

Count assertion API's #4424

d4vidi opened this issue Mar 27, 2024 · 0 comments

Comments

@d4vidi
Copy link
Collaborator

d4vidi commented Mar 27, 2024

Describe your idea

In some scenarios, it makes sense to assert the (visible?) amount of displayed views based on a criteria (matcher).

For example, a list with a search bar or a filter-options selector: It makes sense to assert that given a search term 'xyz', exactly 3 items would be displayed.

For this, (on behalf of the team) I'd like to propose the following conceptual API extensions, based on modifiers:

await expect(element(by.whatever(''))).count(2).toBeVisible()
await expect(element(by.whatever(''))).atLeast(2).toBeVisible()
await expect(element(by.whatever(''))).all.toBeVisible()
await expect(element(by.whatever(''))).all.toExist() // Valid for all expectation types
await expect(element(by.whatever(''))).all.not.toBeVisible() // The not modifier is still applicable

(and so on)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants