mirror of
https://github.com/storytold/craft-anything.git
synced 2026-11-02 18:06:58 +00:00
Walkthrough preflight rejects timeout_secs values outside 1..=600 (#390)
The walkthrough check refuses timeout_secs outside 1..=600, as the recorder does. Fixes #288.
This commit is contained in:
@@ -243,6 +243,9 @@ impl WalkthroughParams {
|
||||
if self.keep_bodies.any() && !self.capture_network {
|
||||
return Err(ToolError::invalid("keep_bodies needs capture_network"));
|
||||
}
|
||||
if !(1..=600).contains(&self.timeout_secs) {
|
||||
return Err(ToolError::invalid("timeout_secs must be 1..=600"));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,6 +684,8 @@ fn the_checker_agrees_with_what_the_recorder_refuses() {
|
||||
json!({"actions": [ok_goto], "capture": {"events": ["no_such_family"]}}),
|
||||
json!({"actions": [ok_goto], "keep_bodies": {"request_body": true}, "capture_network": false}),
|
||||
json!({"actions": [ok_goto], "storage": {"cookies": [{"url": "ftp://x", "name": "a", "value": "b"}]}}),
|
||||
json!({"actions": [ok_goto], "timeout_secs": 0}),
|
||||
json!({"actions": [ok_goto], "timeout_secs": 601}),
|
||||
// Refused at the step, after those before it ran.
|
||||
json!({"actions": [{"kind": "goto", "url": "example.com"}]}),
|
||||
json!({"actions": [ok_goto, {"kind": "click"}]}),
|
||||
|
||||
Reference in New Issue
Block a user