Files
getpaseo__paseo/scripts/test-mobile-agent-device.sh
Mohamed Boudra 04fe30a3e2 Improve mobile terminal input, selection, and resizing (#1607)
* Improve mobile terminal typing and selection

* Address mobile terminal review feedback

* Remove dead native terminal input branch

* Replay bracketed paste in terminal preamble

* Stop per-key terminal resize claims

* Stabilize terminal resize browser test

* Use tracked terminal mode for native paste

* Restore terminal toolbar focus handling

* Adapt native terminal to active visibility state

* Stabilize native mobile terminal interactions

* Add native terminal fallback boundary

* test(app): expect explicit terminal resize reclaim

* fix(app): stabilize terminal buffer coordinates

* fix(app): restrict terminal resize ownership

* fix(terminal): gate restored input modes

* fix(app): recover stalled terminal WebViews

* chore(app): remove obsolete terminal harnesses

* fix(app): make terminal resize claims explicit

* test(app): stabilize native terminal device flows

* test(app): track absolute scrollback coordinates

* fix(app): isolate terminal WebView streams

* fix(terminal): arbitrate size ownership across clients

The daemon now distinguishes explicit ownership claims from passive geometry updates. This keeps the active client authoritative while allowing its split, viewport, and keyboard changes to resize the PTY without idle clients stealing it.

* test(server): make worker resize assertion portable

Query the worker's authoritative terminal snapshot instead of invoking a Unix-only shell command, so the resize regression exercises the same boundary on Windows and Unix.
2026-08-03 19:01:34 +08:00

50 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
STATE_DIR="${PASEO_MOBILE_E2E_STATE_DIR:-${REPO_ROOT}/.dev/agent-device-e2e}"
ARTIFACTS_DIR="${PASEO_MOBILE_E2E_ARTIFACTS_DIR:-${REPO_ROOT}/.dev/agent-device-artifacts}"
METRO_PORT="${PASEO_MOBILE_E2E_METRO_PORT:-8081}"
METRO_PID=0
cleanup() {
AGENT_DEVICE_STATE_DIR="${STATE_DIR}" agent-device daemon stop --clean >/dev/null 2>&1 || true
if [[ "${METRO_PID}" -gt 0 ]]; then
pkill -TERM -P "${METRO_PID}" >/dev/null 2>&1 || true
kill -TERM "${METRO_PID}" >/dev/null 2>&1 || true
fi
}
trap cleanup EXIT INT TERM
cleanup
mkdir -p "${STATE_DIR}" "${ARTIFACTS_DIR}"
METRO_RESULT="$({
AGENT_DEVICE_STATE_DIR="${STATE_DIR}" agent-device metro prepare \
--project-root "${REPO_ROOT}/packages/app" \
--kind expo \
--port "${METRO_PORT}" \
--public-base-url "http://127.0.0.1:${METRO_PORT}" \
--json
})"
printf '%s\n' "${METRO_RESULT}"
METRO_PID="$(printf '%s' "${METRO_RESULT}" | node -e '
let input = "";
process.stdin.on("data", (chunk) => { input += chunk; });
process.stdin.on("end", () => {
const result = JSON.parse(input);
process.stdout.write(String(result.data?.started ? result.data.pid : 0));
});
')"
AGENT_DEVICE_STATE_DIR="${STATE_DIR}" agent-device prepare ios-runner \
--platform ios \
--timeout 120000
AGENT_DEVICE_STATE_DIR="${STATE_DIR}" agent-device test \
"${REPO_ROOT}/packages/app/e2e/mobile/agent-device" \
--metro-port "${METRO_PORT}" \
--timeout 120000 \
--fail-fast \
--artifacts-dir "${ARTIFACTS_DIR}"