fix(humanize): forward human_config in all chained methods, use evaluate args in handle pointer checks

- Add human_config=kwargs.get("human_config") to check/uncheck/select_option/press inner calls (sync+async+JS)
- Convert check_pointer_events_handle from f-string interpolation to evaluate args pattern (sync+async+JS)
This commit is contained in:
CloakHQ
2026-05-15 19:17:11 +02:00
parent 39f807f246
commit f4f6a3f8fd
5 changed files with 39 additions and 41 deletions
+3 -9
View File
@@ -23,6 +23,7 @@ from .actionability import (
_BACKOFF_MS,
_boxes_differ,
_POINTER_EVENTS_LOCATOR_JS,
_POINTER_EVENTS_HANDLE_JS,
)
@@ -226,18 +227,11 @@ async def async_check_pointer_events_handle(
deadline = time.monotonic() + timeout / 1000.0
attempt = 0
js = f"""(expected) => {{
const target = document.elementFromPoint({x}, {y});
if (!target) return {{ hit: false, reason: 'no_element_at_point', covering: 'none' }};
let node = target;
while (node) {{ if (node === expected) return {{ hit: true }}; node = node.parentNode; }}
if (expected.contains(target)) return {{ hit: true }};
return {{ hit: false, reason: 'covered', covering: target.tagName || 'unknown' }};
}}"""
coords = {"x": x, "y": y}
while True:
try:
result = await el.evaluate(js)
result = await el.evaluate(_POINTER_EVENTS_HANDLE_JS, coords)
except Exception:
result = None