Files
Mdeical_Sur_Report/工程分析/20260419_2030/测试方案.md
admin 7275906f3c fix(editor): AI注入后Ctrl+Z失效 + 字体格式统一
- confirmAiInjection改用Range.selectNodeContents + execCommand('insertHTML')保留浏览器撤销栈
- handleAIGenerate中对cleanHtml增加<p>标签内联样式注入:padding 0px、font-family SimSun、font-size 12pt、line-height 1.5
- 确保AI替换后的文字字体与原有文字完全一致
2026-04-19 20:33:43 +08:00

43 lines
1.3 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.
# 测试方案
## 测试环境
- 浏览器访问 `http://localhost:4173/`
- 进入「图文报告生成」→ 新建报告
## 测试用例 1Ctrl+Z 可撤销 AI 修改
**步骤**
1. 编辑器中插入 AI 可编辑区域,写入一些内容
2. 勾选「允许修改正文」→ 发送修改指令
3. 在 diff 弹窗中点击「确认并写入报告」
4. 按 Ctrl+Z或点击工具栏撤销按钮
**预期结果**
- AI 修改的内容被撤销,恢复到修改前的状态
- 可连续按 Ctrl+Z 继续撤销更早的操作
- 撤销后内容完整,无 DOM 结构损坏
## 测试用例 2替换后字体格式一致
**步骤**
1. 编辑器中 AI 可编辑区域内原有内容带宋体 12pt 样式
2. 发送 AI 修改指令
3. 观察 diff 弹窗左右两侧
4. 确认注入后观察编辑器中该区域内容
**预期结果**
- diff 弹窗右侧「AI 提议版本」的字体为宋体 12pt与左侧一致
- 确认注入后,编辑器中 AI 区域的文字字体与周边/原有文字一致
- 无视觉割裂感
## 测试用例 3编译与部署
**步骤**
1. 执行 `npm run build`
2. 确认无 TypeScript 编译错误
3. 预览服务正常启动并返回 200
**预期结果**
- `vite build` 成功完成
- 预览页面可正常访问