Back to Qwen Code

CUA Driver Test Matrix

packages/cua-driver/docs/test-matrix.md

0.21.612.9 KB
Original Source

CUA Driver Test Matrix

This is the source map for the Rust test suites in packages/cua-driver. It uses two top-level test classes:

  1. Unit and deterministic protocol tests. These do not depend on a repo-local application or an interactive desktop.
  2. Harness E2E tests. These build and launch a repo-local application, drive it through the Rust driver, and verify an external application or desktop oracle.

A test is E2E because it crosses the driver, OS, window system, and application boundary. The Rust harness catalog and its external oracles are the source of truth.

Matrix Dimensions

Every harness E2E result should identify these dimensions:

DimensionValues
OSwindows, macos, linux
Window systemWin32/UIA, AppKit/AX, X11/AT-SPI, Wayland/AT-SPI, WebView/CDP
HarnessElectron, Tauri, WPF, WinUI3, WebView2, AppKit, SwiftUI, WKWebView, GTK3
Action targetingax, px, page, not_applicable
Deliverybackground, foreground, N/A
Scopewindow, desktop, N/A
OracleApp state, accessibility state, focus state, pixel state, protocol state
Test statuspass, fail, skip, environment_error
Observed behaviordelivered, refused, no_effect, error, not_run

Focus preservation is a cross-cutting oracle, not a separate matrix family. When a background action is tested, the row should attach the platform focus observer in addition to checking the target application's external state.

AX and PX describe how an action addresses a target. They are not capture modes. get_window_state returns the tree and screenshot together; the action uses an element index or coordinates.

Unit And Deterministic Tests

These run without the repo-local GUI applications:

