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.

test-fixtures: consolidate canonical Swift + Rust fixtures into shared dir (#1619)

Francesco Bonacci707d143d16b2
diff --git a/libs/cua-driver-fixtures/README.md b/libs/cua-driver-fixtures/README.md
new file mode 100644
index 0000000000..7c76e907ca
--- /dev/null
+++ b/libs/cua-driver-fixtures/README.md
@@ -0,0 +1,116 @@
+# cua-driver-fixtures
+
+Canonical HTML test fixtures for cua-driver (Swift / macOS) and
+cua-driver-rs (Rust / Windows + Linux + macOS). One source of truth; both
+ports' integration tests reference these files via relative symlinks from
+their existing `Tests/integration/fixtures/` and `assets/` trees.
+
+## Files
+
+| File | Purpose |
+|------|---------|
+| `interactive.html` | 31-line minimal click + type-mirror harness. Stable IDs: `#counter`, `#clicker`, `#textbox`, `#typed`. Used by `test_background_focus.py` (both ports) — opened via `file://`. |
+| `form_all_inputs.html` | Every HTML5 input type (text, password, email, number, tel, textarea, select, checkbox, radio, range, date, color). Submit handler stores result in `window._submitted`; live read via `getFieldValues()`. Used by `test_drag_slider_delivery.py`, `test_hermes_form_fill*.py`. |
+| `test_page.html` | Richer Safari/Chrome/Electron harness — button counter, text input, checkbox, dropdown, textarea, link, canvas. Served via local `html_server` HTTP fixture. Used by `test_chrome.py`, `test_safari.py`, `test_electron.py` (both ports). |
+| `gesture_panels.html` | **New** — extends the same ID-convention style as `test_page.html` with panels for the four gestures not currently covered by the v2 harness: hotkey + modifier-state propagation, pixel-coord pinpoint accuracy, drag-and-drop event sequence, scroll position. See **Why** below. |
+
+All four files are vanilla HTML — no external deps, no build step. Open
+directly in any browser:
+
+```bash
+open libs/cua-driver-fixtures/test_page.html
+```
+
+## Where each port references the canonical copy
+
+Existing port paths are preserved as symlinks. Tests that read these
+paths (`os.path.join(_THIS_DIR, "fixtures", "interactive.html")`,
+`f"{html_server}/test_page.html"`) work unchanged.
+
+```
+libs/cua-driver/Tests/integration/
+├── fixtures/
+│ ├── interactive.html → ../../../../cua-driver-fixtures/interactive.html
+│ └── form_all_inputs.html → ../../../../cua-driver-fixtures/form_all_inputs.html
+└── assets/
+ └── test_page.html → ../../../../cua-driver-fixtures/test_page.html
+
+libs/cua-driver-rs/tests/integration/
+├── fixtures/
+│ └── interactive.html → ../../../../cua-driver-fixtures/interactive.html
+└── v2/assets/
+ └── test_page.html → ../../../../../cua-driver-fixtures/test_page.html
+```
+
+Edits to a fixture now propagate to **both ports** in a single commit.
+Drift is impossible by construction.
+
+## Why `gesture_panels.html` was added
+
+`test_page.html` covers Safari/Chrome/Electron interaction surfaces well
+but doesn't probe four gestures that the Windows cua-driver-rs stress
+test (May 2026) showed need explicit harness coverage:
+
+1. **Hotkey + modifier-state propagation** (`#hotkey-focus` + `#hotkey-status`):
+ PostMessage-based hotkey paths inject keystrokes without updating the
+ OS modifier state, so the page-level `KeyboardEvent.ctrlKey` reads
+ `false` even after a routed `ctrl+s`. SendInput updates `GetKeyState`,
+ so the same event reads `ctrl=true`. The status div prints
+ `ctrl=true|false` directly — single assertion per routing path.
+
+2. **Pixel-coord pinpoint** (`#coord-area` + `#coord-status`): a known
+ target at viewport `(60, 60)` inside the box; status shows the
+ distance from the target in pixels. Asserting `dist < 2` is a clean
+ precision test for coordinate-routed clicks.
+
+3. **Drag-and-drop sequence** (`#drag-source` + `#drag-target` +
+ `#drag-status`): the page records each HTML5 drag event in order so
+ tests can assert the full `dragstart → dragover → drop` chain reached
+ the page (not just that the driver moved the cursor).
+
+4. **Scroll position** (`#scroll-area` + `#scroll-status`): a scrollable
+ container whose `scrollTop` is printed live — tests can assert scroll
+ direction + amount after a routed scroll gesture.
+
+Like `test_page.html`, each panel exposes a global accessor:
+`window.getGesturePanelState()` returns a JSON snapshot of all four
+panels' state. Tests can poll it via `browser_eval` (when running with
+Chromium's `--remote-debugging-port`) or read the visible status divs
+via UIA / OCR.
+
+### Known browser-coverage gaps (May 2026)
+
+When driving Chromium-based browsers (Edge / Chrome / Electron) on
+Windows, the integration tests should be aware of:
+
+- **GPU-composited content blanks PrintWindow.** `cua-driver screenshot`
+ captures the browser chrome + a white body. Workaround: launch the
+ target browser with `--remote-debugging-port=<port>` and use
+ `browser_eval` for both inputs and verification.
+- **Chromium auto-disables full a11y** unless an AT-grade client is
+ detected. UIA on the rendered DOM returns empty until the page is
+ flagged accessibility-active. Workaround: enable Chromium's
+ `--force-renderer-accessibility` flag (or rely on `--remote-debugging-port`).
+- **`hotkey` SendInput injection requires the daemon at UIAccess
+ integrity.** Otherwise `SetForegroundWindow` is rejected and the
+ injected events land on the wrong window — `SendInput inserted only 0
+ of 4 events`. Workaround: run `cua-driver` via the
+ `cua-driver-uia.exe` worker (PR #1593) which carries the manifest.
+
+These are environmental requirements for any DOM-level verification of
+gesture behavior in a Chromium target on Windows; they don't affect the
+canonical fixtures, only how they're driven.
+
+## Adding new fixtures
+
+1. Add the new HTML file directly to this dir
+2. Document it in the table above (purpose + stable IDs + who uses it)
+3. Add a relative symlink under whichever port(s) need it at the path
+ their tests already use
+4. Commit the new file + symlink(s) in the same PR
+
+Do **not** create copies under each port's tree — symlink-only.
+
+## License
+
+Same as the parent project (MIT, see `LICENSE.md`).
diff --git a/libs/cua-driver-fixtures/form_all_inputs.html b/libs/cua-driver-fixtures/form_all_inputs.html
new file mode 100644
index 0000000000..74ae4addfe
--- /dev/null
+++ b/libs/cua-driver-fixtures/form_all_inputs.html
@@ -0,0 +1,164 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>All Inputs Test Form</title>
+<style>
+body { font-family: -apple-system, sans-serif; padding: 30px; background: #f0f0f0; max-width: 640px; }
+h1 { font-size: 22px; margin-bottom: 20px; }
+.field { margin-bottom: 16px; }
+label { display: block; font-weight: bold; margin-bottom: 4px; font-size: 14px; }
+input[type=text], input[type=password], input[type=email],
+input[type=number], input[type=tel], input[type=url], input[type=search],
+textarea, select {
+ width: 100%; padding: 8px; font-size: 16px; box-sizing: border-box;
+ border: 1px solid #bbb; border-radius: 4px;
+}
+textarea { height: 80px; resize: vertical; }
+.radio-group label, .checkbox-group label { font-weight: normal; display: inline; margin-left: 6px; }
+input[type=range] { width: 100%; }
+input[type=color] { width: 80px; height: 40px; border: none; cursor: pointer; }
+button#submit-btn {
+ background: #007AFF; color: white; border: none; padding: 12px 28px;
+ font-size: 16px; border-radius: 6px; cursor: pointer; margin-top: 10px;
+}
+button#submit-btn:hover { background: #0066DD; }
+#result {
+ margin-top: 24px; padding: 16px; background: white; border: 1px solid #ccc;
+ border-radius: 6px; font-size: 13px; white-space: pre-wrap; display: none;
+}
+#submitted { display: none; font-size: 18px; color: green; font-weight: bold; margin-top: 16px; }
+</style>
+</head>
+<body>
+<h1>All Inputs Test Form</h1>
+<form id="test-form" onsubmit="handleSubmit(event)" autocomplete="off">
+
+ <div class="field">
+ <label for="f-text">Text</label>
+ <input type="text" id="f-text" name="text_field" placeholder="Enter text...">
+ </div>
+
+ <div class="field">
+ <label for="f-password">Password</label>
+ <input type="password" id="f-password" name="password_field" placeholder="Enter password...">
+ </div>
+
+ <div class="field">
+ <label for="f-email">Email</label>
+ <input type="email" id="f-email" name="email_field" placeholder="[email protected]">
+ </div>
+
+ <div class="field">
+ <label for="f-number">Number</label>
+ <input type="number" id="f-number" name="number_field" placeholder="42" min="0" max="999">
+ </div>
+
+ <div class="field">
+ <label for="f-tel">Phone</label>
+ <input type="tel" id="f-tel" name="tel_field" placeholder="555-1234">
+ </div>
+
+ <div class="field">
+ <label for="f-textarea">Message (Textarea)</label>
+ <textarea id="f-textarea" name="textarea_field" placeholder="Type a message..."></textarea>
+ </div>
+
+ <div class="field">
+ <label for="f-select">Favourite colour (Select)</label>
+ <select id="f-select" name="select_field">
+ <option value="">-- pick one --</option>
+ <option value="red">Red</option>
+ <option value="green">Green</option>
+ <option value="blue">Blue</option>
+ <option value="yellow">Yellow</option>
+ </select>
+ </div>
+
+ <div class="field checkbox-group">
+ <label>Checkbox</label><br>
+ <input type="checkbox" id="f-checkbox" name="checkbox_field" value="checked">
+ <label for="f-checkbox">I agree to the terms</label>
+ </div>
+
+ <div class="field radio-group">
+ <label>Radio buttons — Preferred fruit</label><br>
+ <input type="radio" id="r-apple" name="radio_field" value="apple">
+ <label for="r-apple">Apple</label>&nbsp;&nbsp;
+ <input type="radio" id="r-banana" name="radio_field" value="banana">
+ <label for="r-banana">Banana</label>&nbsp;&nbsp;
+ <input type="radio" id="r-cherry" name="radio_field" value="cherry">
+ <label for="r-cherry">Cherry</label>
+ </div>
+
+ <div class="field">
+ <label for="f-range">Range / Slider (0–100)</label>
+ <input type="range" id="f-range" name="range_field" min="0" max="100" value="50">
+ <span id="range-display">50</span>
+ </div>
+
+ <div class="field">
+ <label for="f-date">Date</label>
+ <input type="date" id="f-date" name="date_field">
+ </div>
+
+ <div class="field">
+ <label for="f-color">Colour picker</label><br>
+ <input type="color" id="f-color" name="color_field" value="#4488ff">
+ </div>
+
+ <button type="submit" id="submit-btn">Submit Form</button>
+</form>
+
+<div id="submitted">&#10003; Form Submitted!</div>
+<div id="result"></div>
+
+<script>
+document.getElementById('f-range').addEventListener('input', function() {
+ document.getElementById('range-display').textContent = this.value;
+});
+
+function handleSubmit(e) {
+ e.preventDefault();
+ var form = document.getElementById('test-form');
+ var data = {
+ text: document.getElementById('f-text').value,
+ password: document.getElementById('f-password').value,
+ email: document.getElementById('f-email').value,
+ number: document.getElementById('f-number').value,
+ tel: document.getElementById('f-tel').value,
+ textarea: document.getElementById('f-textarea').value,
+ select: document.getElementById('f-select').value,
+ checkbox: document.getElementById('f-checkbox').checked,
+ radio: (document.querySelector('input[name=radio_field]:checked') || {}).value || '',
+ range: document.getElementById('f-range').value,
+ date: document.getElementById('f-date').value,
+ color: document.getElementById('f-color').value,
+ };
+ document.getElementById('submitted').style.display = 'block';
+ document.getElementById('result').style.display = 'block';
+ document.getElementById('result').textContent = JSON.stringify(data, null, 2);
+ window._submitted = data;
+}
+
+// Expose live field state for test assertions (no submit required)
+function getFieldValues() {
+ return JSON.stringify({
+ text: document.getElementById('f-text').value,
+ password: document.getElementById('f-password').value,
+ email: document.getElementById('f-email').value,
+ number: document.getElementById('f-number').value,
+ tel: document.getElementById('f-tel').value,
+ textarea: document.getElementById('f-textarea').value,
+ select: document.getElementById('f-select').value,
+ checkbox: document.getElementById('f-checkbox').checked,
+ radio: (document.querySelector('input[name=radio_field]:checked') || {}).value || '',
+ range: document.getElementById('f-range').value,
+ date: document.getElementById('f-date').value,
+ color: document.getElementById('f-color').value,
+ submitted: typeof window._submitted !== 'undefined',
+ });
+}
+</script>
+</body>
+</html>
diff --git a/libs/cua-driver-fixtures/gesture_panels.html b/libs/cua-driver-fixtures/gesture_panels.html
new file mode 100644
index 0000000000..8b9d196a83
--- /dev/null
+++ b/libs/cua-driver-fixtures/gesture_panels.html
@@ -0,0 +1,140 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CUA Driver Gesture Panels (test_page.html companion)</title>
+<style>
+body { font-family: -apple-system, sans-serif; padding: 30px; background: #f0f0f0; }
+h2 { margin: 20px 0 8px; font-size: 16px; color: #555; }
+.section { background: white; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
+.status { font-size: 14px; margin-top: 6px; color: #333; font-family: monospace; }
+#hotkey-focus { font-size: 16px; padding: 10px; width: 360px; border: 1px solid #ccc; border-radius: 4px; }
+#coord-area { position: relative; width: 240px; height: 240px; background: #fafafa; border: 1px solid #ccc; cursor: crosshair; }
+#coord-target { position: absolute; left: 60px; top: 60px; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #1a73e8; }
+#drag-source { width: 80px; height: 80px; background: #1a73e8; color: white; display: flex; align-items: center; justify-content: center; cursor: grab; user-select: none; border-radius: 6px; }
+#drag-target { width: 120px; height: 120px; background: #fafafa; border: 2px dashed #999; margin-top: 12px; display: flex; align-items: center; justify-content: center; color: #999; }
+#drag-target.over { background: #e3f2fd; border-color: #1a73e8; }
+#scroll-area { width: 360px; height: 150px; overflow-y: scroll; border: 1px solid #ccc; padding: 8px; background: white; }
+#scroll-inner { height: 1200px; background: linear-gradient(180deg, #fff 0%, #1a73e8 100%); }
+</style>
+</head>
+<body>
+
+<div class="section">
+ <h2>Hotkey / modifier-state probe</h2>
+ <p style="font-size:13px;color:#666;margin:0 0 8px">
+ Focus this field, then send <code>hotkey ["ctrl","s"]</code>. The status line must report
+ <code>ctrl=true key=s</code>. PostMessage-only paths report <code>ctrl=false</code> because
+ the OS modifier state is never updated. SendInput-routed hotkeys report <code>ctrl=true</code>.
+ </p>
+ <input type="text" id="hotkey-focus" placeholder="Focus here, then send a hotkey...">
+ <div id="hotkey-status" class="status">hotkey: (no key seen)</div>
+</div>
+
+<div class="section">
+ <h2>Pixel-coordinate pinpoint</h2>
+ <p style="font-size:13px;color:#666;margin:0 0 8px">
+ Click on the blue dot at (60, 60) inside the box. Status shows the absolute viewport
+ pixel and the offset from the target center — &lt;2px is a passing precision test.
+ </p>
+ <div id="coord-area">
+ <div id="coord-target"></div>
+ </div>
+ <div id="coord-status" class="status">coord: (no click)</div>
+</div>
+
+<div class="section">
+ <h2>Drag and drop</h2>
+ <p style="font-size:13px;color:#666;margin:0 0 8px">
+ Drag the blue square into the dashed target. Status must show all three events:
+ <code>dragstart → dragover → drop</code> with the source label.
+ </p>
+ <div id="drag-source" draggable="true">DRAG ME</div>
+ <div id="drag-target">drop here</div>
+ <div id="drag-status" class="status">drag: (no events)</div>
+</div>
+
+<div class="section">
+ <h2>Scroll</h2>
+ <p style="font-size:13px;color:#666;margin:0 0 8px">
+ Scroll this container with the <code>scroll</code> tool. Status shows the current
+ <code>scrollTop</code> in pixels.
+ </p>
+ <div id="scroll-area">
+ <div id="scroll-inner">scroll me</div>
+ </div>
+ <div id="scroll-status" class="status">scroll: 0</div>
+</div>
+
+<script>
+// Hotkey / modifier-state probe ---------------------------------------------
+document.getElementById('hotkey-focus').addEventListener('keydown', function(e) {
+ var parts = [
+ 'key=' + e.key,
+ 'code=' + e.code,
+ 'ctrl=' + e.ctrlKey,
+ 'alt=' + e.altKey,
+ 'shift=' + e.shiftKey,
+ 'meta=' + e.metaKey
+ ];
+ document.getElementById('hotkey-status').textContent = 'hotkey: ' + parts.join(' ');
+ window._lastHotkey = { key: e.key, code: e.code, ctrl: e.ctrlKey, alt: e.altKey, shift: e.shiftKey, meta: e.metaKey };
+ // Prevent browser from acting on common chords during the test.
+ if (e.ctrlKey || e.metaKey) e.preventDefault();
+});
+
+// Pixel-coordinate pinpoint -------------------------------------------------
+document.getElementById('coord-area').addEventListener('click', function(e) {
+ var rect = e.currentTarget.getBoundingClientRect();
+ var x = Math.round(e.clientX - rect.left);
+ var y = Math.round(e.clientY - rect.top);
+ var dx = x - 60, dy = y - 60;
+ var dist = Math.sqrt(dx*dx + dy*dy).toFixed(1);
+ document.getElementById('coord-status').textContent = 'coord: (' + x + ',' + y + ') dist=' + dist + 'px';
+ window._lastCoord = { x: x, y: y, dist: parseFloat(dist) };
+});
+
+// Drag and drop -------------------------------------------------------------
+var dragEvents = [];
+var src = document.getElementById('drag-source');
+var tgt = document.getElementById('drag-target');
+src.addEventListener('dragstart', function(e) {
+ dragEvents.push('dragstart');
+ e.dataTransfer.setData('text/plain', 'DRAG ME');
+ document.getElementById('drag-status').textContent = 'drag: ' + dragEvents.join(' → ');
+});
+tgt.addEventListener('dragover', function(e) {
+ e.preventDefault();
+ if (dragEvents[dragEvents.length-1] !== 'dragover') dragEvents.push('dragover');
+ tgt.classList.add('over');
+ document.getElementById('drag-status').textContent = 'drag: ' + dragEvents.join(' → ');
+});
+tgt.addEventListener('dragleave', function() { tgt.classList.remove('over'); });
+tgt.addEventListener('drop', function(e) {
+ e.preventDefault();
+ dragEvents.push('drop');
+ tgt.classList.remove('over');
+ var payload = e.dataTransfer.getData('text/plain');
+ document.getElementById('drag-status').textContent = 'drag: ' + dragEvents.join(' → ') + ' payload=' + payload;
+ window._lastDrag = { events: dragEvents.slice(), payload: payload };
+});
+
+// Scroll --------------------------------------------------------------------
+document.getElementById('scroll-area').addEventListener('scroll', function(e) {
+ var st = e.currentTarget.scrollTop;
+ document.getElementById('scroll-status').textContent = 'scroll: ' + st;
+ window._lastScroll = st;
+});
+
+// Expose for cua-driver get_window_state polling --------------------------
+window.getGesturePanelState = function() {
+ return JSON.stringify({
+ hotkey: window._lastHotkey || null,
+ coord: window._lastCoord || null,
+ drag: window._lastDrag || null,
+ scroll: typeof window._lastScroll === 'number' ? window._lastScroll : null,
+ });
+};
+</script>
+</body>
+</html>
diff --git a/libs/cua-driver-fixtures/interactive.html b/libs/cua-driver-fixtures/interactive.html
new file mode 100644
index 0000000000..e67b6fee1f
--- /dev/null
+++ b/libs/cua-driver-fixtures/interactive.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CUA Driver Test Page</title>
+<style>
+body { font-family: -apple-system, sans-serif; padding: 40px; background: #f5f5f5; }
+#counter { font-size: 48px; font-weight: bold; margin: 20px 0; }
+button { font-size: 24px; padding: 12px 32px; cursor: pointer; }
+input { font-size: 24px; padding: 12px; width: 400px; margin-top: 20px; display: block; }
+#typed { font-size: 20px; color: #333; margin-top: 10px; }
+</style>
+</head>
+<body>
+<h1>Interactive Test Page</h1>
+<div id="counter">clicks: 0</div>
+<button id="clicker" onclick="bump()">Click Me</button>
+<input id="textbox" type="text" placeholder="Type here..." oninput="mirror()">
+<div id="typed">typed: </div>
+<script>
+var n = 0;
+function bump() {
+ n++;
+ document.getElementById('counter').textContent = 'clicks: ' + n;
+}
+function mirror() {
+ document.getElementById('typed').textContent = 'typed: ' + document.getElementById('textbox').value;
+}
+</script>
+</body>
+</html>
diff --git a/libs/cua-driver-fixtures/test_page.html b/libs/cua-driver-fixtures/test_page.html
new file mode 100644
index 0000000000..cf07c04b14
--- /dev/null
+++ b/libs/cua-driver-fixtures/test_page.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CUA Driver Test Page v2</title>
+<style>
+body { font-family: -apple-system, sans-serif; padding: 30px; background: #f0f0f0; }
+h2 { margin: 20px 0 8px; font-size: 16px; color: #555; }
+.section { background: white; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
+#btn-counter { font-size: 36px; font-weight: bold; color: #1a73e8; }
+button { font-size: 18px; padding: 10px 24px; cursor: pointer; border-radius: 6px; }
+input[type=text], textarea { font-size: 16px; padding: 10px; width: 360px; border: 1px solid #ccc; border-radius: 4px; }
+textarea { height: 80px; resize: none; }
+select { font-size: 16px; padding: 8px; border-radius: 4px; }
+#checkbox-label { font-size: 16px; margin-left: 8px; }
+a { font-size: 16px; color: #1a73e8; }
+canvas { border: 2px solid #999; cursor: crosshair; background: white; }
+#canvas-status { font-size: 14px; margin-top: 6px; color: #555; }
+</style>
+</head>
+<body>
+
+<div class="section">
+ <h2>Button</h2>
+ <div id="btn-counter">clicks: 0</div>
+ <button id="clicker" onclick="bumpClick()">Click Me</button>
+</div>
+
+<div class="section">
+ <h2>Text Input</h2>
+ <input type="text" id="textbox" placeholder="Type here..." oninput="mirrorText()">
+ <div id="text-mirror" style="font-size:14px;margin-top:6px;color:#333">typed: </div>
+</div>
+
+<div class="section">
+ <h2>Checkbox</h2>
+ <input type="checkbox" id="checkbox" onchange="updateCheckbox()">
+ <span id="checkbox-label">unchecked</span>
+</div>
+
+<div class="section">
+ <h2>Select / Dropdown</h2>
+ <select id="dropdown" onchange="updateSelect()">
+ <option value="a">Option A</option>
+ <option value="b">Option B</option>
+ <option value="c">Option C</option>
+ </select>
+ <div id="select-label" style="font-size:14px;margin-top:6px;color:#333">selected: Option A</div>
+</div>
+
+<div class="section">
+ <h2>Textarea</h2>
+ <textarea id="textarea" placeholder="Multi-line text..." oninput="mirrorTextarea()"></textarea>
+ <div id="textarea-mirror" style="font-size:14px;margin-top:6px;color:#333">content: </div>
+</div>
+
+<div class="section">
+ <h2>Link</h2>
+ <a href="#anchor" id="testlink" onclick="trackLink(event)">Test Link</a>
+ <div id="link-status" style="font-size:14px;margin-top:4px;color:#333">link: not clicked</div>
+</div>
+
+<div class="section">
+ <h2>Canvas</h2>
+ <canvas id="mycanvas" width="300" height="150"></canvas>
+ <div id="canvas-status">canvas: no click</div>
+</div>
+
+<div id="anchor" style="height:1px"></div>
+
+<script>
+// Button
+var clickCount = 0;
+function bumpClick() {
+ clickCount++;
+ document.getElementById('btn-counter').textContent = 'clicks: ' + clickCount;
+}
+
+// Text input
+function mirrorText() {
+ document.getElementById('text-mirror').textContent = 'typed: ' + document.getElementById('textbox').value;
+}
+
+// Checkbox
+function updateCheckbox() {
+ var cb = document.getElementById('checkbox');
+ document.getElementById('checkbox-label').textContent = cb.checked ? 'checked' : 'unchecked';
+}
+
+// Select
+function updateSelect() {
+ var sel = document.getElementById('dropdown');
+ var txt = sel.options[sel.selectedIndex].text;
+ document.getElementById('select-label').textContent = 'selected: ' + txt;
+}
+
+// Textarea
+function mirrorTextarea() {
+ document.getElementById('textarea-mirror').textContent = 'content: ' + document.getElementById('textarea').value;
+}
+
+// Link
+function trackLink(e) {
+ document.getElementById('link-status').textContent = 'link: clicked';
+}
+
+// Canvas — draw on click, record last position
+var canvas = document.getElementById('mycanvas');
+var ctx = canvas.getContext('2d');
+// Draw initial grey background
+ctx.fillStyle = '#eee';
+ctx.fillRect(0, 0, canvas.width, canvas.height);
+ctx.fillStyle = '#999';
+ctx.font = '14px sans-serif';
+ctx.fillText('Click to draw', 90, 80);
+
+canvas.addEventListener('mousedown', function(e) {
+ var rect = canvas.getBoundingClientRect();
+ var x = Math.round(e.clientX - rect.left);
+ var y = Math.round(e.clientY - rect.top);
+ canvas.dataset.lastX = x;
+ canvas.dataset.lastY = y;
+ // Draw a red dot
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+ ctx.fillStyle = '#eee';
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
+ ctx.beginPath();
+ ctx.arc(x, y, 12, 0, Math.PI * 2);
+ ctx.fillStyle = '#e53935';
+ ctx.fill();
+ document.getElementById('canvas-status').textContent = 'canvas: clicked at (' + x + ',' + y + ')';
+});
+</script>
+</body>
+</html>
diff --git a/libs/cua-driver-rs/crates/platform-windows/src/uia/windows_enum.rs b/libs/cua-driver-rs/crates/platform-windows/src/uia/windows_enum.rs
index b0752839c1..94c8b9e47f 100644
--- a/libs/cua-driver-rs/crates/platform-windows/src/uia/windows_enum.rs
+++ b/libs/cua-driver-rs/crates/platform-windows/src/uia/windows_enum.rs
@@ -220,7 +220,18 @@ pub fn try_invoke_in_window_at_point(hwnd: isize, sx: i32, sy: i32) -> bool {
if sx < rect.left || sx > rect.right || sy < rect.top || sy > rect.bottom {
continue;
}
- if elem.GetCurrentPattern(UIA_InvokePatternId).is_err() {
+ // Accept elements that support EITHER InvokePattern OR
+ // ExpandCollapsePattern. Qt menu-bar items advertise both —
+ // Invoke does nothing on them, only Expand opens the submenu.
+ // (See FreeCAD finding 2026-05-21: clicking File menu via Invoke
+ // returned ✅ but the menu never opened.)
+ let has_invoke = elem.GetCurrentPattern(UIA_InvokePatternId).is_ok();
+ let has_expand = elem
+ .GetCurrentPattern(
+ windows::Win32::UI::Accessibility::UIA_ExpandCollapsePatternId,
+ )
+ .is_ok();
+ if !has_invoke && !has_expand {
continue;
}
let w = (rect.right - rect.left).max(0) as i64;
@@ -237,11 +248,49 @@ pub fn try_invoke_in_window_at_point(hwnd: isize, sx: i32, sy: i32) -> bool {
None => {
tracing::debug!(
target: "click",
- "no InvokePattern descendant of 0x{hwnd:x} contains screen ({sx},{sy}) (scanned {n} elems)"
+ "no Invoke/ExpandCollapse descendant of 0x{hwnd:x} contains screen ({sx},{sy}) (scanned {n} elems)"
);
return false;
}
};
+ // Pattern preference for menu items: when both Invoke AND
+ // ExpandCollapse are advertised, the element is almost always a
+ // top-level MenuItem whose intended click behaviour is "open the
+ // submenu" — Invoke would be a no-op. Prefer ExpandCollapse.Expand
+ // in that case. Pure-Invoke leaves (buttons, links, etc.) go
+ // through Invoke as before.
+ let winner_has_expand = winner
+ .GetCurrentPattern(
+ windows::Win32::UI::Accessibility::UIA_ExpandCollapsePatternId,
+ )
+ .is_ok();
+ let winner_has_invoke = winner.GetCurrentPattern(UIA_InvokePatternId).is_ok();
+ if winner_has_expand && winner_has_invoke {
+ // Try Expand first, fall back to Invoke if Expand fails.
+ if let Ok(pat) = winner.GetCurrentPattern(
+ windows::Win32::UI::Accessibility::UIA_ExpandCollapsePatternId,
+ ) {
+ if let Ok(ec) = pat
+ .cast::<windows::Win32::UI::Accessibility::IUIAutomationExpandCollapsePattern>()
+ {
+ if ec.Expand().is_ok() {
+ return true;
+ }
+ }
+ }
+ // Expand failed — fall through to Invoke as best-effort.
+ } else if winner_has_expand && !winner_has_invoke {
+ if let Ok(pat) = winner.GetCurrentPattern(
+ windows::Win32::UI::Accessibility::UIA_ExpandCollapsePatternId,
+ ) {
+ if let Ok(ec) = pat
+ .cast::<windows::Win32::UI::Accessibility::IUIAutomationExpandCollapsePattern>()
+ {
+ return ec.Expand().is_ok();
+ }
+ }
+ return false;
+ }
let pattern = match winner.GetCurrentPattern(UIA_InvokePatternId) {
Ok(p) => p,
Err(_) => return false,
diff --git a/libs/cua-driver-rs/tests/integration/fixtures/interactive.html b/libs/cua-driver-rs/tests/integration/fixtures/interactive.html
deleted file mode 100644
index e67b6fee1f..0000000000
--- a/libs/cua-driver-rs/tests/integration/fixtures/interactive.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>CUA Driver Test Page</title>
-<style>
-body { font-family: -apple-system, sans-serif; padding: 40px; background: #f5f5f5; }
-#counter { font-size: 48px; font-weight: bold; margin: 20px 0; }
-button { font-size: 24px; padding: 12px 32px; cursor: pointer; }
-input { font-size: 24px; padding: 12px; width: 400px; margin-top: 20px; display: block; }
-#typed { font-size: 20px; color: #333; margin-top: 10px; }
-</style>
-</head>
-<body>
-<h1>Interactive Test Page</h1>
-<div id="counter">clicks: 0</div>
-<button id="clicker" onclick="bump()">Click Me</button>
-<input id="textbox" type="text" placeholder="Type here..." oninput="mirror()">
-<div id="typed">typed: </div>
-<script>
-var n = 0;
-function bump() {
- n++;
- document.getElementById('counter').textContent = 'clicks: ' + n;
-}
-function mirror() {
- document.getElementById('typed').textContent = 'typed: ' + document.getElementById('textbox').value;
-}
-</script>
-</body>
-</html>
diff --git a/libs/cua-driver-rs/tests/integration/fixtures/interactive.html b/libs/cua-driver-rs/tests/integration/fixtures/interactive.html
new file mode 120000
index 0000000000..d053b042a9
--- /dev/null
+++ b/libs/cua-driver-rs/tests/integration/fixtures/interactive.html
@@ -0,0 +1 @@
+../../../../cua-driver-fixtures/interactive.html
\ No newline at end of file
diff --git a/libs/cua-driver-rs/tests/integration/v2/assets/test_page.html b/libs/cua-driver-rs/tests/integration/v2/assets/test_page.html
deleted file mode 100644
index cf07c04b14..0000000000
--- a/libs/cua-driver-rs/tests/integration/v2/assets/test_page.html
+++ /dev/null
@@ -1,135 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>CUA Driver Test Page v2</title>
-<style>
-body { font-family: -apple-system, sans-serif; padding: 30px; background: #f0f0f0; }
-h2 { margin: 20px 0 8px; font-size: 16px; color: #555; }
-.section { background: white; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
-#btn-counter { font-size: 36px; font-weight: bold; color: #1a73e8; }
-button { font-size: 18px; padding: 10px 24px; cursor: pointer; border-radius: 6px; }
-input[type=text], textarea { font-size: 16px; padding: 10px; width: 360px; border: 1px solid #ccc; border-radius: 4px; }
-textarea { height: 80px; resize: none; }
-select { font-size: 16px; padding: 8px; border-radius: 4px; }
-#checkbox-label { font-size: 16px; margin-left: 8px; }
-a { font-size: 16px; color: #1a73e8; }
-canvas { border: 2px solid #999; cursor: crosshair; background: white; }
-#canvas-status { font-size: 14px; margin-top: 6px; color: #555; }
-</style>
-</head>
-<body>
-
-<div class="section">
- <h2>Button</h2>
- <div id="btn-counter">clicks: 0</div>
- <button id="clicker" onclick="bumpClick()">Click Me</button>
-</div>
-
-<div class="section">
- <h2>Text Input</h2>
- <input type="text" id="textbox" placeholder="Type here..." oninput="mirrorText()">
- <div id="text-mirror" style="font-size:14px;margin-top:6px;color:#333">typed: </div>
-</div>
-
-<div class="section">
- <h2>Checkbox</h2>
- <input type="checkbox" id="checkbox" onchange="updateCheckbox()">
- <span id="checkbox-label">unchecked</span>
-</div>
-
-<div class="section">
- <h2>Select / Dropdown</h2>
- <select id="dropdown" onchange="updateSelect()">
- <option value="a">Option A</option>
- <option value="b">Option B</option>
- <option value="c">Option C</option>
- </select>
- <div id="select-label" style="font-size:14px;margin-top:6px;color:#333">selected: Option A</div>
-</div>
-
-<div class="section">
- <h2>Textarea</h2>
- <textarea id="textarea" placeholder="Multi-line text..." oninput="mirrorTextarea()"></textarea>
- <div id="textarea-mirror" style="font-size:14px;margin-top:6px;color:#333">content: </div>
-</div>
-
-<div class="section">
- <h2>Link</h2>
- <a href="#anchor" id="testlink" onclick="trackLink(event)">Test Link</a>
- <div id="link-status" style="font-size:14px;margin-top:4px;color:#333">link: not clicked</div>
-</div>
-
-<div class="section">
- <h2>Canvas</h2>
- <canvas id="mycanvas" width="300" height="150"></canvas>
- <div id="canvas-status">canvas: no click</div>
-</div>
-
-<div id="anchor" style="height:1px"></div>
-
-<script>
-// Button
-var clickCount = 0;
-function bumpClick() {
- clickCount++;
- document.getElementById('btn-counter').textContent = 'clicks: ' + clickCount;
-}
-
-// Text input
-function mirrorText() {
- document.getElementById('text-mirror').textContent = 'typed: ' + document.getElementById('textbox').value;
-}
-
-// Checkbox
-function updateCheckbox() {
- var cb = document.getElementById('checkbox');
- document.getElementById('checkbox-label').textContent = cb.checked ? 'checked' : 'unchecked';
-}
-
-// Select
-function updateSelect() {
- var sel = document.getElementById('dropdown');
- var txt = sel.options[sel.selectedIndex].text;
- document.getElementById('select-label').textContent = 'selected: ' + txt;
-}
-
-// Textarea
-function mirrorTextarea() {
- document.getElementById('textarea-mirror').textContent = 'content: ' + document.getElementById('textarea').value;
-}
-
-// Link
-function trackLink(e) {
- document.getElementById('link-status').textContent = 'link: clicked';
-}
-
-// Canvas — draw on click, record last position
-var canvas = document.getElementById('mycanvas');
-var ctx = canvas.getContext('2d');
-// Draw initial grey background
-ctx.fillStyle = '#eee';
-ctx.fillRect(0, 0, canvas.width, canvas.height);
-ctx.fillStyle = '#999';
-ctx.font = '14px sans-serif';
-ctx.fillText('Click to draw', 90, 80);
-
-canvas.addEventListener('mousedown', function(e) {
- var rect = canvas.getBoundingClientRect();
- var x = Math.round(e.clientX - rect.left);
- var y = Math.round(e.clientY - rect.top);
- canvas.dataset.lastX = x;
- canvas.dataset.lastY = y;
- // Draw a red dot
- ctx.clearRect(0, 0, canvas.width, canvas.height);
- ctx.fillStyle = '#eee';
- ctx.fillRect(0, 0, canvas.width, canvas.height);
- ctx.beginPath();
- ctx.arc(x, y, 12, 0, Math.PI * 2);
- ctx.fillStyle = '#e53935';
- ctx.fill();
- document.getElementById('canvas-status').textContent = 'canvas: clicked at (' + x + ',' + y + ')';
-});
-</script>
-</body>
-</html>
diff --git a/libs/cua-driver-rs/tests/integration/v2/assets/test_page.html b/libs/cua-driver-rs/tests/integration/v2/assets/test_page.html
new file mode 120000
index 0000000000..57fd293961
--- /dev/null
+++ b/libs/cua-driver-rs/tests/integration/v2/assets/test_page.html
@@ -0,0 +1 @@
+../../../../../cua-driver-fixtures/test_page.html
\ No newline at end of file
diff --git a/libs/cua-driver/Tests/integration/assets/test_page.html b/libs/cua-driver/Tests/integration/assets/test_page.html
deleted file mode 100644
index cf07c04b14..0000000000
--- a/libs/cua-driver/Tests/integration/assets/test_page.html
+++ /dev/null
@@ -1,135 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>CUA Driver Test Page v2</title>
-<style>
-body { font-family: -apple-system, sans-serif; padding: 30px; background: #f0f0f0; }
-h2 { margin: 20px 0 8px; font-size: 16px; color: #555; }
-.section { background: white; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
-#btn-counter { font-size: 36px; font-weight: bold; color: #1a73e8; }
-button { font-size: 18px; padding: 10px 24px; cursor: pointer; border-radius: 6px; }
-input[type=text], textarea { font-size: 16px; padding: 10px; width: 360px; border: 1px solid #ccc; border-radius: 4px; }
-textarea { height: 80px; resize: none; }
-select { font-size: 16px; padding: 8px; border-radius: 4px; }
-#checkbox-label { font-size: 16px; margin-left: 8px; }
-a { font-size: 16px; color: #1a73e8; }
-canvas { border: 2px solid #999; cursor: crosshair; background: white; }
-#canvas-status { font-size: 14px; margin-top: 6px; color: #555; }
-</style>
-</head>
-<body>
-
-<div class="section">
- <h2>Button</h2>
- <div id="btn-counter">clicks: 0</div>
- <button id="clicker" onclick="bumpClick()">Click Me</button>
-</div>
-
-<div class="section">
- <h2>Text Input</h2>
- <input type="text" id="textbox" placeholder="Type here..." oninput="mirrorText()">
- <div id="text-mirror" style="font-size:14px;margin-top:6px;color:#333">typed: </div>
-</div>
-
-<div class="section">
- <h2>Checkbox</h2>
- <input type="checkbox" id="checkbox" onchange="updateCheckbox()">
- <span id="checkbox-label">unchecked</span>
-</div>
-
-<div class="section">
- <h2>Select / Dropdown</h2>
- <select id="dropdown" onchange="updateSelect()">
- <option value="a">Option A</option>
- <option value="b">Option B</option>
- <option value="c">Option C</option>
- </select>
- <div id="select-label" style="font-size:14px;margin-top:6px;color:#333">selected: Option A</div>
-</div>
-
-<div class="section">
- <h2>Textarea</h2>
- <textarea id="textarea" placeholder="Multi-line text..." oninput="mirrorTextarea()"></textarea>
- <div id="textarea-mirror" style="font-size:14px;margin-top:6px;color:#333">content: </div>
-</div>
-
-<div class="section">
- <h2>Link</h2>
- <a href="#anchor" id="testlink" onclick="trackLink(event)">Test Link</a>
- <div id="link-status" style="font-size:14px;margin-top:4px;color:#333">link: not clicked</div>
-</div>
-
-<div class="section">
- <h2>Canvas</h2>
- <canvas id="mycanvas" width="300" height="150"></canvas>
- <div id="canvas-status">canvas: no click</div>
-</div>
-
-<div id="anchor" style="height:1px"></div>
-
-<script>
-// Button
-var clickCount = 0;
-function bumpClick() {
- clickCount++;
- document.getElementById('btn-counter').textContent = 'clicks: ' + clickCount;
-}
-
-// Text input
-function mirrorText() {
- document.getElementById('text-mirror').textContent = 'typed: ' + document.getElementById('textbox').value;
-}
-
-// Checkbox
-function updateCheckbox() {
- var cb = document.getElementById('checkbox');
- document.getElementById('checkbox-label').textContent = cb.checked ? 'checked' : 'unchecked';
-}
-
-// Select
-function updateSelect() {
- var sel = document.getElementById('dropdown');
- var txt = sel.options[sel.selectedIndex].text;
- document.getElementById('select-label').textContent = 'selected: ' + txt;
-}
-
-// Textarea
-function mirrorTextarea() {
- document.getElementById('textarea-mirror').textContent = 'content: ' + document.getElementById('textarea').value;
-}
-
-// Link
-function trackLink(e) {
- document.getElementById('link-status').textContent = 'link: clicked';
-}
-
-// Canvas — draw on click, record last position
-var canvas = document.getElementById('mycanvas');
-var ctx = canvas.getContext('2d');
-// Draw initial grey background
-ctx.fillStyle = '#eee';
-ctx.fillRect(0, 0, canvas.width, canvas.height);
-ctx.fillStyle = '#999';
-ctx.font = '14px sans-serif';
-ctx.fillText('Click to draw', 90, 80);
-
-canvas.addEventListener('mousedown', function(e) {
- var rect = canvas.getBoundingClientRect();
- var x = Math.round(e.clientX - rect.left);
- var y = Math.round(e.clientY - rect.top);
- canvas.dataset.lastX = x;
- canvas.dataset.lastY = y;
- // Draw a red dot
- ctx.clearRect(0, 0, canvas.width, canvas.height);
- ctx.fillStyle = '#eee';
- ctx.fillRect(0, 0, canvas.width, canvas.height);
- ctx.beginPath();
- ctx.arc(x, y, 12, 0, Math.PI * 2);
- ctx.fillStyle = '#e53935';
- ctx.fill();
- document.getElementById('canvas-status').textContent = 'canvas: clicked at (' + x + ',' + y + ')';
-});
-</script>
-</body>
-</html>
diff --git a/libs/cua-driver/Tests/integration/assets/test_page.html b/libs/cua-driver/Tests/integration/assets/test_page.html
new file mode 120000
index 0000000000..2771775117
--- /dev/null
+++ b/libs/cua-driver/Tests/integration/assets/test_page.html
@@ -0,0 +1 @@
+../../../../cua-driver-fixtures/test_page.html
\ No newline at end of file
diff --git a/libs/cua-driver/Tests/integration/fixtures/form_all_inputs.html b/libs/cua-driver/Tests/integration/fixtures/form_all_inputs.html
deleted file mode 100644
index 74ae4addfe..0000000000
--- a/libs/cua-driver/Tests/integration/fixtures/form_all_inputs.html
+++ /dev/null
@@ -1,164 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>All Inputs Test Form</title>
-<style>
-body { font-family: -apple-system, sans-serif; padding: 30px; background: #f0f0f0; max-width: 640px; }
-h1 { font-size: 22px; margin-bottom: 20px; }
-.field { margin-bottom: 16px; }
-label { display: block; font-weight: bold; margin-bottom: 4px; font-size: 14px; }
-input[type=text], input[type=password], input[type=email],
-input[type=number], input[type=tel], input[type=url], input[type=search],
-textarea, select {
- width: 100%; padding: 8px; font-size: 16px; box-sizing: border-box;
- border: 1px solid #bbb; border-radius: 4px;
-}
-textarea { height: 80px; resize: vertical; }
-.radio-group label, .checkbox-group label { font-weight: normal; display: inline; margin-left: 6px; }
-input[type=range] { width: 100%; }
-input[type=color] { width: 80px; height: 40px; border: none; cursor: pointer; }
-button#submit-btn {
- background: #007AFF; color: white; border: none; padding: 12px 28px;
- font-size: 16px; border-radius: 6px; cursor: pointer; margin-top: 10px;
-}
-button#submit-btn:hover { background: #0066DD; }
-#result {
- margin-top: 24px; padding: 16px; background: white; border: 1px solid #ccc;
- border-radius: 6px; font-size: 13px; white-space: pre-wrap; display: none;
-}
-#submitted { display: none; font-size: 18px; color: green; font-weight: bold; margin-top: 16px; }
-</style>
-</head>
-<body>
-<h1>All Inputs Test Form</h1>
-<form id="test-form" onsubmit="handleSubmit(event)" autocomplete="off">
-
- <div class="field">
- <label for="f-text">Text</label>
- <input type="text" id="f-text" name="text_field" placeholder="Enter text...">
- </div>
-
- <div class="field">
- <label for="f-password">Password</label>
- <input type="password" id="f-password" name="password_field" placeholder="Enter password...">
- </div>
-
- <div class="field">
- <label for="f-email">Email</label>
- <input type="email" id="f-email" name="email_field" placeholder="[email protected]">
- </div>
-
- <div class="field">
- <label for="f-number">Number</label>
- <input type="number" id="f-number" name="number_field" placeholder="42" min="0" max="999">
- </div>
-
- <div class="field">
- <label for="f-tel">Phone</label>
- <input type="tel" id="f-tel" name="tel_field" placeholder="555-1234">
- </div>
-
- <div class="field">
- <label for="f-textarea">Message (Textarea)</label>
- <textarea id="f-textarea" name="textarea_field" placeholder="Type a message..."></textarea>
- </div>
-
- <div class="field">
- <label for="f-select">Favourite colour (Select)</label>
- <select id="f-select" name="select_field">
- <option value="">-- pick one --</option>
- <option value="red">Red</option>
- <option value="green">Green</option>
- <option value="blue">Blue</option>
- <option value="yellow">Yellow</option>
- </select>
- </div>
-
- <div class="field checkbox-group">
- <label>Checkbox</label><br>
- <input type="checkbox" id="f-checkbox" name="checkbox_field" value="checked">
- <label for="f-checkbox">I agree to the terms</label>
- </div>
-
- <div class="field radio-group">
- <label>Radio buttons — Preferred fruit</label><br>
- <input type="radio" id="r-apple" name="radio_field" value="apple">
- <label for="r-apple">Apple</label>&nbsp;&nbsp;
- <input type="radio" id="r-banana" name="radio_field" value="banana">
- <label for="r-banana">Banana</label>&nbsp;&nbsp;
- <input type="radio" id="r-cherry" name="radio_field" value="cherry">
- <label for="r-cherry">Cherry</label>
- </div>
-
- <div class="field">
- <label for="f-range">Range / Slider (0–100)</label>
- <input type="range" id="f-range" name="range_field" min="0" max="100" value="50">
- <span id="range-display">50</span>
- </div>
-
- <div class="field">
- <label for="f-date">Date</label>
- <input type="date" id="f-date" name="date_field">
- </div>
-
- <div class="field">
- <label for="f-color">Colour picker</label><br>
- <input type="color" id="f-color" name="color_field" value="#4488ff">
- </div>
-
- <button type="submit" id="submit-btn">Submit Form</button>
-</form>
-
-<div id="submitted">&#10003; Form Submitted!</div>
-<div id="result"></div>
-
-<script>
-document.getElementById('f-range').addEventListener('input', function() {
- document.getElementById('range-display').textContent = this.value;
-});
-
-function handleSubmit(e) {
- e.preventDefault();
- var form = document.getElementById('test-form');
- var data = {
- text: document.getElementById('f-text').value,
- password: document.getElementById('f-password').value,
- email: document.getElementById('f-email').value,
- number: document.getElementById('f-number').value,
- tel: document.getElementById('f-tel').value,
- textarea: document.getElementById('f-textarea').value,
- select: document.getElementById('f-select').value,
- checkbox: document.getElementById('f-checkbox').checked,
- radio: (document.querySelector('input[name=radio_field]:checked') || {}).value || '',
- range: document.getElementById('f-range').value,
- date: document.getElementById('f-date').value,
- color: document.getElementById('f-color').value,
- };
- document.getElementById('submitted').style.display = 'block';
- document.getElementById('result').style.display = 'block';
- document.getElementById('result').textContent = JSON.stringify(data, null, 2);
- window._submitted = data;
-}
-
-// Expose live field state for test assertions (no submit required)
-function getFieldValues() {
- return JSON.stringify({
- text: document.getElementById('f-text').value,
- password: document.getElementById('f-password').value,
- email: document.getElementById('f-email').value,
- number: document.getElementById('f-number').value,
- tel: document.getElementById('f-tel').value,
- textarea: document.getElementById('f-textarea').value,
- select: document.getElementById('f-select').value,
- checkbox: document.getElementById('f-checkbox').checked,
- radio: (document.querySelector('input[name=radio_field]:checked') || {}).value || '',
- range: document.getElementById('f-range').value,
- date: document.getElementById('f-date').value,
- color: document.getElementById('f-color').value,
- submitted: typeof window._submitted !== 'undefined',
- });
-}
-</script>
-</body>
-</html>
diff --git a/libs/cua-driver/Tests/integration/fixtures/form_all_inputs.html b/libs/cua-driver/Tests/integration/fixtures/form_all_inputs.html
new file mode 120000
index 0000000000..39e40653b3
--- /dev/null
+++ b/libs/cua-driver/Tests/integration/fixtures/form_all_inputs.html
@@ -0,0 +1 @@
+../../../../cua-driver-fixtures/form_all_inputs.html
\ No newline at end of file
diff --git a/libs/cua-driver/Tests/integration/fixtures/interactive.html b/libs/cua-driver/Tests/integration/fixtures/interactive.html
deleted file mode 100644
index e67b6fee1f..0000000000
--- a/libs/cua-driver/Tests/integration/fixtures/interactive.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>CUA Driver Test Page</title>
-<style>
-body { font-family: -apple-system, sans-serif; padding: 40px; background: #f5f5f5; }
-#counter { font-size: 48px; font-weight: bold; margin: 20px 0; }
-button { font-size: 24px; padding: 12px 32px; cursor: pointer; }
-input { font-size: 24px; padding: 12px; width: 400px; margin-top: 20px; display: block; }
-#typed { font-size: 20px; color: #333; margin-top: 10px; }
-</style>
-</head>
-<body>
-<h1>Interactive Test Page</h1>
-<div id="counter">clicks: 0</div>
-<button id="clicker" onclick="bump()">Click Me</button>
-<input id="textbox" type="text" placeholder="Type here..." oninput="mirror()">
-<div id="typed">typed: </div>
-<script>
-var n = 0;
-function bump() {
- n++;
- document.getElementById('counter').textContent = 'clicks: ' + n;
-}
-function mirror() {
- document.getElementById('typed').textContent = 'typed: ' + document.getElementById('textbox').value;
-}
-</script>
-</body>
-</html>
diff --git a/libs/cua-driver/Tests/integration/fixtures/interactive.html b/libs/cua-driver/Tests/integration/fixtures/interactive.html
new file mode 120000
index 0000000000..d053b042a9
--- /dev/null
+++ b/libs/cua-driver/Tests/integration/fixtures/interactive.html
@@ -0,0 +1 @@
+../../../../cua-driver-fixtures/interactive.html
\ No newline at end of file