test_scenarios.md 2.4 KB

Phoneuse 端到端测试场景

场景 1:WeChat 消息发送(核心功能)

目标:验证 send_wechat_message 真发送 + DB 验证

1. 给 filehelper 发送一条测试消息
2. 验证返回 status="sent" 且 msgId 不为空
3. 用 query_wechat 独立查询确认 isSend=1

场景 2:WeChat 数据查询(修复验证)

目标:验证 S2-02/03/04 修复生效

1. get_wechat_contacts(query="张") — 应返回匹配联系人,无 imgFlag 错误
2. get_wechat_messages(contact="filehelper", limit=5) — 应返回消息列表,无 LIMIT ? 错误
3. get_wechat_chatrooms(limit=5) — 应返回群聊,无 chatroomowner 错误

场景 3:Memory Graph 搜索(知识库)

目标:验证 search_memory + semantic_search_memory

1. search_memory("吃饭") — 应返回相关微信消息
2. semantic_search_memory("项目") — 应返回语义相关消息(带 score)
3. embed_memory_messages(3) — 应成功向量化

场景 4:电话/短信工具(新模块)

目标:验证 telephony_tools 已注册可用

1. get_device_info() — 应返回设备信息
2. list_call_log(limit=5) — 应返回通话记录(或空列表)
3. get_system_contacts(limit=5) — 应返回系统通讯录

场景 5:Connector 层(修复验证)

目标:验证 EVENT_BUS_DIR 修复后 connector/persona/cloud 工具

1. get_connector_kb("wechat") — 应返回 wechat.yaml 内容
2. connector_read_wechat_contacts(limit=3) — 应返回联系人
3. get_persona() — 应返回 persona 数据(或空但无 NameError)
4. run_discovery_agent("wechat") — 应返回 WeChat DB 表列表

场景 6:部署工具(自举能力)

目标:验证 deploy_phoneuse_code 工具

1. 在 Mac 上修改一个 .py 文件(加一行注释)
2. 通过 MCP 调用 deploy_phoneuse_code(restart=true)
3. 验证 Pixel 上文件已更新、MCP 已重启

场景 7:MITM 流量分析(Alipay)

目标:验证 Alipay 流量可被拦截

1. 确认 mitm_proxy 在运行(port 8082)
2. 打开 Alipay App
3. 检查 event_server 是否有 mitm 类型事件(source='mitm', app='alipay')

场景 8:UI 控制工具(新模块)

目标:验证 ui_control_tools 可用

1. screenshot() — 应返回截图路径
2. get_foreground_app() — 应返回当前前台应用
3. tap(x=500, y=1000) — 应执行点击(在已知安全界面测试)