Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Assertions should work against a list of ElementHandles #28

Open
ramraphael opened this issue Oct 14, 2020 · 4 comments
Open

Assertions should work against a list of ElementHandles #28

ramraphael opened this issue Oct 14, 2020 · 4 comments
Labels

Comments

@ramraphael
Copy link

ramraphael commented Oct 14, 2020

Hi here,

Currently, all assertions are designed to check a single element. It would be helpful to check multiple elements (list items, table cells) and assert that they contain certain text.

Just spitballing here, but this is what I'm envisioning 🤔 :

  • A new matcher, expect(page).toAllHaveText(selector, text, options) (this would use Playwright's page.$$ method to select all elements matching the provided selector).

Would love thoughts from the community. Happy to collaborate and contribute! 😄

@creage
Copy link

creage commented Dec 23, 2020

@mmarkelov can we have this feature implemented please?

@mmarkelov
Copy link
Member

@creage yeah! I suppose so. I just need to think about the way of this matcher.

@creage
Copy link

creage commented Dec 31, 2020

How about new all chainable?

Something like expect(page).all.toHaveText(selector, text, options)?

@mmarkelov
Copy link
Member

@creage IDK if it's possible to chain it in this way, but this looks good to me.

@mmarkelov mmarkelov added the enhancement New feature or request label Dec 31, 2020
@mxschmitt mxschmitt added good first issue Good for newcomers and removed good first issue Good for newcomers labels Jan 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants