(page: Page)
| 50 | |
| 51 | |
| 52 | async def test_should_traverse_focus(page: Page) -> None: |
| 53 | await page.set_content('<input id="i1"><input id="i2">') |
| 54 | focused = [] |
| 55 | await page.expose_function("focusEvent", lambda: focused.append(True)) |
| 56 | await page.evaluate("() => i2.addEventListener('focus', focusEvent)") |
| 57 | |
| 58 | await page.focus("#i1") |
| 59 | await page.keyboard.type("First") |
| 60 | await page.keyboard.press("Tab") |
| 61 | await page.keyboard.type("Last") |
| 62 | |
| 63 | assert focused == [True] |
| 64 | assert await page.eval_on_selector("#i1", "e => e.value") == "First" |
| 65 | assert await page.eval_on_selector("#i2", "e => e.value") == "Last" |
| 66 | |
| 67 | |
| 68 | async def test_should_traverse_focus_in_all_directions(page: Page) -> None: |
nothing calls this directly
no test coverage detected