feat: expose sendText on test hooks for Puppeteer/Playwright automation (#787)#1332
Draft
adamshiervani wants to merge 1 commit into
Draft
feat: expose sendText on test hooks for Puppeteer/Playwright automation (#787)#1332adamshiervani wants to merge 1 commit into
adamshiervani wants to merge 1 commit into
Conversation
) Add sendText(text) to window.__kvmTestHooks for Playwright E2E tests. This bridges the keyboard-layout-aware character-to-HID-keystroke conversion (already in PasteModal) to the test hooks API, since Puppeteer's keyboard.type() bypasses the WebRTC HID data channel. - Add _getKeyboardLayout to TestHooksInternal, populated from registerTestHandlers - Implement sendText() in initTestHooks() using layout.chars lookup with shift/altRight/deadKey/accentKey handling - Add getKeyboardLayout handler in devices.$id.tsx route - Add sendText() helper in e2e/helpers.ts
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sendText(text)towindow.__kvmTestHooks— converts a string to layout-aware HID keystrokes using the existing keyboard layout conversion from PasteModal_getKeyboardLayoutfrom the settings store into test hooks sosendTextknows which layout to usesendTexthelper toui/e2e/helpers.tsfor use in Playwright testsThis lets Puppeteer/Playwright users type text into the remote machine via
page.evaluate(t => window.__kvmTestHooks.sendText(t), "hello")— working around the fact thatkeyboard.type()fires DOM events which JetKVM's WebRTC HID path never sees.Closes #787