docs/testing/ai-automation/test-scenarios/normal-flow/10-tools-management-and-advanced-context.md
验证在上下文中新增/编辑/删除工具定义(function tools)及与高级模式(Advanced Mode)联动: 工具数量展示、导出包含 tools、运行测试可在“带工具”路径下稳定工作。
tools 数组AI执行指导:
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": { "type": "string" },
"unit": { "type": "string", "enum": ["celsius", "fahrenheit"], "default": "celsius" }
},
"required": ["location"]
}
}
}
预期结果:
get_weather,无格式错误验证点:
AI执行指导:
browser_snapshot 检查顶部徽章是否显示“工具:1个”(文案以 i18n 为准)预期结果:
验证点:
AI执行指导:
tools预期结果:
tools 字段存在且数组长度 ≥ 1tools[0].function.name === "get_weather"验证点:
tools 数组存在且非空get_weatherAI执行指导:
browser_console_messages 观察是否走到自定义会话流(可打印“带工具”相关日志)预期结果:
验证点:
AI执行指导:
get_weather 的描述或参数(例如新增必填字段)预期结果:
验证点:
tools 内容同步更新@update:state/contextChange)