verify

GitHub

指导如何构建、启动并驱动LiveMarkdownEditor WPF应用,通过截图和自动化操作验证UI行为、布局及命令可用性,弥补无头测试的不足。

.claude/skills/verify/SKILL.md 317jamtay317/LiveMarkDownEditor

Trigger Scenarios

需要验证WPF应用UI交互或布局 无头测试无法覆盖焦点或命令状态 进行端到端UI行为验证

Install

npx skills add 317jamtay317/LiveMarkDownEditor --skill verify -g -y
More Options

Non-standard path

npx skills add https://github.com/317jamtay317/LiveMarkDownEditor/tree/main/.claude/skills/verify -g -y

Use without installing

npx skills use 317jamtay317/LiveMarkDownEditor@verify

指定 Agent (Claude Code)

npx skills add 317jamtay317/LiveMarkDownEditor --skill verify -a claude-code -g -y

安装 repo 全部 skill

npx skills add 317jamtay317/LiveMarkDownEditor --all -g -y

预览 repo 内 skill

npx skills add 317jamtay317/LiveMarkDownEditor --list

SKILL.md

Frontmatter
{
    "name": "verify",
    "description": "Build, launch, and drive the LiveMarkDownEditor WPF app to observe a change working. Use when verifying UI behaviour end-to-end rather than through tests."
}

Verifying LiveMarkDownEditor

WPF app, net10.0-windows. Tests are headless STA (StaThread.Run) and cannot observe layout, focus, undo, or command availability — drive the real app for anything in that list.

Build and launch

A running UI.exe locks bin/, so always build to a scratch output:

dotnet build src/UI/UI.csproj -c Debug -o "<scratch>/app" --nologo -v q

Launch with an optional Startup Document (the app takes a .md path as argv[1] — the quickest way to get a document with headings/tables in front of you without driving the Open dialog):

$proc = Start-Process "<scratch>/app/UI.exe" -ArgumentList "<scratch>/test.md" -PassThru

Poll for the windowMainWindowHandle is 0 for a second or two after Start-Process, and reading it too early yields an empty handle:

for ($i = 0; $i -lt 40; $i++) {
    Start-Sleep -Milliseconds 500
    $l = Get-Process -Id $proc.Id -ErrorAction SilentlyContinue
    $l.Refresh()
    if ($l.MainWindowHandle -ne 0) { $h = $l.MainWindowHandle; break }
}

Screenshot

PrintWindow with flag 2 (PW_RENDERFULLCONTENT) — flag 0 renders WPF content blank. Capture the window even when it is not foreground.

Drive it

  • Click into the editing area first (SetCursorPos + mouse_event, ~(400, 300) window-relative). The RichTextBox does not have focus at startup, so SendKeys goes nowhere and you get a confusingly empty document.
  • Then SetForegroundWindow + [System.Windows.Forms.SendKeys]::SendWait(...), ~600ms between steps.
  • Command bar hit points (maximized, 1936px wide): Source panel toggle ~(681, 55), Collapse all ~(435, 55), Expand all ~(523, 55). Turn the Source panel on to watch Capture happen live — it is the clearest proof an edit reached the Markdown Document.

Gotchas

  • The Find Bar floats over the top-right, which is exactly where the Source Panel is. Its first couple of source lines sit behind the bar — close the Find Bar (its ✕, ~(1875, 162)) before concluding the Source Panel is empty.
  • Escape only closes the Find Bar while focus is in the query/replacement box — it is bound on those TextBox.InputBindings, not globally. From the editor, click the ✕ instead.
  • RoutedUICommand.Execute() bypasses CanExecute. A command can be dead in the UI (greyed out) while its unit test passes happily. If a change adds or alters a command, assert CanExecute in the test and look at the button in a screenshot.

Version History

  • 1.2.0 Current 2026-07-30 20:26

Metadata

Files
0
Version
1.2.0
Hash
ba40de6a
Indexed
2026-07-30 20:26

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-03 08:27
浙ICP备14020137号-1 $Гость$