CommunityToolkit / CommunityToolkit/Labs-Windows

Finish InputInjection Work + Fluent API Helper

Open
#176 3 comments 1 reaction 0 assignees View on GitHub
CI/pipeline 🔬 dev loop ➰ enhancement testing 🏗
Dominant language
C#
Stars
482
Forks
89
PR merge metrics
No merged PRs in 30d

Description

Following on from #124 and #161, we're waiting for 1.1.2 of WinAppSDK or beyond to make progress on this front due to [blocking issues with CI](https://github.com/microsoft/WindowsAppSDK/issues/2631) and MSTest Discovery. (Also see https://github.com/MicrosoftDocs/windows-uwp/issues/3887)

Once those are resolved in the WinAppSDK we can resume investigating our InputInjection approach which appears to work (at least for mouse click) without issue on UWP.

- [ ] Investigate helper methods for more 'ui testing' scenarios
- [x] Since we own the apps and their deployment can we use more restricted capabilities like the [InputInjection](https://docs.microsoft.com/windows/apps/design/input/input-injection) rescap? And does that work in WinUI 3 as well?
- [ ] Does this work in the CI?
- [x] UWP
- [ ] WinUI 3
- [ ] Use `GridSplitter` as a test case and see if we can:
- [ ] Test Localization (will be good test for UWP/WinUI 3 and resource loading)
- [ ] Test a mouse drag (if we get injector working) replicate the UI Test we had for GridSplitter
- [ ] Add Fluent API helper methods

From original thread comment:

> Thanks @Sergio0694, yeah I was roughly thinking something like:

```cs
await SimulateInput.StartTouch()
.MouseDown(coord)
.MouseMove(cx, cy, seconds: 0.5, points: 10)
.MouseUp()
.Execute();
```

> As we need to preface and end the operation with initializing/uninitializing the touch injector code, as well as generate/use a unique pointer id across the instructions (and if we want to use relative positioning between operations keep track of the initial point).
>
> Anyway, bit more investigation to do, as not sure if this is going to run in the CI yet (though even then may have value).

_Originally posted by @michael-hawker in https://github.com/CommunityToolkit/Labs-Windows/issues/124#issuecomment-1157848762_

~Current work in `llama/input-injection-test` branch.~ Now in `llama/input-injection-2025` in tooling and main repos.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.