playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature] .toHaveValue should consider custom combobox elements

Open hornta opened this issue 3 years ago • 1 comments
trafficstars

Currently the .toHaveValue() assertion only works for native input component but I believe they should work for custom combobox elements as well. What do you think?

Example: https://w3c.github.io/aria-practices/examples/combobox/combobox-autocomplete-list.html

hornta avatar Sep 20 '22 13:09 hornta

For your example as a workaround, you can target the State label, and it will resolve to the input's value:

  expect(page.locator("label", { hasText: 'State' })).toHaveValue("foo");

rwoll avatar Sep 20 '22 17:09 rwoll

Why was this issue closed?

Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.

If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.

pavelfeldman avatar Jun 30 '23 19:06 pavelfeldman