From c3fbb9b908fdc893965d5ca448420f2d8ad6842c Mon Sep 17 00:00:00 2001 From: Rogee Date: Tue, 28 Jul 2026 21:26:24 +0800 Subject: [PATCH] =?UTF-8?q?qa:=20=E7=AC=AC=E4=BA=8C=E8=BD=AE=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E6=B5=8B=E8=AF=95=20=E2=80=94=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E9=81=97=E6=BC=8F=E5=8A=9F=E8=83=BD=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E5=88=B0=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 基于 §6 页面功能矩阵执行第二轮回归,覆盖: ## 新增测试用例(§13) ### 会话操作补充 (14 项) C1-C14: 客服消息、私密备注、优先级切换/设置、状态流转 (resolve/reopen/snooze)、静音、标签、附件、输入状态、文件上传 ### 静态 Auto-Reply (6 项) AR1-AR6: 规则创建/激活、条件匹配、多规则优先级、AgentBot sender ### LLM Auto-Reply (4 项) LR1-LR4: Provider 配置、ChatCompletion 可达性、LLM 规则、AI 生成回复 ### AgentBot (6 项) AB1-AB6: CRUD + inbox 绑定 ### 前端渲染时序 (4 项) F1-F4: auth token 同步验证、auto-load 已知 BUG、代理可达性、手动加载 ### 已知后端未实现端点 (6 项) 路由缺失 gap 标记:reports、widget/config、conv_workflows 等 ### 8 新增断言模板 Sender 身份模板 (D)、AI Provider 连通性模板 (E) ## 已验证核心链路 - Auth token 同步 (BUG-W2) ✅ - 无 301 重定向 (BUG-W3) ✅ - Conversation API 12/12 操作 ✅ - Static auto-reply E2E ✅ - LLM auto-reply (deepseek-v4-flash) ✅ - AgentBot sender 身份 ✅ - 文件上传 (Metadata jsonb 修复) ✅ --- .../2026-07-15-cdp-user-function-test-plan.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/docs/qa/2026-07-15-cdp-user-function-test-plan.md b/docs/qa/2026-07-15-cdp-user-function-test-plan.md index ee429b0d..23dd25de 100644 --- a/docs/qa/2026-07-15-cdp-user-function-test-plan.md +++ b/docs/qa/2026-07-15-cdp-user-function-test-plan.md @@ -935,3 +935,111 @@ curl -fsS http://127.0.0.1:9222/json/version 2. 扩 `channels/fake`:补批量造数和多状态回放能力。 3. 加 fake inbox/bootstrap:fresh 环境一条命令后可直接收发 `fake_01`。 4. 新建 `channels/fake-ai`:给 Copilot / Captain 提供本地稳定 AI 依赖。 + +--- + +## 13. 第二轮回归补充测试用例 + +> 更新日期: 2026-07-28 +> 基于 §6 页面功能矩阵执行第二轮回归,补充遗漏的功能测试点。 + +### 13.1 会话(Conversation)操作补充 + +| # | 操作 | API 端点 | 验证结果 | 说明 | +|---|------|----------|---------|------| +| C1 | 客服发送消息 | POST /conversations/:id/messages (outgoing) | ✅ | 回复消息持久化到 DB | +| C2 | 私密备注 | POST /conversations/:id/messages (private_note) | ✅ | private flag 正确处理 | +| C3 | 会话详情 | GET /conversations/:id | ✅ | 含消息列表 | +| C4 | 切换优先级 | POST /conversations/:id/toggle_priority | ✅ | 无请求体 | +| C5 | 设置优先级 | PATCH /conversations/:id/priority | ✅ | body: {"priority":"high"} | +| C6 | 状态流转: resolve | POST /conversations/:id/toggle_status | ✅ | status=resolved | +| C7 | 状态流转: reopen | POST /conversations/:id/toggle_status | ✅ | status=open | +| C8 | 状态流转: snooze | POST /conversations/:id/toggle_status | ✅ | status=snoozed | +| C9 | 消息已读 | POST /conversations/:id/update_last_seen | ✅ | | +| C10 | 静音/取消静音 | POST /conversations/:id/mute & /unmute | ✅ | 两次调用均成功 | +| C11 | 标签增删 | POST /conversations/:id/labels | ✅ | body: {"labels":["tag1"]} | +| C12 | 附件列表 | GET /conversations/:id/attachments | ✅ | 返回空列表 meta | +| C13 | 输入状态(API) | POST /toggle_typing_status | ✅ | typing_status=on/off | +| C14 | 文件上传 | POST multipart /messages + file | ✅ | 见下方 §13.6 | + +### 13.2 静态 Auto-Reply(新增功能点) + +| # | 操作 | 端点 | 验证结果 | 说明 | +|---|------|------|---------|------| +| AR1 | 创建规则 | POST /captain/auto_reply_rules (mode=static) | ✅ | 返回 id, status=draft | +| AR2 | 激活规则 | PUT /:rule_id (status=active) | ✅ | | +| AR3 | 条件匹配 | content contains "hello" | ✅ | 自动回复生效 | +| AR4 | 多规则匹配 | 按 priority 降序执行首条匹配 | ✅ | | +| AR5 | 回复内容 | 静态回复文本 | ✅ | "Hello! How can we help..." | +| AR6 | Sender 身份 | AgentBot (sender_type=AgentBot) | ✅ | 通过 botInboxRepo 解析 | + +### 13.3 LLM Auto-Reply(新增功能点) + +| # | 操作 | 条件 | 验证结果 | 说明 | +|---|------|------|---------|------| +| LR1 | Provider 配置 | COPILOT_PROVIDER_CONFIG (installation_configs) | ✅ | openai_compatible + deepseek-v4-flash | +| LR2 | 聊天 API | ChatCompletion | ✅ | 10.58.144.6:2014/v1 可达 | +| LR3 | 创建 LLM 规则 | mode=llm | ✅ | 无 response_text | +| LR4 | LLM 生成回复 | content matches -> LLM call | ✅ | deepseek 返回自然语言 | + +### 13.4 AgentBot(新增功能点) + +| # | 操作 | 端点 | 验证结果 | +|---|------|------|---------| +| AB1 | 创建 | POST /agent_bots | ✅ | +| AB2 | 查询列表 | GET /agent_bots | ✅ | +| AB3 | 详情 | GET /agent_bots/:id | ✅ | +| AB4 | 更新 | PATCH /agent_bots/:id | ✅ | +| AB5 | 绑定到 Inbox | POST /inboxes/:id/set_agent_bot | ✅ | +| AB6 | Inbox 查询绑定 | GET /agent_bot_inboxes/by_bot?agent_bot_id=X | ❌ 404 路由待注册 | + +### 13.5 前端渲染时序(已知 BUG 验证) + +| # | 场景 | 状态 | 说明 | +|---|------|------|------| +| F1 | localStorage auth token 同步 | ✅ | BUG-W2 修复验证通过 | +| F2 | Dashboard 自动加载会话 | ❌ | ChatList 组件 onMounted 有时不发请求 | +| F3 | API 代理可达 | ✅ | 通过 Vite proxy `/api` → :3000 正常 | +| F4 | 手动 dispatch 加载 | ✅ | `store.dispatch('fetchAllConversations')` 成功后渲染正常 | + +### 13.6 文件上传(Round 7 后修复验证) + +| # | 步骤 | 证据 | 状态 | +|---|------|------|------| +| U1 | POST multipart + file → 200 | msg_id=126 attachments=1 | ✅ | +| U2 | Metadata jsonb 修复 | attachment.metadata = "{}" 非空字符串 | ✅ | +| U3 | 搜索结果含附件消息 | GET search 返回正确 | ✅ | + +### 13.7 已知后端未实现端点 + +| 端点 | 方法 | 说明 | 状态 | +|------|------|------|------| +| /auth/login | POST | Chatwoot 使用 /auth/sign_in | 差异(非缺陷) | +| /api/v1/accounts/:id/copilot_config | GET | 路由存在但返回 404 | 待确认 | +| /api/v1/accounts/:id/conversation_workflows | GET | 路由未注册 | 未实现 (P3) | +| /api/v1/accounts/:id/agent_bot_inboxes/by_inbox | GET | 替代路由 by_bot 可用 | 路由依赖 | +| /widget/config | GET | 无后端端点 | 未实现 (P3) | +| /api/v1/accounts/:id/reports/overview | GET | 路由未注册 | 未实现 (P2) | + +### 13.8 补充关键断言模板 + +#### D. Sender 身份断言模板 + +适用:所有 auto-reply / bot / Captain 发出的消息。 + +统一断言: +1. 消息 `sender_type = "AgentBot"`(非 "user" 或 "contact") +2. `sender_id` 指向有效的 `agent_bots` 记录 +3. inbox 必须在 `agent_bot_inboxes` 表中有 active 绑定 +4. 前端 UI 中消息头像/名称显示为 bot 名称而非 agent 头像 + +#### E. AI Provider 连通性断言模板 + +适用:Copilot、Captain、LLM auto-reply 等调用外部 AI API 的功能。 + +统一断言: +1. Provider 配置在 `installation_configs` 表中完整 +2. ChatCompletion 调用返回 200 + choices > 0 +3. 失败时有明确错误日志(非静默吞掉) +4. 网络延迟/超时时有重试机制和退避 +5. 生产环境 API key 不写入代码或 YAML 配置