Files
actionbook__actionbook/packages/cli-v2/tests/e2e/timeout.rs
4bmis 95d892be0b [packages/cli-v2]refactor: use space-separated command names instead of dot notation
Command names in JSON output and internal COMMAND_NAME constants now use
spaces (e.g., "browser snapshot") to match the CLI subcommand format,
replacing the previous dot notation (e.g., "browser.snapshot").

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 17:13:19 +08:00

38 lines
939 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, "TIMEOUT");
assert_eq!(v["error"]["retryable"], true);
assert_eq!(v["context"]["session_id"], sid);
assert_eq!(v["context"]["tab_id"], tid);
}