feat: persist sgclaw browser conversations
This commit is contained in:
@@ -201,3 +201,56 @@ async fn zeroclaw_browser_tool_keeps_domain_validation_in_mac_policy() {
|
||||
.contains("domain is not allowed")
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn zeroclaw_browser_tool_rejects_missing_required_action_parameters() {
|
||||
let (transport, tool) = build_adapter(vec![]);
|
||||
|
||||
let missing_click_selector = tool
|
||||
.execute(json!({
|
||||
"action": "click",
|
||||
"expected_domain": "www.baidu.com"
|
||||
}))
|
||||
.await
|
||||
.unwrap();
|
||||
let missing_text_selector = tool
|
||||
.execute(json!({
|
||||
"action": "getText",
|
||||
"expected_domain": "www.baidu.com"
|
||||
}))
|
||||
.await
|
||||
.unwrap();
|
||||
let missing_navigate_url = tool
|
||||
.execute(json!({
|
||||
"action": "navigate",
|
||||
"expected_domain": "www.baidu.com"
|
||||
}))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert!(!missing_click_selector.success);
|
||||
assert!(!missing_text_selector.success);
|
||||
assert!(!missing_navigate_url.success);
|
||||
assert_eq!(transport.sent_messages().len(), 0);
|
||||
assert!(
|
||||
missing_click_selector
|
||||
.error
|
||||
.as_deref()
|
||||
.unwrap()
|
||||
.contains("click requires selector")
|
||||
);
|
||||
assert!(
|
||||
missing_text_selector
|
||||
.error
|
||||
.as_deref()
|
||||
.unwrap()
|
||||
.contains("getText requires selector")
|
||||
);
|
||||
assert!(
|
||||
missing_navigate_url
|
||||
.error
|
||||
.as_deref()
|
||||
.unwrap()
|
||||
.contains("navigate requires url")
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user