mirror of
https://github.com/actionbook/actionbook.git
synced 2026-09-19 03:28:06 +08:00
58545129de
- Delete packages/actionbook-rs/ (legacy 0.x CLI) - Delete old packages/cli/ (JS npm wrapper for 0.x) - Rename packages/cli-v2/ → packages/cli/ (git mv) - Merge npm wrapper files (bin/actionbook.js, scripts/postinstall.js) into new cli/ - Update package.json: name → @actionbookdev/cli, private → false, add npm distribution fields - Update sync-versions.js: point Cargo.toml/Cargo.lock sync at packages/cli/ - Update release.yml: build from packages/cli/ instead of packages/actionbook-rs/ - Update test.yml: paths and working-directory from cli-v2 → cli - Update CLAUDE.md, CONTRIBUTING.md, docs, issue templates - Delete stale changeset (fix-screenshot-timeout.md) - Keep 6 platform binary packages unchanged
38 lines
939 B
Rust
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);
|
|
}
|