diff --git a/tests/test_async_driverless.py b/tests/test_async_driverless.py index 80b81e6..1b03752 100644 --- a/tests/test_async_driverless.py +++ b/tests/test_async_driverless.py @@ -12,7 +12,15 @@ async def get_locator_pos(locator: WebElement): - return await locator.mid_location(spread_a=0.5, spread_b=0.5, border=0.1) + location = await locator.location + size = await locator.size + assert location, size + + x, y, width, height = location.get("x"), location.get("y"), size.get("width"), size.get("height") + assert x and y and width and height + + x, y = x + width // 2, y + height // 2 + return x, y @pytest.mark.skip("Currently bugged by Driverless. Skipping until Update.") diff --git a/tests/test_sync_driverless.py b/tests/test_sync_driverless.py index 3a58a19..e34781b 100644 --- a/tests/test_sync_driverless.py +++ b/tests/test_sync_driverless.py @@ -12,7 +12,15 @@ def get_locator_pos(locator: WebElement): - return locator.mid_location(spread_a=0.5, spread_b=0.5, border=0.1) + location = locator.location + size = locator.size + assert location, size + + x, y, width, height = location.get("x"), location.get("y"), size.get("width"), size.get("height") + assert x and y and width and height + + x, y = x + width // 2, y + height // 2 + return x, y def test_input_leak(sync_driver: Chrome, server: Server) -> None: