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

Function test_bounding_box

tests/sync/test_element_handle.py:24–30  ·  view source on GitHub ↗
(page: Page, server: Server)

Source from the content-addressed store, hash-verified

22
23
24def test_bounding_box(page: Page, server: Server) -> None:
25 page.set_viewport_size({"width": 500, "height": 500})
26 page.goto(server.PREFIX + "/grid.html")
27 element_handle = page.query_selector(".box:nth-of-type(13)")
28 assert element_handle
29 box = element_handle.bounding_box()
30 assert box == {"x": 100, "y": 50, "width": 50, "height": 50}
31
32
33def 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