feat: add keyboard command for raw keyboard input (#521)
Adds `keyboard type` and `keyboard insertText` subcommands that operate on the currently focused element without requiring a selector. Essential for contenteditable editors (Lexical, ProseMirror, CodeMirror, Monaco) where `type <selector>` doesn't trigger the editor's internal event pipeline (beforeinput/DOM mutation). - `keyboard type <text>` — page.keyboard.type() with real keystrokes - `keyboard insertText <text>` — page.keyboard.insertText() Note: `keyboard press` intentionally omitted — the existing top-level `press` command already operates on current focus. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-2
@@ -667,10 +667,13 @@ export interface ErrorsCommand extends BaseCommand {
|
||||
clear?: boolean;
|
||||
}
|
||||
|
||||
// Keyboard shortcuts
|
||||
// Raw keyboard input (no selector needed)
|
||||
export interface KeyboardCommand extends BaseCommand {
|
||||
action: 'keyboard';
|
||||
keys: string; // e.g., "Control+a", "Shift+Tab"
|
||||
subaction?: 'type' | 'press' | 'insertText'; // press kept for backward compat
|
||||
keys?: string; // for legacy press path
|
||||
text?: string; // for type/insertText
|
||||
delay?: number; // for type (ms between keystrokes)
|
||||
}
|
||||
|
||||
// Mouse wheel
|
||||
|
||||
Reference in New Issue
Block a user