MCPcopy Index your code
hub / github.com/microsoft/playwright-python / test_bounding_box

Function test_bounding_box

tests/async/test_element_handle.py:26–32  ·  view source on GitHub ↗
(page: Page, server: Server)

Source from the content-addressed store, hash-verified

24
25
26async def test_bounding_box(page: Page, server: Server) -> None:
27 await page.set_viewport_size({"width": 500, "height": 500})
28 await page.goto(server.PREFIX + "/grid.html")
29 element_handle = await page.query_selector(".box:nth-of-type(13)")
30 assert element_handle
31 box = await element_handle.bounding_box()
32 assert box == {"x": 100, "y": 50, "width": 50, "height": 50}
33
34
35async def test_bounding_box_handle_nested_frames(page: Page, server: Server) -> None:

Callers

nothing calls this directly

Calls 4

set_viewport_sizeMethod · 0.45
gotoMethod · 0.45
query_selectorMethod · 0.45
bounding_boxMethod · 0.45

Tested by

no test coverage detected