Files
actionbook__actionbook/packages/cli/tests/e2e/timeout.rs
s1mba 53d76cecb2 [packages/cli]fix(test): align global-timeout nav assertion with CDP_NAV_TIMEOUT (#589)
#580 (ACT-972) changed the global --timeout expiry path for navigation
commands (goto/back/forward/reload) to emit CDP_NAV_TIMEOUT instead of
the generic TIMEOUT code, but this pre-existing e2e test was not
updated and has been breaking CI on main.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 15:10:29 +08:00

38 lines
947 B
Rust

use crate::harness::{
SessionGuard, assert_error_envelope, assert_failure, parse_json, skip, start_session, url_slow,
};
#[test]
fn global_timeout_applies_to_browser_commands() {
if skip() {
return;
}
let (sid, tid) = start_session("about:blank");
let _guard = SessionGuard::new(&sid);
let slow_url = url_slow();
let out = crate::harness::headless_json(
&[
"--timeout",
"50",
"browser",
"goto",
&slow_url,
"--session",
&sid,
"--tab",
&tid,
],
10,
);
assert_failure(&out, "global timeout on goto");
let v = parse_json(&out);
assert_eq!(v["command"], "browser goto");
assert_error_envelope(&v, "CDP_NAV_TIMEOUT");
assert_eq!(v["error"]["retryable"], true);
assert_eq!(v["context"]["session_id"], sid);
assert_eq!(v["context"]["tab_id"], tid);
}