click on point
Build and Push Docker Images / build-and-push (push) Successful in 36s

This commit is contained in:
2026-04-01 11:17:38 +02:00
parent 8320099292
commit 6e29eba5f4
+20 -2
View File
@@ -281,12 +281,30 @@ async def interactions_service(
# Fallback to coordinate-based interactions when no selector is given.
elif x is not None and y is not None:
if action == "click":
await page.mouse.click(x, y)
# Use DOM elementFromPoint so React/SPA components receive real click events.
handle = await page.evaluate_handle(
"(cx, cy) => document.elementFromPoint(cx, cy)",
x,
y,
)
try:
await handle.click()
finally:
await handle.dispose()
elif action == "type":
if text is None:
raise ValueError("Type interaction must contain text")
await page.mouse.click(x, y)
# Focus the element at the given coordinates, then type.
handle = await page.evaluate_handle(
"(cx, cy) => document.elementFromPoint(cx, cy)",
x,
y,
)
try:
await handle.click()
finally:
await handle.dispose()
await page.keyboard.type(text)
else: