(page: Page)
| 89 | |
| 90 | |
| 91 | def test_get_by_placeholder(page: Page) -> None: |
| 92 | page.set_content( |
| 93 | """<div> |
| 94 | <input placeholder="Hello"> |
| 95 | <input placeholder="Hello World"> |
| 96 | </div>""" |
| 97 | ) |
| 98 | |
| 99 | expect(page.get_by_placeholder("hello")).to_have_count(2) |
| 100 | expect(page.main_frame.get_by_placeholder("hello")).to_have_count(2) |
| 101 | expect(page.locator("div").get_by_placeholder("hello")).to_have_count(2) |
| 102 | |
| 103 | expect(page.get_by_placeholder("hello")).to_have_count(2) |
| 104 | expect(page.get_by_placeholder("Hello", exact=True)).to_have_count(1) |
| 105 | expect(page.get_by_placeholder(re.compile(r"wor", re.IGNORECASE))).to_have_count(1) |
| 106 | |
| 107 | # Coverage |
| 108 | expect(page.main_frame.get_by_placeholder("hello")).to_have_count(2) |
| 109 | expect(page.locator("div").get_by_placeholder("hello")).to_have_count(2) |
| 110 | |
| 111 | |
| 112 | def test_get_by_alt_text(page: Page) -> None: |
nothing calls this directly
no test coverage detected