feat(humanize): add Playwright ElementHandle support and fix async tests#133
feat(humanize): add Playwright ElementHandle support and fix async tests#133Cloak-HQ merged 1 commit intoCloakHQ:mainfrom
Conversation
|
Thanks for this, great addition! One question on the The humanized
Was the click intentional (human-like "focus by clicking")? Or should it move the cursor then call def _human_el_focus() -> None:
_move_to_element() # human-like cursor movement
_orig_focus() # programmatic focus, no click side-effects |
1f96782 to
93c9b25
Compare
|
My bad, the click in focus() wasn't intentional. Fixed — now it does moveToElement() + origFocus() exactly as you suggested. Updated in Python sync/async and JS. |
|
Merged, thanks! All tests pass including integration after rebase. One note for a follow-up: The page-level click path handles this correctly via |
|
No problem, will be fixid soon. Thanks for details! |
Summary
query_selector(Python) and$(JS) return patched handles. Interactions likeel.click(),el.fill(), andel.hover()use humanized Bézier curves and realistic timing.asyncioimports andasyncio.runconflicts).How it works
query_selector,query_selector_all, andwait_for_selector. Any handle they return is automatically wrapped with humanized methods.Page, so movement is continuous and natural.ElementHandle, that child is also automatically humanized.Note
I've verified everything with the visual test suite. Since I haven't worked extensively with Playwright's
ElementHandleinternals before, please double-check the patching logic.Having real good time doing this. Learning smth new