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
fix(fillField): prevent rich-editor keystroke leak to sibling inputs (#5531)
* fix(fillField): prevent rich-editor keystroke leak to sibling inputs
The IFRAME branch typed via the root-page keyboard against an iframe body
that's not contenteditable (Monaco-style editors), so keystrokes landed on
whatever the outer document had focused. Detection also climbed the DOM
when the matched element looked hidden, which could pick up unrelated
editors elsewhere on the page.
Now: detection only walks down from the user's locator, the IFRAME branch
re-detects the real input surface inside the iframe, and every focus/click
is verified against document.activeElement before typing — a failed focus
throws instead of leaking. Backing-textarea fixtures (TinyMCE legacy,
CKEditor 4/5, CodeMirror 5, Summernote) wrapped so #editor is the visible
container. Adds sibling-input regression coverage for IFRAME, CONTENTEDITABLE
and HIDDEN_TEXTAREA paths plus a negative test for hidden backing locators.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(fillField): cross-helper iframe detection + leak guard for hidden form controls
- WebDriver/BiDi rejects element refs as executeScript args from inside a
switched-frame context, breaking the inner-iframe focus/select calls.
Run those scripts via document.querySelector on the marker instead, then
send keystrokes via the already-frame-aware page keyboard.
- Add EDITOR.UNREACHABLE: when the user's locator points at a display:none
INPUT/TEXTAREA, throw a clear error instead of falling through. Without
this, Puppeteer's lenient el.type() silently leaks to whatever has focus.
- Test reads outer-input value via executeScript to dodge a pre-existing
WebDriver grabValueFrom bug that drops empty strings in forEachAsync.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: DavertMik <davert@testomat.io>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
thrownewError('fillField: rich editor target did not accept focus. Locator must point at the visible editor surface (a wrapper, iframe, or contenteditable) — not a hidden backing element.')
125
+
}
126
+
}
127
+
79
128
asyncfunctionfindMarked(helper){
80
129
constroot=helper.page||helper.browser
81
130
constraw=awaitroot.$('['+MARKER+']')
@@ -91,22 +140,36 @@ export async function fillRichEditor(helper, el, value) {
91
140
constsource=elinstanceofWebElement ? el : newWebElement(el,helper)
thrownewError('fillField: cannot fill a display:none form control. Locator must point at the visible editor surface (a wrapper, iframe, or contenteditable).')
0 commit comments