Files
Mdeical_Sur_Report/工程分析/测试方案-2026-04-19-02-48-25.md

57 lines
2.2 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-02-48-25
## 1. 测试范围
- SystemSettings 数据迁移(旧用户无损升级)
- SystemSettings 新 UI服务商切换、动态表单、保存
- ReportEditor AI 调用解耦(模型名随配置变化)
- 类型检查与构建
## 2. 测试步骤与预期结果
### 场景 1旧用户数据迁移
1. 在浏览器 DevTools → Application → LocalStorage 中手动保留旧的 `systemSettings`(包含 `kimiApiKey: 'sk-test'``kimiApiEndpoint: 'https://api.moonshot.cn/v1'`
2. 刷新页面,进入 `/system-settings`
预期:
- AI 接口集成卡片显示"Kimi"为当前选中服务商
- Base URL 自动填充 `https://api.moonshot.cn/v1`
- API Key 自动填充 `sk-test`
- Model Name 自动填充 `kimi-k2-5`
### 场景 2新用户默认初始化
1. 清空 localStorage重新登录
预期:进入 `/system-settings`AI 配置默认展示 Kimi且 Model Name 为 `kimi-k2-5`
### 场景 3服务商切换
1.`/system-settings` 中将服务商从 Kimi 切换为 DeepSeek
预期:下方三个输入框的值自动切换为 DeepSeek 的默认值
2. 修改 DeepSeek 的 API Key 为 `sk-ds-test`
3. 切换回 Kimi
预期:显示 Kimi 的配置(之前填的值保留)
4. 切换回 DeepSeek
预期:显示 `sk-ds-test`(证明各服务商配置独立存储)
### 场景 4自定义服务商
1. 选择"自定义"
2. 填写 Base URL `http://localhost:11434/v1`、Key `ollama`、Model `llama3`
3. 保存
预期:保存成功,刷新后值保留
### 场景 5ReportEditor 调用解耦
1. 在 SystemSettings 中选择 DeepSeekModel 填 `deepseek-chat`
2. 进入 `/report-editor`,插入 AI 区域,切换到 AI撰写 Tab
3. 发送一条消息(不需要真实 API Key只看 Network 请求或 console
预期:
- 若 Key 为空,提示"尚未配置 AI API Key"
- 若有 Key请求的 `model` 字段应为 `deepseek-chat`(而非硬编码 `kimi-k2-5`
### 场景 6类型检查与构建
1. `npm run lint`
预期0 errors
2. `npm run build`
预期:成功
3. 访问 `http://localhost:4173/`
预期200 OK
## 3. 回滚检查
- 若测试失败,执行 `git checkout main` 或从 Gitea 拉取上一个 commit