microsoft / microsoft/winappCli

Follow-up from #620: automate coverage for the put_accValue (LegacyIAccessible) set-value success path

Open
#623 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.3k
Forks
80
Avg merge
3d 6h
Merged PRs (30d)
51

Description

Surfaced during the PR review for #620 (set-value `LegacyIAccessible` fallback, PR #622).

## Test coverage gap (primary)

`UiAutomationService.SetValueAsync` now falls back to `IUIAutomationLegacyIAccessiblePattern.SetValue` (`put_accValue`) for TextPattern-only edit controls. The **graceful-failure** path is covered by the WinUI e2e (`scripts/test-e2e-winui-ui.ps1`: WinUI 3 `RichEditBox` returns `E_NOTIMPL`, so `set-value` fails with a `send-keys` hint). The **successful** `put_accValue` path is currently **not** covered by an automated test because:

- The real `SetValueAsync` uses concrete CsWin32 COM interfaces with no injectable seam; `FakeUiAutomationService.SetValueAsync` replaces the whole method, so command-level unit tests can't exercise the fallback.
- No WinUI 3 control implements `put_accValue` without also exposing `ValuePattern` (which `set-value` tries first), so the WinUI 3 sample e2e can't reach the branch either.

Possible approaches:

- Introduce a thin abstraction over UIA pattern acquisition so a fake can simulate a `put_accValue`-only control and assert the success path.
- Add a dedicated native integration test against a control that *does* honor `put_accValue` (native Win32 rich-edit, or an Electron/WebView2 compose box).

This is referenced by the "Coverage boundary" note in `scripts/test-e2e-winui-ui.ps1`.

## Also noticed: pre-existing npm generated-file drift (secondary, unrelated to #620)

The `debugOutput` / `symbols` command descriptions in `docs/cli-schema.json` are not reflected in the npm-generated `src/winapp-npm/src/winapp-commands.ts` and `docs/npm-usage.md`. This drift pre-dates #620 (from an earlier merged feature) and was intentionally left out of scope for PR #622 to keep it focused, but regenerating the npm command/doc artifacts would resync them.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with UiAutomationService.SetValueAsync, FakeUiAutomationService.SetValueAsync, and the coverage note in scripts/test-e2e-winui-ui.ps1. Compare the abstraction and native integration approaches, then run the existing WinUI e2e coverage to understand the graceful-failure case. Done means an automated test exercises and verifies successful put_accValue fallback; the npm artifact drift is a separate secondary concern.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, electron, powershell, typescript
Domain
cli, desktop, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.