You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: detect unfocused element before type() and pressKey() (#5500)
* feat: add focus detection before type() to warn or throw when no element is focused
type() sends keystrokes via page.keyboard which silently drops input when no
element has focus. Add a shared checkFocusBeforeType() that warns in debug mode
and throws NonFocusedType in strict mode. Applied to Playwright, Puppeteer, and
WebDriver helpers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add focus check for pressKey() editing combos (Ctrl+A/C/X/V/Z/Y)
NonFocusedType now accepts message from caller. checkFocusBeforePressKey()
warns/throws only for editing key combos (Ctrl/Meta + A/C/X/V/Z/Y), not
for navigation keys like Escape or Tab.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: check raw key array before normalization in pressKey focus check
WebDriver's getNormalizedKey converts key names to Unicode code points,
so checking after normalization misses the modifier. Now check the
original user-provided key array before any normalization happens.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: DavertMik <davert@testomat.io>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments