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
PR #650 migrated the E2E harness from WinAppDriver/Appium to Microsoft's winapp ui CLI. At the time, winapp ui (v0.3.2) had no keyboard typing and no drag, so we kept a thin Win32 SendInput fallback — tests/Reactor.AppTests/Infrastructure/InputInjector.cs — used only by the input-injection tests.
winappCli PR #587 adds the native ui send-keys, ui drag, and ui scroll --wheel verbs. Once #587 ships in a released winapp build, InputInjector can be deleted entirely and its call sites repointed at the native verbs.
This issue tracks that swap-out. The mapping below was verified against #587 HEAD (65c4c93) — every InputInjector primitive the tests call has a native equivalent, and the gaps we worried about earlier are all closed.
Every verb foregrounds + verifies internally (SetForegroundWindow + ForegroundGuard.TryEnsureForeground). Drop these calls.
Click(x,y)
click <selector>
All call sites click an element center found by id; click computes the center itself. Prefer passing the selector, not coords.
Drag(points[]) (multi-waypoint)
drag <from> <to>
MouseInput.Draginterpolates 20 steps internally (MouseInput.cs:77), streaming continuous WM_MOUSEMOVE and crossing WinUI's 4-DIP drag threshold. Our hand-rolled 5–6 waypoints become unnecessary.
DragTearOffMerge(grab, drop)
drag <grab> <drop> --dwell-ms <N>
--dwell-ms was added explicitly for drop targets / merge overlays that arm from a sustained hover latch.
PressHoldRelease(x,y, holdMs) (long-press)
drag <x,y> <x,y> --hold-ms <N>
from == to (no movement) performs a pure long-press.
DragPath(...) (path builder)
(obsolete)
CLI interpolates; no builder needed.
TypeKeys(text) (per-keystroke)
send-keys "<text>" --via send-input
Default --via post-message only raises TextChanged; send-input raises a real per-character KeyDown — required by Interactive_OnKeyDown_Captures_Keys and Immediate_FiresOnEveryKeystroke_BeforeBlur.
Drag threshold-crossing — closed by the internal 20-step interpolation (crosses the 4-DIP threshold on the first step).
Merge-overlay latch — closed by --dwell-ms.
Long-press — closed by --hold-ms with from == to.
Per-keystroke KeyDown — closed by --via send-input.
One nuance (not a blocker)
#587's drag interpolates a straight line from→to. Reactor's DragDrop_CancelledDrag_LeavesSourceIntact currently uses a non-collinear L-shaped path, but WinUI DnD resolves the drop at the release point (empty space → still "cancelled"), so the outcome is unchanged. All other drag paths are collinear, so the straight interpolation passes through the same points. No current test outcome depends on a true polyline. If a future test ever needs to route through a specific intermediate target mid-drag, #587 has no multi-waypoint drag — file a follow-up against winappCli at that point.
Work to do (reactor-side, gated on #587 being released)
Add two thin wrappers to WinAppUi: SendKeys(selector, keys, viaSendInput) and Drag(from, to, holdMs, dwellMs) shelling to the new verbs. Prefer passing selectors over screen coords — the CLI re-resolves + stabilizes the element (strictly better than our pre-captured .Rect).
Repoint call sites: UiElement.Type/Clear, DragDropTests, DockingInputTests, DockingTearOffE2ETests, GestureTests, EventHandlerTests, WinFormsTestBase. Drop the now-redundant Foreground() calls.
Delete its unit tests in InfrastructureHelperTests.cs that cover workaround internals (NormalizeAbsoluteCoordinates, DragPath, TryMapKeyToken) — they retire with the helper.
Remove the [Retry(3)] attributes + per-file rationale comments on the input-injection tests if the native verbs prove less flaky (re-evaluate after a few CI runs; keep if still needed).
Background
PR #650 migrated the E2E harness from WinAppDriver/Appium to Microsoft's
winapp uiCLI. At the time,winapp ui(v0.3.2) had no keyboard typing and no drag, so we kept a thin Win32SendInputfallback —tests/Reactor.AppTests/Infrastructure/InputInjector.cs— used only by the input-injection tests.winappCli PR #587 adds the native
ui send-keys,ui drag, andui scroll --wheelverbs. Once #587 ships in a releasedwinappbuild,InputInjectorcan be deleted entirely and its call sites repointed at the native verbs.This issue tracks that swap-out. The mapping below was verified against #587 HEAD (
65c4c93) — everyInputInjectorprimitive the tests call has a native equivalent, and the gaps we worried about earlier are all closed.Verified mapping (
InputInjector→ native verb)InputInjectorprimitiveForeground(hwnd)SetForegroundWindow+ForegroundGuard.TryEnsureForeground). Drop these calls.Click(x,y)click <selector>clickcomputes the center itself. Prefer passing the selector, not coords.Drag(points[])(multi-waypoint)drag <from> <to>MouseInput.Draginterpolates 20 steps internally (MouseInput.cs:77), streaming continuousWM_MOUSEMOVEand crossing WinUI's 4-DIP drag threshold. Our hand-rolled 5–6 waypoints become unnecessary.DragTearOffMerge(grab, drop)drag <grab> <drop> --dwell-ms <N>--dwell-mswas added explicitly for drop targets / merge overlays that arm from a sustained hover latch.PressHoldRelease(x,y, holdMs)(long-press)drag <x,y> <x,y> --hold-ms <N>from == to(no movement) performs a pure long-press.DragPath(...)(path builder)TypeKeys(text)(per-keystroke)send-keys "<text>" --via send-input--via post-messageonly raisesTextChanged;send-inputraises a real per-characterKeyDown— required byInteractive_OnKeyDown_Captures_KeysandImmediate_FiresOnEveryKeystroke_BeforeBlur.ClearViaKeyboard()send-keys "ctrl+a delete"CollapseSelectionToEnd()send-keys "end"Tab()/ShiftTab()send-keys "tab"/send-keys "shift+tab"Previously-identified gaps — all closed in #587
--dwell-ms.--hold-mswithfrom == to.--via send-input.One nuance (not a blocker)
#587's
draginterpolates a straight line from→to. Reactor'sDragDrop_CancelledDrag_LeavesSourceIntactcurrently uses a non-collinear L-shaped path, but WinUI DnD resolves the drop at the release point (empty space → still "cancelled"), so the outcome is unchanged. All other drag paths are collinear, so the straight interpolation passes through the same points. No current test outcome depends on a true polyline. If a future test ever needs to route through a specific intermediate target mid-drag, #587 has no multi-waypointdrag— file a follow-up against winappCli at that point.Work to do (reactor-side, gated on #587 being released)
WinAppUi:SendKeys(selector, keys, viaSendInput)andDrag(from, to, holdMs, dwellMs)shelling to the new verbs. Prefer passing selectors over screen coords — the CLI re-resolves + stabilizes the element (strictly better than our pre-captured.Rect).UiElement.Type/Clear,DragDropTests,DockingInputTests,DockingTearOffE2ETests,GestureTests,EventHandlerTests,WinFormsTestBase. Drop the now-redundantForeground()calls.tests/Reactor.AppTests/Infrastructure/InputInjector.cs.InfrastructureHelperTests.csthat cover workaround internals (NormalizeAbsoluteCoordinates,DragPath,TryMapKeyToken) — they retire with the helper.winappCLI version inbootstrap.ps1/ CI to the release that includes build(deps): bump ws in /tests/stress_perf_rn/VirtualList #587.[Retry(3)]attributes + per-file rationale comments on the input-injection tests if the native verbs prove less flaky (re-evaluate after a few CI runs; keep if still needed).Pointers
tests/Reactor.AppTests/Infrastructure/InputInjector.csgit grep "InputInjector\." tests/Reactor.AppTestsUiSendKeysCommand.cs,UiDragCommand.cs,UiClickCommand.cs,MouseInput.cs