Skip to content

test(ui): make the FlaUI suite pass again, without the mouse or keyboard - #184

Merged
mortenaslo merged 2 commits into
mainfrom
fix/uitests-owned-dialogs
Nov 6, 2026
Merged

mortenaslo merged 2 commits into
mainfrom
fix/uitests-owned-dialogs

Conversation

@mortenaslo

Copy link
Copy Markdown
Contributor

All 10 FlaUI UI tests were failing when run after the v0.10.0 release. Not a product bug: the tests had drifted from the app, and nothing runs them in CI.

Causes and fixes

  • Dialogs are owned windows. UI Automation lists New Session / Settings under the main window, not at the top level, so GetAllTopLevelWindows never found them ("dialog did not open"). AppActions.FindDialog searches both.
  • Layout elements have no automation peer. Border, StackPanel and Grid are invisible to UIA, so the SidebarSessionList / TerminalGrid ids were ignored. New Views/UiaElements (UiaBorder / UiaStackPanel / UiaGrid: same element plus a Group peer, no layout change). Ids added for sidebar rows (SidebarSessionRow, SidebarDormantRow), panes (TerminalPane), the pane close button (TerminalCloseBtn) and EmptyState.
  • No real mouse or keyboard. Buttons are pressed via the Invoke pattern, and sessions are closed with the pane's ✕ instead of a synthesized Ctrl+W, which fails with "Access is denied" on a locked or remote-disconnected desktop. The suite no longer moves the user's cursor.
  • EmptyState was matched by an exact name its two-line text never had.

CLAUDE.md "Testing" documents the three traps.

Verification

  • UI tests: 10/10 pass, run on a locked screen (before: 0/10).
  • Unit tests: 765/765.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NsYm9iLc2aRnRDfV2uZRQX

mortenaslo and others added 2 commits November 6, 2026 16:48
All ten UI tests were failing. Not a product bug: the tests had drifted from
the app, and nothing runs them in CI.

- Dialogs are owned by the main window, so UI Automation lists them under it,
  not at the top level. FindDialog searches both.
- Border / StackPanel / Grid have no automation peer, so the AutomationIds on
  SidebarSessionList and TerminalGrid were never visible. Views/UiaElements adds
  peer-carrying subclasses; sidebar rows, dormant rows, terminal panes, the
  pane close button and the empty-state text get ids.
- Buttons are pressed through the Invoke pattern instead of mouse clicks, and
  sessions are closed with the pane's close button instead of a synthesized
  Ctrl+W: keystrokes fail with "Access is denied" on a locked desktop.
- EmptyState was matched by an exact name its two-line text never had.

10/10 pass, run on a locked screen. Unit tests 765/765.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NsYm9iLc2aRnRDfV2uZRQX
@mortenaslo
mortenaslo merged commit 18aac0b into main Nov 6, 2026
1 check passed
@mortenaslo
mortenaslo deleted the fix/uitests-owned-dialogs branch November 6, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant