chore(bidi): reimplement RawKeyboard.sendText()#41637
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f59dcb9 to
1343e6d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
yury-s
left a comment
There was a problem hiding this comment.
Looks good except for putting Bidi-specific script into a separate extension.
This implementation tries to emulate CDP's Input.insertText behavior more closely.
Are there any plans to have such method in Bidi protocol?
| return 'needsinput'; // Still need to input the value. | ||
| } | ||
|
|
||
| insertText(text: string): Element | undefined { |
There was a problem hiding this comment.
Since this is only used in Bidi, it should go in its own script/module. You can call browserContext.extendInjectedScript() to add extra logic.
1343e6d to
e25d3f6
Compare
Test results for "MCP"2 failed 7707 passed, 1235 skipped Merge workflow run. |
Test results for "tests 1"6 flaky49498 passed, 1164 skipped Merge workflow run. |
|
@yury-s I tried using to |
| return 'needsinput'; // Still need to input the value. | ||
| } | ||
|
|
||
| bidiInsertText?: (text: string) => Element | undefined; |
There was a problem hiding this comment.
can we avoid adding this to the main script? packages/injected/src/recorder/pollingRecorder.ts adds a rich API and doesn't leak any of it into the main InjectedScript, let's employ the same approach here.
Hmm, doesn't fail for me when I run the test with this change (in chromium). Are you sure there are no other changes? |
Bidi doesn't have a protocol method corresponding to CDP's
Input.insertText, so this was emulated using keyboard actions. However, this emitskey*events that are not expected forKeyboard.insertText(), breaking several tests.This implementation tries to emulate CDP's
Input.insertTextbehavior more closely.Fixes the following tests:
page/page-fill.spec.ts:tests/page/page-keyboard.spec.ts: