Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

refactor(cua-driver): move desktop E2E suites into their own test crate (#4144)

Francesco Bonacci9aa0d9199e08
diff --git a/.github/scripts/tests/test_authorized_live_jev_use_demo.py b/.github/scripts/tests/test_authorized_live_jev_use_demo.py
index 70edfa7984..0cbf78d191 100644
--- a/.github/scripts/tests/test_authorized_live_jev_use_demo.py
+++ b/.github/scripts/tests/test_authorized_live_jev_use_demo.py
@@ -10,7 +10,7 @@ import yaml
ROOT = Path(__file__).resolve().parents[3]
WORKFLOW = ROOT / ".github/workflows/authorized-live-jev-use-demo.yml"
ORCHESTRATOR = (
- ROOT / "libs/cua-driver/rust/crates/cua-driver/tests/authorized_live_jev_use_demo_test.rs"
+ ROOT / "libs/cua-driver/rust/crates/cua-driver-e2e/tests/authorized_live_jev_use_demo_test.rs"
)
EVIDENCE_README = ROOT / "libs/cua-driver/tests/perception-demo/README.md"
diff --git a/.github/scripts/tests/test_cua_driver_e2e_inventory.py b/.github/scripts/tests/test_cua_driver_e2e_inventory.py
index d842bd467c..43e737d68c 100644
--- a/.github/scripts/tests/test_cua_driver_e2e_inventory.py
+++ b/.github/scripts/tests/test_cua_driver_e2e_inventory.py
@@ -16,7 +16,10 @@ import pytest
REPO_ROOT = Path(__file__).resolve().parents[3]
-TEST_ROOT = REPO_ROOT / "libs/cua-driver/rust/crates/cua-driver/tests"
+CRATES_ROOT = REPO_ROOT / "libs/cua-driver/rust/crates"
+# Desktop E2E suites live in their own crate; hermetic protocol and CLI tests
+# stay with the driver. Both can hold ignored tests.
+TEST_PACKAGES = ("cua-driver", "cua-driver-e2e")
ALLOWLIST = REPO_ROOT / "libs/cua-driver/tests/manual-e2e-allowlist.txt"
# Canonical runners and the workflows that call them. The Windows Sandbox
@@ -65,14 +68,24 @@ def _ignored_in_source(text: str) -> list[str]:
return names
+def package_test_binaries() -> dict[str, set[str]]:
+ """Map each test package to the integration-test binaries it owns."""
+ return {
+ package: {path.stem for path in (CRATES_ROOT / package / "tests").glob("*.rs")}
+ for package in TEST_PACKAGES
+ }
+
+
def _test_binary_sources() -> dict[str, list[Path]]:
"""Map each integration-test binary to the source files it compiles."""
binaries: dict[str, list[Path]] = {}
- for path in sorted(TEST_ROOT.glob("*.rs")):
- sources = [path]
- for relative in PATH_MOD_RE.findall(path.read_text(encoding="utf-8")):
- sources.append((path.parent / relative).resolve())
- binaries[path.stem] = sources
+ for package in TEST_PACKAGES:
+ for path in sorted((CRATES_ROOT / package / "tests").glob("*.rs")):
+ assert path.stem not in binaries, f"test binary {path.stem} exists in two packages"
+ sources = [path]
+ for relative in PATH_MOD_RE.findall(path.read_text(encoding="utf-8")):
+ sources.append((path.parent / relative).resolve())
+ binaries[path.stem] = sources
return binaries
@@ -164,6 +177,58 @@ def test_allowlist_entries_are_live_and_still_manual() -> None:
assert not routed, "Allowlisted tests are routed; drop them:\n " + "\n ".join(routed)
+PACKAGE_TEST_RE = re.compile(
+ r"(?:-p|--package)\W+(cua-driver(?:-e2e)?)(?![A-Za-z0-9_-])"
+)
+# A workflow step or YAML key also ends a package reference.
+STEP_BOUNDARY_RE = re.compile(r"\n\s*-\s|\n\s*[A-Za-z_-]+:\s")
+TEST_FLAG_RE = re.compile(rf'--test(?:\s+"?|=|",\s*")({IDENT})')
+
+
+def package_test_references(text: str) -> list[tuple[str, str]]:
+ """Return `(package, binary)` for each `-p <package> ... --test <binary>`."""
+ references = []
+ for match in PACKAGE_TEST_RE.finditer(text):
+ rest = text[match.end() :]
+ ends = [
+ found.start()
+ for found in (
+ COMMAND_BOUNDARY_RE.search(rest),
+ STEP_BOUNDARY_RE.search(rest),
+ PACKAGE_TEST_RE.search(rest),
+ )
+ if found
+ ]
+ command = rest[: min(ends)] if ends else rest
+ references.extend((match.group(1), name) for name in TEST_FLAG_RE.findall(command))
+ return references
+
+
+def test_runner_test_targets_exist_in_the_named_package() -> None:
+ """A runner that names the wrong package fails in Cargo, not in review."""
+ owned = package_test_binaries()
+ wrong = sorted(
+ f"{path}: -p {package} --test {binary}"
+ for path, text in runner_texts().items()
+ for package, binary in package_test_references(text)
+ if binary not in owned[package]
+ )
+ assert not wrong, "Runners name test binaries their package lacks:\n " + "\n ".join(wrong)
+
+
+def test_package_reference_detection_is_scoped_to_one_command() -> None:
+ runner = (
+ 'cargo test -p cua-driver-e2e "${ARGS[@]}" \\\n --test harness_gtk3_test -- --ignored\n'
+ 'cargo test -p cua-driver --test protocol_schema_test\n'
+ '"test", "-p", "cua-driver-e2e", "--test", "capture_contract_test", "--",\n'
+ )
+ assert package_test_references(runner) == [
+ ("cua-driver-e2e", "harness_gtk3_test"),
+ ("cua-driver", "protocol_schema_test"),
+ ("cua-driver-e2e", "capture_contract_test"),
+ ]
+
+
def test_inventory_expands_macro_rows_and_support_modules() -> None:
ignored = ignored_tests()
assert ("harness_gtk3_test", "harness_gtk3_left_click_ax_background") in ignored
diff --git a/.github/workflows/authorized-live-jev-use-demo.yml b/.github/workflows/authorized-live-jev-use-demo.yml
index 9fce06712f..9977c5ca39 100644
--- a/.github/workflows/authorized-live-jev-use-demo.yml
+++ b/.github/workflows/authorized-live-jev-use-demo.yml
@@ -245,7 +245,7 @@ jobs:
python libs/cua-driver/tests/perception-demo/test_sanitize_evidence.py -v
python libs/cua-driver/tests/perception-demo/test_evidence_envelope.py -v
python .github/scripts/tests/test_authorized_live_jev_use_demo.py -v
- cargo test --manifest-path libs/cua-driver/rust/Cargo.toml -p cua-driver --test authorized_live_jev_use_demo_test --locked
+ cargo test --manifest-path libs/cua-driver/rust/Cargo.toml -p cua-driver-e2e --test authorized_live_jev_use_demo_test --locked
cargo test --manifest-path libs/cua-driver/rust/Cargo.toml -p cua-perception --locked
candidate:
@@ -478,7 +478,7 @@ jobs:
run: |
$ErrorActionPreference = 'Stop'
$messages = Join-Path $env:RUNNER_TEMP 'candidate-test-build.jsonl'
- cargo test --manifest-path libs/cua-driver/rust/Cargo.toml -p cua-driver --test authorized_live_jev_use_demo_test --locked --no-run --message-format=json-render-diagnostics | Set-Content $messages -Encoding utf8
+ cargo test --manifest-path libs/cua-driver/rust/Cargo.toml -p cua-driver-e2e --test authorized_live_jev_use_demo_test --locked --no-run --message-format=json-render-diagnostics | Set-Content $messages -Encoding utf8
if ($LASTEXITCODE -ne 0) { throw 'candidate test build failed' }
@'
import hashlib, json, os, pathlib, re, subprocess, sys
diff --git a/.github/workflows/ci-nix-linux.yml b/.github/workflows/ci-nix-linux.yml
index 2b4e969830..de65216c30 100644
--- a/.github/workflows/ci-nix-linux.yml
+++ b/.github/workflows/ci-nix-linux.yml
@@ -14,6 +14,7 @@ on:
- "libs/cua-driver/rust/crates/cua-driver/**"
- "libs/cua-driver/rust/crates/cua-driver-core/**"
- "libs/cua-driver/rust/crates/cua-driver-testkit/**"
+ - "libs/cua-driver/rust/crates/cua-driver-e2e/**"
- "libs/cua-driver/rust/crates/cursor-overlay/**"
- "!libs/cua-driver/rust/crates/cursor-overlay/examples/export_gallery_frames.rs"
- "libs/cua-driver/rust/crates/pip-preview/**"
@@ -33,6 +34,7 @@ on:
- "libs/cua-driver/rust/crates/cua-driver/**"
- "libs/cua-driver/rust/crates/cua-driver-core/**"
- "libs/cua-driver/rust/crates/cua-driver-testkit/**"
+ - "libs/cua-driver/rust/crates/cua-driver-e2e/**"
- "libs/cua-driver/rust/crates/cursor-overlay/**"
- "!libs/cua-driver/rust/crates/cursor-overlay/examples/export_gallery_frames.rs"
- "libs/cua-driver/rust/crates/pip-preview/**"
diff --git a/.github/workflows/ci-rust-linux.yml b/.github/workflows/ci-rust-linux.yml
index 6eeebeeb4b..5f17995cc8 100644
--- a/.github/workflows/ci-rust-linux.yml
+++ b/.github/workflows/ci-rust-linux.yml
@@ -11,6 +11,7 @@ on:
- "libs/cua-driver/rust/crates/cua-driver-contract/**"
- "libs/cua-driver/rust/crates/cua-driver-core/**"
- "libs/cua-driver/rust/crates/cua-driver-testkit/**"
+ - "libs/cua-driver/rust/crates/cua-driver-e2e/**"
- "libs/cua-driver/rust/crates/cursor-overlay/**"
- "libs/cua-driver/rust/crates/pip-preview/**"
- "libs/cua-driver/rust/crates/platform-linux/**"
@@ -32,6 +33,7 @@ on:
- "libs/cua-driver/rust/crates/cua-driver-contract/**"
- "libs/cua-driver/rust/crates/cua-driver-core/**"
- "libs/cua-driver/rust/crates/cua-driver-testkit/**"
+ - "libs/cua-driver/rust/crates/cua-driver-e2e/**"
- "libs/cua-driver/rust/crates/cursor-overlay/**"
- "libs/cua-driver/rust/crates/pip-preview/**"
- "libs/cua-driver/rust/crates/platform-linux/**"
@@ -134,14 +136,14 @@ jobs:
working-directory: libs/cua-driver/rust
env:
CUA_TEST_REQUIRE_DRIVER_BIN: "1"
- run: cargo test -p cua-driver -p cua-driver-contract -p cua-driver-core -p cua-driver-testkit -p cursor-overlay -p cursor-theme-cli -p platform-linux --all-targets --locked
+ run: cargo test -p cua-driver -p cua-driver-e2e -p cua-driver-contract -p cua-driver-core -p cua-driver-testkit -p cursor-overlay -p cursor-theme-cli -p platform-linux --all-targets --locked
- name: Compile and link an async-io embedded host
working-directory: libs/cua-driver/rust
run: cargo test -p cua-driver-sdk --test async_io_embedding --locked
- name: Verify final-frame extraction without a desktop
working-directory: libs/cua-driver/rust
run: |
- cargo test -p cua-driver --test e2e_environment_preflight_test --locked -- \
+ cargo test -p cua-driver-e2e --test e2e_environment_preflight_test --locked -- \
--ignored --exact last_frame_extraction_handles_long_final_duration_and_invalid_input --nocapture
- name: Run X11 keyboard tap timing regression
working-directory: libs/cua-driver/rust
diff --git a/.github/workflows/ci-rust-macos.yml b/.github/workflows/ci-rust-macos.yml
index a82eb59694..3d91f57b99 100644
--- a/.github/workflows/ci-rust-macos.yml
+++ b/.github/workflows/ci-rust-macos.yml
@@ -12,8 +12,8 @@ on:
- "libs/cua-driver/rust/crates/cursor-overlay/**"
- "libs/cua-driver/rust/crates/pip-preview/**"
- "libs/cua-driver/rust/crates/platform-macos/**"
- - "libs/cua-driver/rust/crates/cua-driver/tests/**"
- "libs/cua-driver/rust/crates/cua-driver-testkit/**"
+ - "libs/cua-driver/rust/crates/cua-driver-e2e/**"
- ".github/workflows/ci-rust-macos.yml"
push:
branches: [main]
@@ -27,8 +27,8 @@ on:
- "libs/cua-driver/rust/crates/cursor-overlay/**"
- "libs/cua-driver/rust/crates/pip-preview/**"
- "libs/cua-driver/rust/crates/platform-macos/**"
- - "libs/cua-driver/rust/crates/cua-driver/tests/**"
- "libs/cua-driver/rust/crates/cua-driver-testkit/**"
+ - "libs/cua-driver/rust/crates/cua-driver-e2e/**"
- ".github/workflows/ci-rust-macos.yml"
workflow_dispatch:
@@ -66,13 +66,10 @@ jobs:
- name: Run cua-driver-core unit tests on macOS
working-directory: libs/cua-driver/rust
run: cargo test --locked -p cua-driver-core --lib
- # Desktop-bound cua-driver integration tests are #[ignore] and run in the
- # Lume harness. The hermetic tests compiled only into macOS-gated
- # binaries have no other runner: the harness's own FIFO backpressure
- # self-tests and the standalone-browser command builders.
- - name: Run hermetic macOS-only cua-driver integration tests
+ # Desktop E2E suites are #[ignore] and run in the Lume harness. Their
+ # hermetic oracle and parser tests run here as a whole crate, including
+ # the macOS-gated ones that have no other runner: the harness's FIFO
+ # backpressure self-tests and the standalone-browser command builders.
+ - name: Run hermetic cua-driver-e2e tests on macOS
working-directory: libs/cua-driver/rust
- run: >-
- cargo test --locked -p cua-driver
- --test harness_appkit_test
- --test standalone_browser_behavior_test
+ run: cargo test --locked -p cua-driver-e2e
diff --git a/.github/workflows/ci-rust-windows.yml b/.github/workflows/ci-rust-windows.yml
index 61fefa672d..aa5b4457d8 100644
--- a/.github/workflows/ci-rust-windows.yml
+++ b/.github/workflows/ci-rust-windows.yml
@@ -10,6 +10,7 @@ on:
- "libs/cua-driver/rust/crates/cua-driver-core/**"
- "libs/cua-driver/rust/crates/cua-driver-sdk/**"
- "libs/cua-driver/rust/crates/cua-driver-testkit/**"
+ - "libs/cua-driver/rust/crates/cua-driver-e2e/**"
- "libs/cua-driver/rust/crates/cursor-overlay/**"
- "libs/cua-driver/rust/crates/pip-preview/**"
- "libs/cua-driver/rust/crates/platform-windows/**"
@@ -26,6 +27,7 @@ on:
- "libs/cua-driver/rust/crates/cua-driver-core/**"
- "libs/cua-driver/rust/crates/cua-driver-sdk/**"
- "libs/cua-driver/rust/crates/cua-driver-testkit/**"
+ - "libs/cua-driver/rust/crates/cua-driver-e2e/**"
- "libs/cua-driver/rust/crates/cursor-overlay/**"
- "libs/cua-driver/rust/crates/pip-preview/**"
- "libs/cua-driver/rust/crates/platform-windows/**"
@@ -69,7 +71,7 @@ jobs:
working-directory: libs/cua-driver/rust
# Compile every Rust target without executing desktop-dependent integration
# tests; interactive behavior belongs in e2e-rust-windows.yml.
- run: cargo test -p cua-driver -p cua-driver-core -p cua-driver-sdk -p cua-driver-testkit -p cursor-overlay -p cursor-theme-cli -p platform-windows -p cua-driver-uia --all-targets --no-run --locked
+ run: cargo test -p cua-driver -p cua-driver-e2e -p cua-driver-core -p cua-driver-sdk -p cua-driver-testkit -p cursor-overlay -p cursor-theme-cli -p platform-windows -p cua-driver-uia --all-targets --no-run --locked
- name: Run complete desktop-independent core tests
working-directory: libs/cua-driver/rust
run: cargo test -p cua-driver-core --lib --test recording_shutdown_errors --locked
diff --git a/.github/workflows/ci-test-scripts.yml b/.github/workflows/ci-test-scripts.yml
index 468aa3ce5f..cde04e647e 100644
--- a/.github/workflows/ci-test-scripts.yml
+++ b/.github/workflows/ci-test-scripts.yml
@@ -53,6 +53,8 @@ on:
- "libs/cua-driver/tests/runners/windows/**"
# The E2E inventory test checks every runner against the ignored tests.
- "libs/cua-driver/tests/manual-e2e-allowlist.txt"
+ - "libs/cua-driver/rust/crates/cua-driver/tests/**"
+ - "libs/cua-driver/rust/crates/cua-driver-e2e/tests/**"
- "scripts/ci/**"
- "scripts/ci/macos/**"
- "libs/cua-driver/tests/perception-demo/**"
diff --git a/Development.md b/Development.md
index 7844fe0dd0..55c22deaad 100644
--- a/Development.md
+++ b/Development.md
@@ -97,7 +97,7 @@ The Rust harnesses are the source of truth for desktop behavior. Python tests
do not duplicate that matrix. Start with:
- [`libs/cua-driver/rust/README.md`](libs/cua-driver/rust/README.md) for the Cargo workspace.
-- [`libs/cua-driver/rust/crates/cua-driver/tests/README.md`](libs/cua-driver/rust/crates/cua-driver/tests/README.md) for test ownership.
+- [`libs/cua-driver/rust/crates/cua-driver-e2e/tests/README.md`](libs/cua-driver/rust/crates/cua-driver-e2e/tests/README.md) for desktop E2E test ownership.
- [`scripts/ci/README.md`](scripts/ci/README.md) for canonical OS runners.
- [Platform support](https://cua.ai/docs/reference/cua-driver/platform-support) for current capability boundaries.
- [How Cua Driver is validated](https://cua.ai/docs/concepts/how-cua-driver-is-validated) for the public evidence model.
diff --git a/docs/content/docs/reference/cua-driver/development.mdx b/docs/content/docs/reference/cua-driver/development.mdx
index c59469e8f0..bff6467d59 100644
--- a/docs/content/docs/reference/cua-driver/development.mdx
+++ b/docs/content/docs/reference/cua-driver/development.mdx
@@ -15,14 +15,15 @@ they stay close to implementation changes.
| `libs/cua-driver/typescript` | Rust-backed TypeScript SDK plus Node and Electron embedded-host adapters |
| `libs/cua-driver/python` | Python package wrapper around the driver binary |
| `libs/cua-driver/tests/fixtures` | Source-built GUI harness apps and shared fixtures |
-| `libs/cua-driver/rust/crates/cua-driver/tests` | Rust integration tests for the driver and GUI harnesses |
+| `libs/cua-driver/rust/crates/cua-driver/tests` | Hermetic Rust integration tests for the driver |
+| `libs/cua-driver/rust/crates/cua-driver-e2e/tests` | Desktop E2E suites for the GUI harnesses |
| `libs/cua-driver/scripts` | Install, uninstall, local build, and VM sync helpers |
## Contributor Entry Points
- `libs/cua-driver/README.md` gives the repo-local overview.
- `libs/cua-driver/rust/README.md` maps the Cargo workspace and test classes.
-- `libs/cua-driver/rust/crates/cua-driver/tests/README.md` explains Rust test naming and ignored GUI lanes.
+- `libs/cua-driver/rust/crates/cua-driver-e2e/tests/README.md` explains the desktop E2E suites and ignored GUI lanes.
- `libs/cua-driver/tests/fixtures/README.md` explains source-built harness apps and staged outputs.
- `libs/cua-driver/scripts/README.md` explains install and VM sync helpers.
diff --git a/libs/cua-driver/README.md b/libs/cua-driver/README.md
index 03b98211f6..856a07d060 100644
--- a/libs/cua-driver/README.md
+++ b/libs/cua-driver/README.md
@@ -105,11 +105,12 @@ reference](https://cua.ai/docs/reference/cua-driver/permission-modes).
| `contract/` | Experimental generated SDK contract and fixtures |
| `typescript/` | Generated TypeScript SDK |
| `tests/fixtures/` | Source-built GUI harness apps and shared fixtures |
-| `rust/crates/cua-driver/tests/` | Rust integration tests for the driver and GUI harnesses |
+| `rust/crates/cua-driver/tests/` | Hermetic Rust integration tests for the driver |
+| `rust/crates/cua-driver-e2e/tests/` | Desktop E2E suites for the GUI harnesses |
| `scripts/` | Install, uninstall, local build, and VM sync helpers |
| `docs/` | Small repo-local specs that are not part of the hosted docs site |
-Start with `rust/README.md`, `rust/crates/cua-driver/tests/README.md`, and
+Start with `rust/README.md`, `rust/crates/cua-driver-e2e/tests/README.md`, and
`tests/fixtures/README.md` when changing driver behavior or tests.
The contract-first SDK architecture is documented in
diff --git a/libs/cua-driver/docs/test-harnesses-guide.md b/libs/cua-driver/docs/test-harnesses-guide.md
index 77e8a47e39..4cdf4a632b 100644
--- a/libs/cua-driver/docs/test-harnesses-guide.md
+++ b/libs/cua-driver/docs/test-harnesses-guide.md
@@ -67,7 +67,7 @@ the runner's required cells, assertions, and evidence checks. Record compositor
and backend provenance; an X11 run does not establish native Hyprland coverage.
Environment failures and failed cells remain failures, not permission to skip
tests or change expected results. In the same desktop, also run
-`cargo test -p cua-driver --test hyprland_foreground_test -- --ignored --test-threads=1`
+`cargo test -p cua-driver-e2e --test hyprland_foreground_test -- --ignored --test-threads=1`
and the same command for `hyprland_native_observation_test`. No automated lane
runs these foreground-safety and exact-identity rows, so
`tests/manual-e2e-allowlist.txt` records them as a manual native-Hyprland gate.
@@ -150,7 +150,8 @@ cua/
|-- libs/cua-driver/
| |-- rust/
| | |-- crates/
-| | | |-- cua-driver/ Rust driver and integration tests
+| | | |-- cua-driver/ Rust driver and hermetic integration tests
+| | | |-- cua-driver-e2e/ Desktop E2E suites the OS runners select
| | | |-- cua-driver-core/ Shared driver logic and unit tests
| | | |-- cua-driver-testkit/ Shared Rust E2E helpers and evidence capture
| | | |-- platform-linux/ Linux backend
@@ -227,15 +228,20 @@ reached an application.
### Harness E2E Tests
-These are Rust integration tests under:
+These are Rust integration tests in their own crate:
```text
-libs/cua-driver/rust/crates/cua-driver/tests/
+libs/cua-driver/rust/crates/cua-driver-e2e/tests/
```
-Most are marked `#[ignore]` because they require a desktop, built fixtures, and
-platform permissions. They are selected by the OS runner rather than the
-ordinary unit command.
+Hermetic protocol, CLI, and schema tests stay in
+`libs/cua-driver/rust/crates/cua-driver/tests/`. A test that needs a desktop,
+built fixtures, installed apps, or platform permissions belongs in
+`cua-driver-e2e`. Most E2E tests are marked `#[ignore]`; the OS runner selects
+them with `cargo test -p cua-driver-e2e --test <suite> -- --ignored`. The
+crate does not depend on the driver, so build `cua-driver` first or set
+`CUA_TEST_DRIVER_BIN`. Its few non-ignored tests are hermetic oracle and
+parser checks that ordinary CI runs with the driver's tests.
The canonical E2E suite has two behavior owners:
@@ -546,7 +552,7 @@ to give each behavior one clear owner and make cross-cutting evidence reusable.
rust/crates/cua-driver-testkit/src/
`-- observer.rs Cross-OS desktop-side-effect interface
-rust/crates/cua-driver/tests/
+rust/crates/cua-driver-e2e/tests/
|-- cross_platform_behavior_test.rs Shared Electron/Tauri action matrix
|-- harness_wpf_test.rs Windows WPF action rows
|-- harness_winui3_test.rs Windows WinUI3 action rows
@@ -555,7 +561,9 @@ rust/crates/cua-driver/tests/
|-- harness_swiftui_test.rs macOS SwiftUI action rows
|-- harness_gtk3_test.rs Linux GTK3 action rows
|-- capture_contract_test.rs Tree and screenshot read contract
-|-- desktop_scope_<os>_test.rs Window/desktop scope invariants
+`-- desktop_scope_<os>_test.rs Window/desktop scope invariants
+
+rust/crates/cua-driver/tests/
`-- protocol_*_test.rs Protocol and schema tests
```
@@ -576,7 +584,7 @@ user-facing command; lane selectors are internal diagnostics.
When adding a new scenario:
1. Add or update the repo-local fixture and its external state marker.
-2. Add the Rust scenario under `rust/crates/cua-driver/tests/`.
+2. Add the Rust scenario under `rust/crates/cua-driver-e2e/tests/`.
3. Declare AX/PX addressing, foreground/background delivery, scope, and oracle.
4. Add the scenario to `docs/test-matrix.md` and this guide when it changes the
cross-OS structure.
diff --git a/libs/cua-driver/docs/test-matrix.md b/libs/cua-driver/docs/test-matrix.md
index 210309f211..89f7669d11 100644
--- a/libs/cua-driver/docs/test-matrix.md
+++ b/libs/cua-driver/docs/test-matrix.md
@@ -70,7 +70,7 @@ 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`
+- `rust/crates/cua-driver-e2e/tests/cross_platform_behavior_test.rs`
The shared harness exposes deterministic external markers for these actions:
diff --git a/libs/cua-driver/rust/Cargo.lock b/libs/cua-driver/rust/Cargo.lock
index f5e68308e4..7a51a5a15c 100644
--- a/libs/cua-driver/rust/Cargo.lock
+++ b/libs/cua-driver/rust/Cargo.lock
@@ -1206,7 +1206,6 @@ dependencies = [
"base64",
"cap-fs-ext",
"cap-std",
- "core-foundation",
"cua-driver-contract",
"cua-driver-core",
"cua-driver-sdk",
@@ -1215,7 +1214,6 @@ dependencies = [
"embed-resource",
"flate2",
"fs2",
- "futures-util",
"httparse",
"image",
"jsonschema",
@@ -1233,7 +1231,6 @@ dependencies = [
"tar",
"tempfile",
"tokio",
- "tokio-tungstenite",
"tracing",
"tracing-subscriber",
"ureq",
@@ -1298,6 +1295,32 @@ dependencies = [
"zune-core",
]
+[[package]]
+name = "cua-driver-e2e"
+version = "0.28.4"
+dependencies = [
+ "base64",
+ "core-foundation",
+ "cua-driver-contract",
+ "cua-driver-core",
+ "cua-driver-sdk",
+ "cua-driver-testkit",
+ "cursor-overlay",
+ "futures-util",
+ "image",
+ "jsonschema",
+ "libc",
+ "platform-linux",
+ "platform-windows",
+ "serde",
+ "serde_json",
+ "sha2",
+ "tempfile",
+ "tokio",
+ "tokio-tungstenite",
+ "windows 0.61.3",
+]
+
[[package]]
name = "cua-driver-sdk"
version = "0.28.4"
diff --git a/libs/cua-driver/rust/Cargo.toml b/libs/cua-driver/rust/Cargo.toml
index 23007e87a0..3d09b37bce 100644
--- a/libs/cua-driver/rust/Cargo.toml
+++ b/libs/cua-driver/rust/Cargo.toml
@@ -6,6 +6,7 @@ members = [
"crates/cua-driver-sdk",
"crates/cua-driver-bindgen",
"crates/cua-driver-testkit",
+ "crates/cua-driver-e2e",
"crates/cua-driver-uia",
"crates/cua-driver-core",
"crates/platform-macos",
diff --git a/libs/cua-driver/rust/README.md b/libs/cua-driver/rust/README.md
index 7a630e741e..c9581829b7 100644
--- a/libs/cua-driver/rust/README.md
+++ b/libs/cua-driver/rust/README.md
@@ -7,7 +7,8 @@ implementations, testkit, and helper crates.
| Crate | Purpose |
| --- | --- |
-| `cua-driver` | Main CLI/MCP daemon and integration tests |
+| `cua-driver` | Main CLI/MCP daemon and hermetic integration tests |
+| `cua-driver-e2e` | Desktop E2E suites that the canonical OS runners select; never shipped |
| `cua-driver-core` | Shared protocol, tool models, config, and CDP helpers |
| `platform-macos` | macOS AX, capture, input, browser, and daemon support |
| `platform-windows` | Windows UIA, capture, input, overlay, and diagnostics |
@@ -57,15 +58,18 @@ cargo test -p cua-driver-core
cargo test -p cua-driver --test protocol_schema_test
```
-GUI and VM-backed tests are marked `#[ignore]` and require harness apps from
-`../tests/fixtures/build/` plus a real interactive desktop session:
+GUI and VM-backed tests live in `cua-driver-e2e`, are marked `#[ignore]`, and
+require a built driver, harness apps from `../tests/fixtures/build/`, and a
+real interactive desktop session:
```bash
-cargo test -p cua-driver --test harness_appkit_test -- --ignored --nocapture
-cargo test -p cua-driver --test harness_wpf_test -- --ignored --nocapture
+cargo build -p cua-driver
+cargo test -p cua-driver-e2e --test harness_appkit_test -- --ignored --nocapture
+cargo test -p cua-driver-e2e --test harness_wpf_test -- --ignored --nocapture
```
-See `crates/cua-driver/tests/README.md` for the test matrix.
+See `crates/cua-driver-e2e/tests/README.md` for the desktop E2E suites and
+`crates/cua-driver/tests/README.md` for the hermetic driver tests.
## Generated Outputs
diff --git a/libs/cua-driver/rust/crates/cua-driver-e2e/Cargo.toml b/libs/cua-driver/rust/crates/cua-driver-e2e/Cargo.toml
new file mode 100644
index 0000000000..168be52523
--- /dev/null
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/Cargo.toml
@@ -0,0 +1,58 @@
+[package]
+name = "cua-driver-e2e"
+version.workspace = true
+edition.workspace = true
+authors.workspace = true
+license.workspace = true
+repository.workspace = true
+description = "Desktop E2E suites for cua-driver. The canonical OS harnesses run them against a built driver; never shipped."
+publish = false
+
+# The suites live in tests/. They drive a separately built `cua-driver`
+# binary that the testkit resolves from CUA_TEST_DRIVER_BIN or the Cargo
+# target directory, so this crate has no dependency on the driver itself.
+[lib]
+path = "src/lib.rs"
+test = false
+doctest = false
+
+[features]
+default = []
+# Linux runners pass the driver's portal features through unchanged so the
+# in-process platform helpers the suites call match the driver they test.
+portal-input = ["platform-linux/portal-input"]
+portal-capture = ["platform-linux/portal-capture"]
+portal-libei = ["platform-linux/portal-libei"]
+
+[dev-dependencies]
+cua-driver-testkit = { path = "../cua-driver-testkit" }
+cua-driver-core = { path = "../cua-driver-core" }
+cua-driver-contract = { path = "../cua-driver-contract" }
+cua-driver-sdk = { path = "../cua-driver-sdk" }
+cursor-overlay = { path = "../cursor-overlay" }
+serde = { workspace = true }
+serde_json = { workspace = true }
+sha2 = { workspace = true }
+image = { workspace = true }
+base64 = { workspace = true }
+tokio = { workspace = true, features = ["full"] }
+jsonschema = { version = "0.46", default-features = false }
+tempfile = "3"
+futures-util = "0.3"
+tokio-tungstenite = "0.24"
+
+[target.'cfg(unix)'.dev-dependencies]
+libc = "0.2"
+
+[target.'cfg(target_os = "linux")'.dependencies]
+platform-linux = { path = "../platform-linux" }
+
+[target.'cfg(target_os = "macos")'.dev-dependencies]
+core-foundation = "0.10"
+
+[target.'cfg(target_os = "windows")'.dev-dependencies]
+platform-windows = { path = "../platform-windows" }
+windows = { version = "0.61", features = [
+ "Win32_Foundation",
+ "Win32_UI_WindowsAndMessaging",
+] }
diff --git a/libs/cua-driver/rust/crates/cua-driver-e2e/src/lib.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/src/lib.rs
new file mode 100644
index 0000000000..533cef8bb1
--- /dev/null
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/src/lib.rs
@@ -0,0 +1,6 @@
+//! Desktop E2E suites for `cua-driver`.
+//!
+//! This crate has no library code. Its integration tests in `tests/` drive a
+//! built `cua-driver` binary against real desktops and staged harness apps.
+//! Most suites are `#[ignore]`d and run only through the canonical OS runners
+//! listed in `libs/cua-driver/docs/test-harnesses-guide.md`.
diff --git a/libs/cua-driver/rust/crates/cua-driver-e2e/tests/README.md b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/README.md
new file mode 100644
index 0000000000..c7c8640b97
--- /dev/null
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/README.md
@@ -0,0 +1,159 @@
+# cua-driver desktop E2E suites
+
+Tests in this crate drive a built `cua-driver` binary against real desktops,
+staged harness apps, and installed apps. Most are marked `#[ignore]` because
+they need an interactive desktop; the canonical OS runners select them. The
+few non-ignored tests are hermetic oracle and parser checks.
+
+Hermetic protocol, CLI, and schema tests stay with the driver in
+`../../cua-driver/tests/`. Put a new test here when it needs a desktop, a
+fixture app, an installed app, or OS permissions.
+
+This crate does not depend on the driver. Build `cua-driver` first, or point
+`CUA_TEST_DRIVER_BIN` at a built binary; the testkit otherwise looks for it in
+the Cargo target directory.
+
+Start with the contributor overview in
+`../../../../docs/test-harnesses-guide.md`, then use the matrix below as the
+coverage map.
+
+The cross-OS ownership map is maintained in
+`../../../../docs/test-matrix.md`. Update that matrix when adding a harness,
+action, addressing mode, delivery mode, or OS-specific window-system case.
+
+## Naming
+
+| Prefix | Purpose |
+| --- | --- |
+| `harness_<toolkit>_test.rs` | Toolkit-specific harness apps |
+| `cross_platform_behavior_test.rs` | Shared Electron/Tauri/WKWebView action matrix |
+| `desktop_scope_<os>_test.rs` | Platform window/desktop scope contract |
+| `installed_app_*_test.rs`, `standalone_browser_behavior_test.rs` | Installed apps and browsers |
+| `*_<os>_test.rs`, `hyprland_*_test.rs`, `wayland_*_test.rs` | Platform- or compositor-specific desktop rows |
+
+## Harness Requirements
+
+Build harness apps before running ignored tests:
+
+```bash
+# macOS
+../../../../tests/fixtures/build/macos.sh
+
+# Linux
+../../../../tests/fixtures/build/linux.sh
+```
+
+```powershell
+# Windows
+..\..\..\..\tests\fixtures\build\windows.ps1
+```
+
+Staged outputs are read from `libs/cua-driver/rust/test-apps/harness-<name>/`.
+
+The canonical cross-platform matrix is
+`cross_platform_behavior_test.rs`. It runs the same external-state scenarios
+against Electron and Tauri on each supported host, plus the native WKWebView
+host on macOS. CI and VM runners set
+`CUA_TEST_DRIVER_BIN`, `CUA_TEST_APPS_ROOT`, and
+`CUA_TEST_WORKSPACE_ROOT` when artifacts are built outside Cargo's default
+workspace paths. They also set `CUA_TEST_REQUIRE_FIXTURES=1`, turning a missing
+fixture into a failure instead of a silent skip.
+
+Each matrix row declares its action, AX/PX targeting, foreground or background
+delivery, scope, driver route, external oracles, and required behavior in
+`cases.jsonl`. `results.jsonl` records the observed behavior and derived test
+status. The Rust reporter validates both files and renders `summary.md`.
+
+The canonical OS runners also set
+`CUA_E2E_RECORDINGS_ROOT`. Every testkit `McpDriver` then records its full
+desktop trajectory to a unique directory containing `recording.mp4`, cursor
+samples, action JSON, per-turn screenshots, and a `trajectory.json` test-label
+manifest. Windows and Linux require
+FFmpeg; macOS uses the installed driver's ScreenCaptureKit backend. The runner
+validates each MP4 with `ffprobe` before reporting success. A separate Rust
+preflight verifies the desktop, fixture, AX tree, screenshot, and video
+lifecycle once before behavioral cells run.
+
+## Running
+
+```bash
+cargo build -p cua-driver
+cargo test -p cua-driver-e2e --test harness_appkit_test -- --ignored --nocapture
+cargo test -p cua-driver-e2e --test desktop_scope_macos_test -- --ignored --nocapture
+```
+
+The canonical Windows E2E entrypoint is
+`scripts/ci/windows/run-rust-e2e.ps1 -RequireGui`.
+It runs the complete Rust harness matrix; internal lane selectors are retained
+only for focused diagnosis. Optional
+external-app suites remain separate.
+
+The canonical macOS E2E entrypoint is
+`libs/cua-driver/tests/runners/macos-lume/run-all.sh`. It runs in a disposable
+clone of the private maintainer seed, or in a SIP-off worker prepared with the
+checked-in macOS consent seed helper. It requires a logged-in user session and
+verifies the installed driver's Accessibility and Screen Recording grants before
+delegating to `scripts/ci/macos/run-rust-e2e.sh`.
+
+For focused macOS runs on a workstation shared with other driver clients,
+start a TCC-authorized daemon on a dedicated socket and set
+`CUA_E2E_MACOS_DAEMON_SOCKET` to that socket. This prevents an unrelated MCP
+client from changing the shared daemon's session or recording state while a
+row is asserting focus preservation.
+
+Legacy Windows Sandbox runs use
+`../../../../tests/runners/windows-sandbox/run-tests-in-sandbox.ps1`, which
+builds selected Windows harness apps and maps them into the sandbox. The current
+Windows GUI validation path should use a real user desktop session through RDP
+or an interactive scheduled task.
+
+Windows GUI tests require a usable interactive desktop. SSH-launched commands start in Session 0 and
+cannot drive the user's desktop directly; launch GUI tests through an
+interactive scheduled task (`/IT`) or equivalent so they run in the logged-on
+user session.
+
+The testkit's native `DesktopObserver` records foreground-window, z-order,
+cursor, and leaked-input state around rows that promise no desktop side effects.
+If the input desktop is not `Default` or cannot be opened, the session is
+usually locked or disconnected. Reconnect, use `tscon /dest:console` on a
+disposable GUI VM, or boot the VM into an unlocked console session before
+running ignored GUI tests.
+
+Set `CUA_REQUIRE_GUI=1` on dedicated GUI runners to turn these desktop
+self-skips into hard failures with the full desktop-state diagnostic.
+
+The repository-level runners are the preferred entrypoints for the canonical
+matrix:
+
+```bash
+scripts/ci/linux/run-rust-e2e.sh
+```
+
+```powershell
+.\scripts\ci\windows\run-rust-e2e.ps1 -RequireGui
+```
+
+## Optional External Apps
+
+These suites are Rust source-of-truth coverage for real installed apps, but they
+are not part of the canonical run-all path because they depend on software or
+desktop state outside the repo-local fixtures:
+
+- `harness_libreoffice_test.rs`: Windows LibreOffice Writer, the only coverage
+ of the SAL/VCL MSAA fallback. Requires LibreOffice installed, or
+ `LO_SWRITER_EXE` pointing at `swriter.exe`; it fails when Writer is missing.
+- `installed_app_launch_macos_test.rs`: macOS Calculator/TextEdit launch focus
+ checks. Requires a logged-in GUI session and usable System Events scripting.
+- `installed_app_textedit_macos_test.rs`: real TextEdit background AX write and
+ verification. Requires a logged-in GUI session and Accessibility permission.
+- `standalone_browser_behavior_test.rs`: installed Chrome and Edge browser-tool
+ targeting, mutation, frame, tab, ambiguity, and isolated-profile rows. The
+ harness owns a fresh browser profile and creates adversarial tabs and windows
+ through the browser endpoint instead of relying on browser command-line
+ handoff behavior. Run it through the cross-platform
+ `scripts/ci/run-rust-standalone-browser-e2e.sh`, which stages the Electron
+ foreground sentinel when needed and opts pure Wayland runs into the native
+ backend. Non-macOS runs prove that standard mode refuses existing-profile
+ attachment before running the authorized success rows with a disposable
+ unrestricted daemon. The macOS Lume `run-all.sh` acceptance run always
+ includes the success rows.
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/agent_cursor_showcase_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/agent_cursor_showcase_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/agent_cursor_showcase_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/agent_cursor_showcase_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/agent_cursor_windows_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/agent_cursor_windows_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/agent_cursor_windows_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/agent_cursor_windows_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/authorized_live_jev_use_demo_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/authorized_live_jev_use_demo_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/authorized_live_jev_use_demo_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/authorized_live_jev_use_demo_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/bring_to_front_macos_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/bring_to_front_macos_test.rs
similarity index 99%
rename from libs/cua-driver/rust/crates/cua-driver/tests/bring_to_front_macos_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/bring_to_front_macos_test.rs
index 781ecf8403..edf46637e2 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/bring_to_front_macos_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/bring_to_front_macos_test.rs
@@ -6,7 +6,7 @@
//! WindowServer front-to-back order.
//!
//! Run with:
-//! `cargo test -p cua-driver --test bring_to_front_macos_test -- --ignored --nocapture --test-threads=1`
+//! `cargo test -p cua-driver-e2e --test bring_to_front_macos_test -- --ignored --nocapture --test-threads=1`
#![cfg(target_os = "macos")]
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/capture_contract_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/capture_contract_test.rs
similarity index 99%
rename from libs/cua-driver/rust/crates/cua-driver/tests/capture_contract_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/capture_contract_test.rs
index 574a01adc6..3de25dacd9 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/capture_contract_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/capture_contract_test.rs
@@ -12,7 +12,7 @@
//! * `capture_mode:"vision"` (deprecated) → IGNORED; still returns both.
//!
//! Run explicitly:
-//! cargo test -p cua-driver --test capture_contract_test -- --ignored --nocapture --test-threads=1
+//! cargo test -p cua-driver-e2e --test capture_contract_test -- --ignored --nocapture --test-threads=1
#![cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))]
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/computer_history_cross_platform_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/computer_history_cross_platform_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/computer_history_cross_platform_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/computer_history_cross_platform_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/computer_history_macos_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/computer_history_macos_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/computer_history_macos_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/computer_history_macos_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/cross_platform_behavior_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/cross_platform_behavior_test.rs
similarity index 99%
rename from libs/cua-driver/rust/crates/cua-driver/tests/cross_platform_behavior_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/cross_platform_behavior_test.rs
index ee92106cc8..6e068ba4ae 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/cross_platform_behavior_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/cross_platform_behavior_test.rs
@@ -12,7 +12,7 @@
//! Run after building the shared fixtures:
//!
//! ```text
-//! cargo test -p cua-driver --test cross_platform_behavior_test -- --ignored \
+//! cargo test -p cua-driver-e2e --test cross_platform_behavior_test -- --ignored \
//! --nocapture --test-threads=1
//! ```
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/desktop_scope_linux_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/desktop_scope_linux_test.rs
similarity index 99%
rename from libs/cua-driver/rust/crates/cua-driver/tests/desktop_scope_linux_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/desktop_scope_linux_test.rs
index 5f3d37558b..1949de5324 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/desktop_scope_linux_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/desktop_scope_linux_test.rs
@@ -15,7 +15,7 @@
//! sessions can use different capture scopes without shared mutable config.
//!
//! #[ignore] (needs an X11/Xwayland display + AT-SPI + the GTK3 harness). Run:
-//! cargo test -p cua-driver --test desktop_scope_linux_test -- --ignored --nocapture --test-threads=1
+//! cargo test -p cua-driver-e2e --test desktop_scope_linux_test -- --ignored --nocapture --test-threads=1
#![cfg(target_os = "linux")]
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/desktop_scope_macos_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/desktop_scope_macos_test.rs
similarity index 99%
rename from libs/cua-driver/rust/crates/cua-driver/tests/desktop_scope_macos_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/desktop_scope_macos_test.rs
index 1d8111df59..2a1475361a 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/desktop_scope_macos_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/desktop_scope_macos_test.rs
@@ -16,7 +16,7 @@
//!
//! #[ignore] (needs a real desktop session + TCC Accessibility + the AppKit
//! harness). Run:
-//! cargo test -p cua-driver --test desktop_scope_macos_test -- --ignored --nocapture --test-threads=1
+//! cargo test -p cua-driver-e2e --test desktop_scope_macos_test -- --ignored --nocapture --test-threads=1
#![cfg(target_os = "macos")]
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/desktop_scope_windows_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/desktop_scope_windows_test.rs
similarity index 99%
rename from libs/cua-driver/rust/crates/cua-driver/tests/desktop_scope_windows_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/desktop_scope_windows_test.rs
index a47f7e038e..2563491784 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/desktop_scope_windows_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/desktop_scope_windows_test.rs
@@ -17,7 +17,7 @@
//! proves capture policy is isolated per session rather than process-global.
//!
//! All tests are `#[ignore]` (need a real desktop session). Run explicitly:
-//! cargo test -p cua-driver --test desktop_scope_windows_test -- --ignored --nocapture --test-threads=1
+//! cargo test -p cua-driver-e2e --test desktop_scope_windows_test -- --ignored --nocapture --test-threads=1
#![cfg(target_os = "windows")]
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/e2e_environment_preflight_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/e2e_environment_preflight_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/e2e_environment_preflight_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/e2e_environment_preflight_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/harness_appkit_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_appkit_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/harness_appkit_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_appkit_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/harness_gtk3_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_gtk3_test.rs
similarity index 99%
rename from libs/cua-driver/rust/crates/cua-driver/tests/harness_gtk3_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_gtk3_test.rs
index ead47679c5..e2838accf4 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/harness_gtk3_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_gtk3_test.rs
@@ -6,7 +6,7 @@
//!
//! Requires a Linux desktop, AT-SPI, GTK3, PyGObject, and the fixture built by
//! `tests/fixtures/build/linux.sh`. The canonical lane runs this target with:
-//! cargo test -p cua-driver --test harness_gtk3_test -- --ignored --nocapture --test-threads=1
+//! cargo test -p cua-driver-e2e --test harness_gtk3_test -- --ignored --nocapture --test-threads=1
#![cfg(target_os = "linux")]
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/harness_gtk4_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_gtk4_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/harness_gtk4_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_gtk4_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/harness_libreoffice_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_libreoffice_test.rs
similarity index 99%
rename from libs/cua-driver/rust/crates/cua-driver/tests/harness_libreoffice_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_libreoffice_test.rs
index 43d6f5dde0..85ba315125 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/harness_libreoffice_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_libreoffice_test.rs
@@ -14,7 +14,7 @@
//!
//! Run on an image with LibreOffice installed (override the path with
//! `LO_SWRITER_EXE`):
-//! cargo test -p cua-driver --test harness_libreoffice_test -- --ignored --nocapture
+//! cargo test -p cua-driver-e2e --test harness_libreoffice_test -- --ignored --nocapture
#![cfg(target_os = "windows")]
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/harness_swiftui_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_swiftui_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/harness_swiftui_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_swiftui_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/harness_web_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_web_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/harness_web_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_web_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/harness_winui3_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_winui3_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/harness_winui3_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_winui3_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/harness_wpf_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_wpf_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/harness_wpf_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/harness_wpf_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/hyprland_foreground_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/hyprland_foreground_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/hyprland_foreground_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/hyprland_foreground_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/hyprland_native_observation_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/hyprland_native_observation_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/hyprland_native_observation_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/hyprland_native_observation_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/installed_app_launch_macos_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/installed_app_launch_macos_test.rs
similarity index 97%
rename from libs/cua-driver/rust/crates/cua-driver/tests/installed_app_launch_macos_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/installed_app_launch_macos_test.rs
index 3058a21c45..525ff4a1d5 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/installed_app_launch_macos_test.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/installed_app_launch_macos_test.rs
@@ -5,7 +5,7 @@
//! TCC-authorized desktop session.
//!
//! Run:
-//! cargo test -p cua-driver --test installed_app_launch_macos_test -- --ignored --nocapture --test-threads=1
+//! cargo test -p cua-driver-e2e --test installed_app_launch_macos_test -- --ignored --nocapture --test-threads=1
#![cfg(target_os = "macos")]
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/installed_app_textedit_macos_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/installed_app_textedit_macos_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/installed_app_textedit_macos_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/installed_app_textedit_macos_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/launch_windows_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/launch_windows_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/launch_windows_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/launch_windows_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/macos_capture_environment_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/macos_capture_environment_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/macos_capture_environment_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/macos_capture_environment_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/standalone_browser_behavior_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/standalone_browser_behavior_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/standalone_browser_behavior_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/standalone_browser_behavior_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/support/appkit_snapshot_publication.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/support/appkit_snapshot_publication.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/support/appkit_snapshot_publication.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/support/appkit_snapshot_publication.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/wayland_overlay_idle_test.rs b/libs/cua-driver/rust/crates/cua-driver-e2e/tests/wayland_overlay_idle_test.rs
similarity index 100%
rename from libs/cua-driver/rust/crates/cua-driver/tests/wayland_overlay_idle_test.rs
rename to libs/cua-driver/rust/crates/cua-driver-e2e/tests/wayland_overlay_idle_test.rs
diff --git a/libs/cua-driver/rust/crates/cua-driver-testkit/src/paths.rs b/libs/cua-driver/rust/crates/cua-driver-testkit/src/paths.rs
index eee6b7f24a..648d1770f2 100644
--- a/libs/cua-driver/rust/crates/cua-driver-testkit/src/paths.rs
+++ b/libs/cua-driver/rust/crates/cua-driver-testkit/src/paths.rs
@@ -2,8 +2,9 @@
//! `CARGO_MANIFEST_DIR`.
//!
//! When an integration test runs, Cargo sets `CARGO_MANIFEST_DIR` to the crate
-//! under test (`crates/cua-driver`), so `workspace_root()` resolves the same
-//! whether called from the test or from here.
+//! under test (`crates/cua-driver` or `crates/cua-driver-e2e`). Both sit two
+//! levels below the workspace root, so `workspace_root()` resolves the same
+//! from either crate or from here.
use std::path::{Path, PathBuf};
diff --git a/libs/cua-driver/rust/crates/cua-driver/Cargo.toml b/libs/cua-driver/rust/crates/cua-driver/Cargo.toml
index 454c8d556b..110ddf0373 100644
--- a/libs/cua-driver/rust/crates/cua-driver/Cargo.toml
+++ b/libs/cua-driver/rust/crates/cua-driver/Cargo.toml
@@ -98,8 +98,6 @@ base64 = { workspace = true }
# Isolated HOME / cache directories for `version_check` unit tests so they
# never touch the developer's real `~/.cua-driver/version_check.json`.
tempfile = "3"
-futures-util = "0.3"
-tokio-tungstenite = "0.24"
[target.'cfg(target_os = "windows")'.dev-dependencies]
platform-windows = { path = "../platform-windows" }
@@ -115,6 +113,3 @@ windows = { version = "0.61", features = [
"Win32_Security",
"Win32_System_Threading",
] }
-
-[target.'cfg(target_os = "macos")'.dev-dependencies]
-core-foundation = "0.10"
diff --git a/libs/cua-driver/rust/crates/cua-driver/tests/README.md b/libs/cua-driver/rust/crates/cua-driver/tests/README.md
index ee4d188ac5..e13aa8e50b 100644
--- a/libs/cua-driver/rust/crates/cua-driver/tests/README.md
+++ b/libs/cua-driver/rust/crates/cua-driver/tests/README.md
@@ -1,150 +1,32 @@
# cua-driver Rust integration tests
-Tests in this directory exercise the public driver interface. Headless protocol
-tests run by default; harness E2E tests are marked `#[ignore]` because they
-need staged harness apps and an interactive desktop.
+Tests in this directory exercise the public driver interface without a
+desktop: MCP and CLI protocol, schemas, sessions, policy, and daemon
+lifecycle. Plain `cargo test -p cua-driver` runs them and must stay hermetic.
+They get `CARGO_BIN_EXE_cua-driver`, so Cargo builds the driver for them.
-Start with the contributor overview in
-`../../../../docs/test-harnesses-guide.md`, then use the matrix below as the
-coverage map.
+Desktop E2E suites that need a real desktop, fixture apps, installed apps, or
+OS permissions live in their own crate:
+[`../../cua-driver-e2e/tests/`](../../cua-driver-e2e/tests/README.md).
-The cross-OS ownership map is maintained in
-`../../../../docs/test-matrix.md`. Update that matrix when adding a harness,
-action, addressing mode, delivery mode, or OS-specific window-system case.
+The few `#[ignore]` tests left here need real input or real per-user state.
+Each is either selected by a canonical runner or listed with a reason in
+`libs/cua-driver/tests/manual-e2e-allowlist.txt`;
+`.github/scripts/tests/test_cua_driver_e2e_inventory.py` enforces this for both
+crates.
## Naming
-| Prefix | Runs by default | Purpose |
-| --- | --- | --- |
-| `protocol_*_test.rs` | yes | MCP/CLI protocol and schema behavior |
-| `session_capture_scope_test.rs` | yes | Per-session policy isolation, escalation, lifecycle, and retired config key |
-| `schema_*_test.rs` | yes | Generated schema consistency |
-| `harness_<toolkit>_test.rs` | no, `#[ignore]` | Toolkit-specific harness apps |
-| `desktop_scope_<os>_test.rs` | no, `#[ignore]` | Platform window/desktop scope contract |
-
-## Harness Requirements
-
-Build harness apps before running ignored tests:
-
-```bash
-# macOS
-../../../../tests/fixtures/build/macos.sh
-
-# Linux
-../../../../tests/fixtures/build/linux.sh
-```
-
-```powershell
-# Windows
-..\..\..\..\tests\fixtures\build\windows.ps1
-```
-
-Staged outputs are read from `../../test-apps/harness-<name>/`.
-
-The canonical cross-platform matrix is
-`cross_platform_behavior_test.rs`. It runs the same external-state scenarios
-against Electron and Tauri on each supported host, plus the native WKWebView
-host on macOS. CI and VM runners set
-`CUA_TEST_DRIVER_BIN`, `CUA_TEST_APPS_ROOT`, and
-`CUA_TEST_WORKSPACE_ROOT` when artifacts are built outside Cargo's default
-workspace paths. They also set `CUA_TEST_REQUIRE_FIXTURES=1`, turning a missing
-fixture into a failure instead of a silent skip.
-
-Each matrix row declares its action, AX/PX targeting, foreground or background
-delivery, scope, driver route, external oracles, and required behavior in
-`cases.jsonl`. `results.jsonl` records the observed behavior and derived test
-status. The Rust reporter validates both files and renders `summary.md`.
-
-The canonical OS runners also set
-`CUA_E2E_RECORDINGS_ROOT`. Every testkit `McpDriver` then records its full
-desktop trajectory to a unique directory containing `recording.mp4`, cursor
-samples, action JSON, per-turn screenshots, and a `trajectory.json` test-label
-manifest. Windows and Linux require
-FFmpeg; macOS uses the installed driver's ScreenCaptureKit backend. The runner
-validates each MP4 with `ffprobe` before reporting success. A separate Rust
-preflight verifies the desktop, fixture, AX tree, screenshot, and video
-lifecycle once before behavioral cells run.
+| Prefix | Purpose |
+| --- | --- |
+| `protocol_*_test.rs` | MCP/CLI protocol and schema behavior |
+| `session_capture_scope_test.rs` | Per-session policy isolation, escalation, lifecycle, and retired config key |
+| `schema_*_test.rs` | Generated schema consistency |
+| `*_cli_test.rs` | CLI verbs driven through the built binary |
## Running
```bash
+cargo test -p cua-driver --tests
cargo test -p cua-driver --test protocol_handshake_test
-cargo test -p cua-driver --test harness_appkit_test -- --ignored --nocapture
-cargo test -p cua-driver --test desktop_scope_macos_test -- --ignored --nocapture
-```
-
-The canonical Windows E2E entrypoint is
-`scripts/ci/windows/run-rust-e2e.ps1 -RequireGui`.
-It runs the complete Rust harness matrix; internal lane selectors are retained
-only for focused diagnosis. Optional
-external-app suites remain separate.
-
-The canonical macOS E2E entrypoint is
-`libs/cua-driver/tests/runners/macos-lume/run-all.sh`. It runs in a disposable
-clone of the private maintainer seed, or in a SIP-off worker prepared with the
-checked-in macOS consent seed helper. It requires a logged-in user session and
-verifies the installed driver's Accessibility and Screen Recording grants before
-delegating to `scripts/ci/macos/run-rust-e2e.sh`.
-
-For focused macOS runs on a workstation shared with other driver clients,
-start a TCC-authorized daemon on a dedicated socket and set
-`CUA_E2E_MACOS_DAEMON_SOCKET` to that socket. This prevents an unrelated MCP
-client from changing the shared daemon's session or recording state while a
-row is asserting focus preservation.
-
-Legacy Windows Sandbox runs use
-`../../../../tests/runners/windows-sandbox/run-tests-in-sandbox.ps1`, which
-builds selected Windows harness apps and maps them into the sandbox. The current
-Windows GUI validation path should use a real user desktop session through RDP
-or an interactive scheduled task.
-
-Windows GUI tests require a usable interactive desktop. SSH-launched commands start in Session 0 and
-cannot drive the user's desktop directly; launch GUI tests through an
-interactive scheduled task (`/IT`) or equivalent so they run in the logged-on
-user session.
-
-The testkit's native `DesktopObserver` records foreground-window, z-order,
-cursor, and leaked-input state around rows that promise no desktop side effects.
-If the input desktop is not `Default` or cannot be opened, the session is
-usually locked or disconnected. Reconnect, use `tscon /dest:console` on a
-disposable GUI VM, or boot the VM into an unlocked console session before
-running ignored GUI tests.
-
-Set `CUA_REQUIRE_GUI=1` on dedicated GUI runners to turn these desktop
-self-skips into hard failures with the full desktop-state diagnostic.
-
-The repository-level runners are the preferred entrypoints for the canonical
-matrix:
-
-```bash
-scripts/ci/linux/run-rust-e2e.sh
-```
-
-```powershell
-.\scripts\ci\windows\run-rust-e2e.ps1 -RequireGui
```
-
-## Optional External Apps
-
-These suites are Rust source-of-truth coverage for real installed apps, but they
-are not part of the canonical run-all path because they depend on software or
-desktop state outside the repo-local fixtures:
-
-- `harness_libreoffice_test.rs`: Windows LibreOffice Writer, the only coverage
- of the SAL/VCL MSAA fallback. Requires LibreOffice installed, or
- `LO_SWRITER_EXE` pointing at `swriter.exe`; it fails when Writer is missing.
-- `installed_app_launch_macos_test.rs`: macOS Calculator/TextEdit launch focus
- checks. Requires a logged-in GUI session and usable System Events scripting.
-- `installed_app_textedit_macos_test.rs`: real TextEdit background AX write and
- verification. Requires a logged-in GUI session and Accessibility permission.
-- `standalone_browser_behavior_test.rs`: installed Chrome and Edge browser-tool
- targeting, mutation, frame, tab, ambiguity, and isolated-profile rows. The
- harness owns a fresh browser profile and creates adversarial tabs and windows
- through the browser endpoint instead of relying on browser command-line
- handoff behavior. Run it through the cross-platform
- `scripts/ci/run-rust-standalone-browser-e2e.sh`, which stages the Electron
- foreground sentinel when needed and opts pure Wayland runs into the native
- backend. Non-macOS runs prove that standard mode refuses existing-profile
- attachment before running the authorized success rows with a disposable
- unrestricted daemon. The macOS Lume `run-all.sh` acceptance run always
- includes the success rows.
diff --git a/libs/cua-driver/tests/fixtures/README.md b/libs/cua-driver/tests/fixtures/README.md
index 30d3f494f5..e219dffe6a 100644
--- a/libs/cua-driver/tests/fixtures/README.md
+++ b/libs/cua-driver/tests/fixtures/README.md
@@ -65,7 +65,7 @@ Host requirements:
## Test Mapping
-Rust tests under `libs/cua-driver/rust/crates/cua-driver/tests/` consume the staged
+Rust tests under `libs/cua-driver/rust/crates/cua-driver-e2e/tests/` consume the staged
`rust/test-apps/harness-<name>/` outputs:
- `cross_platform_behavior_test.rs`: typed Electron/Tauri action matrix.
@@ -74,7 +74,7 @@ Rust tests under `libs/cua-driver/rust/crates/cua-driver/tests/` consume the sta
desktop-scope contracts.
- `protocol_*_test.rs` and schema tests: headless protocol coverage, default.
-Rust integration tests under `libs/cua-driver/rust/crates/cua-driver/tests/` drive
+Rust integration tests under `libs/cua-driver/rust/crates/cua-driver-e2e/tests/` drive
the shared Electron/Tauri harnesses through the public MCP interface.
## App Coverage
diff --git a/libs/cua-driver/tests/fixtures/smoke/README.md b/libs/cua-driver/tests/fixtures/smoke/README.md
index c4f624b87f..23b88dbc97 100644
--- a/libs/cua-driver/tests/fixtures/smoke/README.md
+++ b/libs/cua-driver/tests/fixtures/smoke/README.md
@@ -1,7 +1,7 @@
# test fixture CLI smoke runners
Per-OS broad PASS / FAIL / SKIP probes across the full cua-driver tool
-surface. Complements the Rust integration tests under `libs/cua-driver/rust/crates/cua-driver/tests/`:
+surface. Complements the Rust integration tests under `libs/cua-driver/rust/crates/cua-driver-e2e/tests/`:
- Integration tests drive cua-driver through the MCP stdio loop and
assert on specific UIA / AX state changes.
diff --git a/libs/cua-driver/tests/manual-e2e-allowlist.txt b/libs/cua-driver/tests/manual-e2e-allowlist.txt
index 1f6b043c4e..8062417abf 100644
--- a/libs/cua-driver/tests/manual-e2e-allowlist.txt
+++ b/libs/cua-driver/tests/manual-e2e-allowlist.txt
@@ -1,8 +1,10 @@
-# Ignored cua-driver integration tests that no canonical runner selects.
+# Ignored cua-driver and cua-driver-e2e integration tests that no canonical
+# runner selects.
#
# .github/scripts/tests/test_cua_driver_e2e_inventory.py fails when an
-# #[ignore] test under libs/cua-driver/rust/crates/cua-driver/tests is neither
-# selected by a runner or workflow nor listed here. It also fails when an entry
+# #[ignore] test under libs/cua-driver/rust/crates/cua-driver/tests or
+# libs/cua-driver/rust/crates/cua-driver-e2e/tests is neither selected by a
+# runner or workflow nor listed here. It also fails when an entry
# here no longer names an ignored test or is routed after all.
#
# Format: <test binary>::<test function> | <why it stays manual>
diff --git a/libs/cua-driver/tests/runners/macos-lume/run-all.sh b/libs/cua-driver/tests/runners/macos-lume/run-all.sh
index 62135cdc09..7d27413d84 100755
--- a/libs/cua-driver/tests/runners/macos-lume/run-all.sh
+++ b/libs/cua-driver/tests/runners/macos-lume/run-all.sh
@@ -715,7 +715,7 @@ run_computer_history_gate() {
echo "[HISTORY] Recording one packaged action before daemon restart"
(
cd "${RUST_ROOT}"
- cargo test -p cua-driver --release --test "${test_binary}" \
+ cargo test -p cua-driver-e2e --release --test "${test_binary}" \
history_records_agent_action_before_restart -- \
--ignored --exact --nocapture --test-threads=1
) 2>&1 | tee "${ARTIFACT_DIR}/history-before-restart.log"
@@ -724,7 +724,7 @@ run_computer_history_gate() {
restart_unrestricted_daemon
(
cd "${RUST_ROOT}"
- cargo test -p cua-driver --release --test "${test_binary}" \
+ cargo test -p cua-driver-e2e --release --test "${test_binary}" \
history_reopens_after_restart_and_cryptographically_purges -- \
--ignored --exact --nocapture --test-threads=1
) 2>&1 | tee "${ARTIFACT_DIR}/history-after-restart.log"
diff --git a/libs/cua-driver/tests/runners/windows-sandbox/run-tests-in-sandbox.ps1 b/libs/cua-driver/tests/runners/windows-sandbox/run-tests-in-sandbox.ps1
index 0f52b7abca..5fb64f6ae8 100644
--- a/libs/cua-driver/tests/runners/windows-sandbox/run-tests-in-sandbox.ps1
+++ b/libs/cua-driver/tests/runners/windows-sandbox/run-tests-in-sandbox.ps1
@@ -71,23 +71,23 @@ try {
if ($LASTEXITCODE -ne 0) { throw "cargo test --no-run (protocol_handshake_test) failed" }
Write-Host "`n[BUILD] cargo test --no-run (harness_wpf_test)..." -ForegroundColor Yellow
- cargo test -p cua-driver --test harness_wpf_test --no-run
+ cargo test -p cua-driver-e2e --test harness_wpf_test --no-run
if ($LASTEXITCODE -ne 0) { throw "cargo test --no-run (harness_wpf_test) failed" }
Write-Host "`n[BUILD] cargo test --no-run (harness_winui3_test)..." -ForegroundColor Yellow
- cargo test -p cua-driver --test harness_winui3_test --no-run
+ cargo test -p cua-driver-e2e --test harness_winui3_test --no-run
if ($LASTEXITCODE -ne 0) { throw "cargo test --no-run (harness_winui3_test) failed" }
Write-Host "`n[BUILD] cargo test --no-run (harness_web_test)..." -ForegroundColor Yellow
- cargo test -p cua-driver --test harness_web_test --no-run
+ cargo test -p cua-driver-e2e --test harness_web_test --no-run
if ($LASTEXITCODE -ne 0) { throw "cargo test --no-run (harness_web_test) failed" }
Write-Host "`n[BUILD] cargo test --no-run (launch_windows_test)..." -ForegroundColor Yellow
- cargo test -p cua-driver --test launch_windows_test --no-run
+ cargo test -p cua-driver-e2e --test launch_windows_test --no-run
if ($LASTEXITCODE -ne 0) { throw "cargo test --no-run (launch_windows_test) failed" }
Write-Host "`n[BUILD] cargo test --no-run (agent_cursor_windows_test)..." -ForegroundColor Yellow
- cargo test -p cua-driver --test agent_cursor_windows_test --no-run
+ cargo test -p cua-driver-e2e --test agent_cursor_windows_test --no-run
if ($LASTEXITCODE -ne 0) { throw "cargo test --no-run (agent_cursor_windows_test) failed" }
} finally { Pop-Location }
diff --git a/nix/cua-driver/tests/rust-unit.nix b/nix/cua-driver/tests/rust-unit.nix
index 3cb0e79a2c..78885da8ef 100644
--- a/nix/cua-driver/tests/rust-unit.nix
+++ b/nix/cua-driver/tests/rust-unit.nix
@@ -29,6 +29,8 @@ pkgs.rustPlatform.buildRustPackage {
"-p"
"cua-driver"
"-p"
+ "cua-driver-e2e"
+ "-p"
"cua-driver-core"
"-p"
"cua-driver-testkit"
diff --git a/scripts/ci/linux/run-rust-e2e.sh b/scripts/ci/linux/run-rust-e2e.sh
index a5ed819c68..c7d7212e76 100755
--- a/scripts/ci/linux/run-rust-e2e.sh
+++ b/scripts/ci/linux/run-rust-e2e.sh
@@ -178,7 +178,7 @@ run_report() {
echo "[PREFLIGHT] Linux desktop, fixture, AX, capture, and video"
set +e
-(cd "${RUST_ROOT}" && cargo test -p cua-driver \
+(cd "${RUST_ROOT}" && cargo test -p cua-driver-e2e \
"${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test e2e_environment_preflight_test -- \
--ignored --exact canonical_e2e_environment_is_ready --nocapture --test-threads=1) \
@@ -256,7 +256,7 @@ run_computer_history_gate() {
fi
run_test computer-history-encrypted-lifecycle \
- cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
+ cargo test -p cua-driver-e2e "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test computer_history_cross_platform_test -- \
--ignored --exact encrypted_history_survives_restart_and_cryptographically_purges \
--nocapture --test-threads=1
@@ -280,12 +280,12 @@ if [[ "${SUITE}" == shared || "${SUITE}" == all ]]; then
cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test private_worker_test -- --test-threads=1
run_test shared-behavior-matrix \
- cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
+ cargo test -p cua-driver-e2e "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test cross_platform_behavior_test -- \
--ignored --exact shared_web_action_matrix_is_state_verified \
--nocapture --test-threads=1
run_test embedded-browser-routes \
- cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
+ cargo test -p cua-driver-e2e "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test cross_platform_behavior_test -- \
--ignored --exact embedded_browser_routes_are_exact_or_refused \
--nocapture --test-threads=1
@@ -294,12 +294,12 @@ fi
if [[ "${SUITE}" == native || "${SUITE}" == all ]]; then
if [[ -n "${WAYLAND_DISPLAY:-}" ]]; then
run_test wayland-overlay-idle-no-overlay \
- cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
+ cargo test -p cua-driver-e2e "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test wayland_overlay_idle_test -- \
--ignored --exact no_overlay_flag_never_starts_wayland_overlay_thread \
--nocapture --test-threads=1
run_test wayland-overlay-idle-recovery \
- cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
+ cargo test -p cua-driver-e2e "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test wayland_overlay_idle_test -- \
--ignored --exact wayland_overlay_quiesces_and_recovers_after_capture_and_cursor_activity \
--nocapture --test-threads=1
@@ -322,16 +322,16 @@ if [[ "${SUITE}" == native || "${SUITE}" == all ]]; then
echo "[LIMITATION] wayland-overlay-idle: ${limitation}"
fi
run_test agent-cursor-showcase \
- cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
+ cargo test -p cua-driver-e2e "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test agent_cursor_showcase_test -- \
--ignored --nocapture --test-threads=1
run_test gtk3-native-harness \
- cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
+ cargo test -p cua-driver-e2e "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test harness_gtk3_test -- \
--ignored --nocapture --test-threads=1
if [[ -z "${WAYLAND_DISPLAY:-}" || -n "${DISPLAY:-}" ]]; then
run_test gtk4-target-selection \
- cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
+ cargo test -p cua-driver-e2e "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test harness_gtk4_test -- \
--ignored --nocapture --test-threads=1
else
@@ -356,11 +356,11 @@ fi
if [[ "${SUITE}" == capture || "${SUITE}" == all ]]; then
run_test capture-contract \
- cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
+ cargo test -p cua-driver-e2e "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test capture_contract_test -- \
--ignored --nocapture --test-threads=1
run_test desktop-scope \
- cargo test -p cua-driver "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
+ cargo test -p cua-driver-e2e "${CARGO_DRIVER_FEATURE_ARGS[@]}" \
--test desktop_scope_linux_test -- \
--ignored --nocapture --test-threads=1
fi
diff --git a/scripts/ci/macos/run-rust-e2e.sh b/scripts/ci/macos/run-rust-e2e.sh
index 189bf643c1..9392cd0199 100755
--- a/scripts/ci/macos/run-rust-e2e.sh
+++ b/scripts/ci/macos/run-rust-e2e.sh
@@ -303,7 +303,7 @@ run_report() {
echo "[PREFLIGHT] macOS daemon identity, fixture, AX, capture, and video"
set +e
-(cd "${RUST_ROOT}" && cargo test -p cua-driver --test e2e_environment_preflight_test -- \
+(cd "${RUST_ROOT}" && cargo test -p cua-driver-e2e --test e2e_environment_preflight_test -- \
--ignored --exact canonical_e2e_environment_is_ready --nocapture --test-threads=1) \
2>&1 | tee "${ARTIFACT_DIR}/environment-preflight.log"
PREFLIGHT_EXIT=${PIPESTATUS[0]}
@@ -329,17 +329,17 @@ if [[ "${SUITE}" == shared || "${SUITE}" == all ]]; then
--test runtime_configuration -- --test-threads=1
run_test private-worker-lifecycle cargo test -p cua-driver \
--test private_worker_test -- --test-threads=1
- run_test shared-app-matrix cargo test -p cua-driver --test cross_platform_behavior_test -- \
+ run_test shared-app-matrix cargo test -p cua-driver-e2e --test cross_platform_behavior_test -- \
--ignored --exact shared_web_action_matrix_is_state_verified \
--nocapture --test-threads=1
- run_test embedded-browser-routes cargo test -p cua-driver --test cross_platform_behavior_test -- \
+ run_test embedded-browser-routes cargo test -p cua-driver-e2e --test cross_platform_behavior_test -- \
--ignored --exact embedded_browser_routes_are_exact_or_refused \
--nocapture --test-threads=1
fi
if [[ "${SUITE}" == native || "${SUITE}" == all ]]; then
NATIVE_FILTER_MATCHES=0
if ! native_retry_filter_active; then
- run_test agent-cursor-showcase cargo test -p cua-driver \
+ run_test agent-cursor-showcase cargo test -p cua-driver-e2e \
--test agent_cursor_showcase_test -- \
--ignored --nocapture --test-threads=1
for appkit_test in \
@@ -366,7 +366,7 @@ if [[ "${SUITE}" == native || "${SUITE}" == all ]]; then
harness_appkit_double_click_px_background \
harness_appkit_slider_drag_px_foreground \
harness_appkit_slider_drag_px_background; do
- run_test "appkit-${appkit_test}" cargo test -p cua-driver --test harness_appkit_test -- \
+ run_test "appkit-${appkit_test}" cargo test -p cua-driver-e2e --test harness_appkit_test -- \
--ignored --exact "${appkit_test}" --nocapture --test-threads=1
done
fi
@@ -374,7 +374,7 @@ if [[ "${SUITE}" == native || "${SUITE}" == all ]]; then
while IFS='|' read -r swiftui_cell swiftui_test; do
if native_swiftui_test_selected "${swiftui_cell}"; then
NATIVE_FILTER_MATCHES=$((NATIVE_FILTER_MATCHES + 1))
- run_test "swiftui-${swiftui_test}" cargo test -p cua-driver --test harness_swiftui_test -- \
+ run_test "swiftui-${swiftui_test}" cargo test -p cua-driver-e2e --test harness_swiftui_test -- \
--ignored --exact "${swiftui_test}" --nocapture --test-threads=1
fi
done <<'EOF'
@@ -391,25 +391,25 @@ EOF
note_lane_failure native-filter-selection
fi
else
- run_test installed-app-launch cargo test -p cua-driver --test installed_app_launch_macos_test -- \
+ run_test installed-app-launch cargo test -p cua-driver-e2e --test installed_app_launch_macos_test -- \
--ignored --nocapture --test-threads=1
- run_test installed-app-textedit cargo test -p cua-driver --test installed_app_textedit_macos_test -- \
+ run_test installed-app-textedit cargo test -p cua-driver-e2e --test installed_app_textedit_macos_test -- \
--ignored --exact background_type_on_native_cocoa_is_ax_verified \
--nocapture --test-threads=1
# These rows assert through System Events and CoreGraphics oracles rather
# than typed matrix results, so they must not leave unowned trajectories.
run_test bring-to-front env -u CUA_E2E_RECORDINGS_ROOT \
- cargo test -p cua-driver --test bring_to_front_macos_test -- \
+ cargo test -p cua-driver-e2e --test bring_to_front_macos_test -- \
--ignored --nocapture --test-threads=1
fi
fi
if [[ "${SUITE}" == capture || "${SUITE}" == all ]]; then
- run_test capture-contract cargo test -p cua-driver --test capture_contract_test -- \
+ run_test capture-contract cargo test -p cua-driver-e2e --test capture_contract_test -- \
--ignored --nocapture --test-threads=1
run_test capture-environment env CUA_TEST_DRIVER_BIN="${MACOS_DAEMON_BIN}" \
- cargo test -p cua-driver --test macos_capture_environment_test -- \
+ cargo test -p cua-driver-e2e --test macos_capture_environment_test -- \
--ignored --nocapture --test-threads=1
- run_test desktop-scope cargo test -p cua-driver --test desktop_scope_macos_test -- \
+ run_test desktop-scope cargo test -p cua-driver-e2e --test desktop_scope_macos_test -- \
--ignored --nocapture --test-threads=1
fi
diff --git a/scripts/ci/run-rust-standalone-browser-e2e.sh b/scripts/ci/run-rust-standalone-browser-e2e.sh
index c06abdfa79..02e2e7571b 100755
--- a/scripts/ci/run-rust-standalone-browser-e2e.sh
+++ b/scripts/ci/run-rust-standalone-browser-e2e.sh
@@ -141,7 +141,7 @@ failure_count=0
for test_name in "${tests[@]}"; do
echo "[RUN] ${test_name}"
set +e
- (cd "${RUST_ROOT}" && cargo test --release -p cua-driver \
+ (cd "${RUST_ROOT}" && cargo test --release -p cua-driver-e2e \
${CARGO_DRIVER_FEATURE_ARGS[@]+"${CARGO_DRIVER_FEATURE_ARGS[@]}"} \
--test standalone_browser_behavior_test "${test_name}" -- \
--ignored --exact --nocapture --test-threads=1) \
diff --git a/scripts/ci/windows/run-rust-e2e.ps1 b/scripts/ci/windows/run-rust-e2e.ps1
index f1b4ad03d3..52dcfd7b99 100644
--- a/scripts/ci/windows/run-rust-e2e.ps1
+++ b/scripts/ci/windows/run-rust-e2e.ps1
@@ -155,7 +155,7 @@ try {
$previousPreference = $ErrorActionPreference
$ErrorActionPreference = "Continue"
try {
- $preflightOutput = @(& cargo test -p cua-driver --test e2e_environment_preflight_test -- `
+ $preflightOutput = @(& cargo test -p cua-driver-e2e --test e2e_environment_preflight_test -- `
--ignored --exact canonical_e2e_environment_is_ready --nocapture --test-threads=1 2>&1) | `
ForEach-Object {
if ($_ -is [System.Management.Automation.ErrorRecord]) {
@@ -297,7 +297,7 @@ function Invoke-ComputerHistoryGate {
}
Invoke-CargoTest "computer-history-encrypted-lifecycle" @(
- "test", "-p", "cua-driver", "--test", "computer_history_cross_platform_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "computer_history_cross_platform_test", "--",
"--ignored", "--exact", "encrypted_history_survives_restart_and_cryptographically_purges",
"--nocapture", "--test-threads=1"
)
@@ -385,12 +385,12 @@ if ($suite -in @("shared", "all")) {
"--test-threads=1"
)
Invoke-CargoTest "shared behavior matrix" @(
- "test", "-p", "cua-driver", "--test", "cross_platform_behavior_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "cross_platform_behavior_test", "--",
"--ignored", "--exact", "shared_web_action_matrix_is_state_verified",
"--nocapture", "--test-threads=1"
)
Invoke-CargoTest "embedded browser routes" @(
- "test", "-p", "cua-driver", "--test", "cross_platform_behavior_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "cross_platform_behavior_test", "--",
"--ignored", "--exact", "embedded_browser_routes_are_exact_or_refused",
"--nocapture", "--test-threads=1"
)
@@ -402,38 +402,38 @@ if ($suite -in @("native", "all")) {
"--exact", "tools_call_list_apps", "--nocapture", "--test-threads=1"
)
Invoke-CargoTest "Agent cursor showcase" @(
- "test", "-p", "cua-driver", "--test", "agent_cursor_showcase_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "agent_cursor_showcase_test", "--",
"--ignored", "--nocapture", "--test-threads=1"
)
Invoke-CargoTest "Windows native harnesses" @(
- "test", "-p", "cua-driver", "--test", "harness_wpf_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "harness_wpf_test", "--",
"--ignored", "--nocapture", "--test-threads=1"
)
Invoke-CargoTest "WinUI3 harnesses" @(
- "test", "-p", "cua-driver", "--test", "harness_winui3_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "harness_winui3_test", "--",
"--ignored", "--nocapture", "--test-threads=1"
)
Invoke-CargoTest "Windows web harnesses" @(
- "test", "-p", "cua-driver", "--test", "harness_web_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "harness_web_test", "--",
"--ignored", "--nocapture", "--test-threads=1"
)
Invoke-CargoTest "Windows minimized launch" @(
- "test", "-p", "cua-driver", "--test", "launch_windows_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "launch_windows_test", "--",
"--ignored", "--nocapture", "--test-threads=1"
)
Invoke-CargoTest "Windows agent cursor" @(
- "test", "-p", "cua-driver", "--test", "agent_cursor_windows_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "agent_cursor_windows_test", "--",
"--ignored", "--nocapture", "--test-threads=1"
)
}
if ($suite -in @("capture", "all")) {
Invoke-CargoTest "capture contract" @(
- "test", "-p", "cua-driver", "--test", "capture_contract_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "capture_contract_test", "--",
"--ignored", "--nocapture", "--test-threads=1"
)
Invoke-CargoTest "Windows desktop scope" @(
- "test", "-p", "cua-driver", "--test", "desktop_scope_windows_test", "--",
+ "test", "-p", "cua-driver-e2e", "--test", "desktop_scope_windows_test", "--",
"--ignored", "--nocapture", "--test-threads=1"
)
}
diff --git a/scripts/ci/windows/run-rust-standalone-browser-e2e.ps1 b/scripts/ci/windows/run-rust-standalone-browser-e2e.ps1
index 570dd97ecc..b1191c3993 100644
--- a/scripts/ci/windows/run-rust-standalone-browser-e2e.ps1
+++ b/scripts/ci/windows/run-rust-standalone-browser-e2e.ps1
@@ -142,7 +142,7 @@ $tests = @(
$failureCount = 0
foreach ($testName in $tests) {
$testExit = Invoke-CargoStep -Name $testName -Arguments @(
- "test", "--release", "-p", "cua-driver",
+ "test", "--release", "-p", "cua-driver-e2e",
"--test", "standalone_browser_behavior_test", $testName, "--",
"--ignored", "--exact", "--nocapture", "--test-threads=1"
) -LogPath (Join-Path $artifactDir "$testName.log")