AreaLocationCoverage
Core driver logicrust/crates/*/src/**Protocol values, sessions, schemas, image helpers, input helpers, configuration, telemetry, CLI behavior
MCP and CLI boundaryrust/crates/cua-driver/tests/protocol_*Handshake, tool registration, tool calls, media, sessions, and errors
Session capture scopesession_capture_scope_test.rs plus core capture_scope testsPer-session isolation, immutable live policy, explicit auto escalation, end/revive race safety, transport-mirror refusal, and retired persistent key
Tool-contract gateschema_consistency_test.rsShared tool schema parity and reviewed risk metadata across OS backends
Configuration transporttransport_config_persistence_test.rsCLI and MCP configuration persistence
Token and protocol surfacesprotocol_element_token_test.rs, related testsJSON-RPC-visible contract behavior
Permission modes and policy startuppermission_policy_startup_test.rs, daemon_required_test.rs, core authorization, policy, and session_manifest testsFail-before-bind policy loading, managed/user intersection, immutable standard/autonomous/unrestricted startup, danger acknowledgement, admin disable, deny-by-default manifests, and canonical daemon dispatch
Protected browser grantsCore consent, browser::grant, browser::engine, and browser::v2_testsExact request digests, provider authentication seam and deadline, persistent-indicator activation, Stop/session teardown, forged legacy artifact refusal, exact PID/window manifest scope, and the live-origin decision path used before mutation

Some protocol tests spawn the driver process. They remain deterministic because they do not launch a real target application or require a desktop. They should be reported with the unit gate, separately from Harness E2E.

The ordinary unit gate must not run #[ignore] GUI tests and must not turn missing desktop fixtures into silent skips.

Harness E2E: Shared Web Applications

Electron and Tauri are separate repo-local applications that load the shared web harness. The fixture exposes action-specific controls and external state markers rather than an application task that duplicates those same actions.

Source:

  • tests/fixtures/shared/web/index.html
  • tests/fixtures/apps/cross-platform/electron/
  • tests/fixtures/apps/cross-platform/tauri/
  • rust/crates/cua-driver/tests/cross_platform_behavior_test.rs

The shared harness exposes deterministic external markers for these actions:

Action familyActionsAddressingDelivery
PointerLeft click, right click, double clickAX and PXBackground and foreground
Keyboard and textType text, Return, hotkey, type then ReturnAX and PX where supportedBackground and foreground
ScrollScrollAX and PX where supportedBackground and foreground
Child windowsOpen child windowAX and PXBackground and foreground
DragDrag source to drop targetPXBackground and foreground
State controlsCheckbox, radio, combo, sliderAX or PX by controlMode declared per action
EditorType, save, saved-state readbackAX and PX where supportedMode declared per action

The Rust shared catalog declares 40 evidence-bearing cells per harness application. Windows and Linux run 80 shared cells across Electron and Tauri; macOS also runs the native WKWebView host for 120 shared cells. Each host covers the full AX/PX and foreground/background cross-product for click, text, keyboard, sequential type-then-Return, scroll, and child-window actions, plus both delivery modes for PX drag and AX editor-save. A background capability refusal is a valid result only when the test verifies the declared structured refusal and the no-focus/no-z-order/no-input-leak side effect. Background posture requires one foreground window to contain the target geometry, not merely overlap it. The lane preflight also injects deliberate focus and input violations and requires the sentinel to detect both before its results are trusted. A refusal fails a cell whose contract requires delivery. Canonical reporting rejects skips and enforces the complete shared catalog size for unfiltered runs. Diagnostic filters are allowed, but matching zero cells is always an error.

Harness E2E: Native Windows

Windows native harnesses are repo-local applications built from source:

HarnessSource testCoverage
WPFharness_wpf_test.rsUIA controls, text, keys, pointer actions, scroll, drag, popups, menus, modal windows
WinUI3harness_winui3_test.rsXAML controls, text, checkbox/radio, slider, combo, popup
WebView2harness_web_test.rsWindow discovery, CDP page access, JavaScript, DOM click path
Desktop scopedesktop_scope_windows_test.rsConcurrent strict window/desktop sessions, full-display capture, screen-absolute click/scroll, and strict rejection
Desktop invariantsTestkit DesktopObserver plus typed launch/capture/cursor ownersCross-cutting focus, z-order, minimized-launch, screenshot, cursor, and desktop checks

Native controls use AX/UIA state as their oracle. Pointer actions also use PX where the tool contract requires coordinates. Current set_value rows declare background delivery and attach desktop-side-effect oracles.

Harness E2E: macOS

HarnessSource testCoverage
AppKitharness_appkit_test.rsAX tree/capture, AX value/text, AX scroll, PX clicks, and foreground slider drag across the proven delivery modes; background drag is an exact refusal
SwiftUIharness_swiftui_test.rsAX tree/capture, background click/value, and foreground popover-trigger state
WKWebViewcross_platform_behavior_test.rsDedicated native host running the full 40-cell shared web catalog
Desktop scopedesktop_scope_macos_test.rsConcurrent strict window/desktop sessions, screen-absolute action delivery, and strict rejection
Installed-app launch/focusinstalled_app_launch_macos_test.rsReal Calculator/TextEdit launch and focus behavior in the canonical logged-in lane
Installed-app textinstalled_app_textedit_macos_test.rsReal TextEdit AX background write and verification in the canonical logged-in lane

macOS uses the installed ScreenCaptureKit/AX permissions for GUI runs. Its maintainer acceptance gate runs in a disposable clone of the stopped Lume SIP-off golden image described in the macOS Lume runner guide. Maintainers build that private seed from the sanitized public base macos-tahoe-cua:26.5.2. The repo-local harnesses are canonical; Calculator and TextEdit are supporting real-app checks. SwiftUI's popover trigger is proven independently from the remaining transient-panel AX discovery gap.

Harness E2E: Linux

HarnessSource testWindow systemCoverage
Electroncross_platform_behavior_test.rsX11 and hosted SwayShared web action matrix
Tauricross_platform_behavior_test.rsX11 and hosted SwayShared web action matrix
GTK3harness_gtk3_test.rsX11/AT-SPI and Wayland/AT-SPI where configuredNative GTK controls and input
Desktop scopedesktop_scope_linux_test.rsX11/WaylandConcurrent strict window/desktop sessions, screen-absolute action delivery, and strict rejection

Nix provides the Linux build and desktop environment. X11 and Wayland are separate matrix dimensions because their capture and input contracts differ. Linux runs do not produce GIF output. Every canonical GUI cell retains an MP4 and trajectory alongside screenshots, AX trees, structured results, and driver logs for E2E evidence.

Action Delivery Matrix

The current per-OS delivery/refusal ledger is maintained in action-support.md. This section defines the coverage policy; the ledger records empirical status.

For each OS and harness where the action is supported, the canonical E2E suite should cover both delivery modes:

ActionBackgroundForegroundAddressing
Left clickRequired delivery or a declared refusal contractRequiredAX, PX
Right clickRequired delivery or a declared refusal contractRequiredAX, PX
Double clickRequired delivery or a declared refusal contractRequiredAX, PX
DragRequired delivery or a declared refusal contractRequiredPX, with AX discovery
ScrollRequired delivery or a declared refusal contractRequiredAX, PX where supported
Type textRequired delivery or a declared refusal contractRequiredAX, PX where supported
Press keyRequired delivery or a declared refusal contractRequiredAX, PX where supported
HotkeyRequired delivery or a declared refusal contractRequiredAX, PX where supported
Set valueRequired in current native rowsNot separately declaredAX/UIA/AXValue
ScreenshotN/AN/AWindow or desktop capture
Page/CDPN/AN/APage selector/JavaScript

N/A means the API has no delivery mode for that operation. A refusal is a passing observation only when the Rust case expects refusal, the exact code is allowed, and the desktop-side-effect oracles pass.

CI And Local Entry Points

GateEnvironmentEntry point
Linux unit/sourceNix Linux CInix build .#checks.x86_64-linux.cua-driver-build .#checks.x86_64-linux.cua-driver-linux-rust-unit
Windows unit/compilewindows-latestPackage-scoped cargo test --all-targets --no-run --locked
Windows Harness E2EActive Windows user sessionscripts/ci/windows/run-rust-e2e.ps1 -RequireGui
Linux X11 Harness E2ENix X11 sessionscripts/ci/linux/run-rust-e2e.sh
Linux Sway Harness E2EControlled wlroots sessionscripts/ci/linux/run-rust-e2e-wayland.sh
Linux nested-compositor E2EControlled experimental sessionscripts/ci/linux/run-rust-e2e-inject.sh
Linux representative desktop E2EExisting GNOME, KDE, or Xorg loginscripts/ci/linux/run-rust-e2e-desktop.sh <desktop>
macOS Harness E2EMaintainer Lume SIP-off worker with a logged-in session and inherited grantspackages/cua-driver/tests/runners/macos-lume/run-all.sh

Workflows select private execution lanes. Rust source owns scenario definitions, fixture oracles, and result records. OS runners only build the driver, stage the local harnesses, establish the desktop session, collect evidence, and publish the shared report.

Evidence And Ownership

Every Harness E2E cell should produce:

text
recordings/<cell-label>-pid<pid>-<sequence>/recording.mp4
recordings/<cell-label>-pid<pid>-<sequence>/trajectory.json
results.jsonl
<rust-target>.log

The GitHub summary links the exact recording path from the corresponding row to its lane archive. Target logs remain lane-level diagnostics. Unit tests need logs and test-result output, but do not need desktop video.

When a new action or modality is added, update this document, the shared fixture oracle, the Rust test, and the OS-specific runner selection together. This is the cross-OS checklist that prevents a Windows-only test from being mistaken for cross-platform coverage.