Files
Mdeical_Sur_Report/工程分析/测试方案-2026-04-19-03-03-55.md

39 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 测试方案 — 2026-04-19-03-03-55
## 1. 测试范围
- API 404 修复endpoint 尾部斜杠)
- 模型名称下拉栏动态切换
- AI 聊天记录路由切换持久化
## 2. 测试步骤与预期结果
### 场景 1Endpoint 尾部斜杠修复
1. 在 SystemSettings 中故意将 Base URL 末尾多加一个 `/``https://api.moonshot.cn/v1/`
2. 保存,进入 ReportEditor发送 AI 消息
预期:请求 URL 应为 `https://api.moonshot.cn/v1/chat/completions`(只有 1 个斜杠),不应 404
### 场景 2模型名称下拉栏
1. 在 SystemSettings 中填写正确的 Base URL 和 API Key
2. 点击"测试连接"
预期alert 显示连接成功,下方模型名称自动变为下拉栏,列出所有可用模型
3. 选择其中一个模型,保存
4. 刷新页面
预期:模型名称仍为下拉栏,选中值保留
### 场景 3聊天记录持久化
1. 进入 ReportEditor切换到 AI撰写 Tab
2. 发送 2-3 条消息user + model
3. 切换到 `/report-manage`,再返回 `/report-editor`
预期AI撰写 Tab 中聊天记录仍然存在,与离开前一致
4. 刷新页面(模拟完全重载)
预期:聊天记录仍然从 draft 中恢复
### 场景 4类型检查与构建
1. `npm run lint`
预期0 errors
2. `npm run build`
预期:成功
## 3. 回滚检查
- 若测试失败,执行 `git checkout main` 恢复到上一个 commit