Files
Mycontent/scripts/test/process/2026-03-16-文章@某人自动创建-测试报告.md
Alex-larget 0e7b81eaa8 更新测试文档并增强设备管理逻辑
- 新增了一项功能,用于自动生成文章中的提及内容,从而优化了系统中创建计划流程的测试用例文档。
- 更新了测试关联文档,以纳入基于不同场景的测试用例的归档和复用规则。
- 实现了在未指定设备时选择默认设备的逻辑,确保设备管理流程更加顺畅。
- 在计划创建的上下文中明确了设备组的需求,从而提高了系统的整体可靠性。
2026-03-16 11:24:42 +08:00

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-03-16
**测试环境**local (http://localhost:8080)
**用例位置**`scripts/test/process/test_article_mention_ckb_flow.py`
---
## 测试结论
| 用例 | 结果 | 说明 |
|------|------|------|
| test_person_ensure_creates_ckb_plan_when_not_exists | ❌ 失败 | 后端会调用存客宝创建计划,但存客宝 API 返回 400 |
| test_person_ensure_returns_existing_when_name_exists | ❌ 失败 | 依赖上一条(需先创建成功) |
| test_article_mention_flow_persons_list_contains_new | ❌ 失败 | 同上 |
| test_person_ensure_rejects_empty_name | ✅ 通过 | name 为空时正确返回错误 |
---
## 失败原因
```
error: 创建存客宝计划失败: 创建计划失败
ckbResponse: {"code": 400, "data": [], "message": ""}
```
后端逻辑正确POST /api/db/persons 仅传 name 时,会按 name 查找,不存在则创建 Person 并调用存客宝创建获客计划。
存客宝开放 API 返回 400可能原因
- CKB_OPEN_API_KEY / CKB_OPEN_ACCOUNT 配置有误
- deviceGroups 为空时存客宝不允许创建(需求文档有提及)
- 存客宝 API 参数格式变更
---
## 建议
1. 后端:排查存客宝 create plan 400 原因,确认 deviceGroups 空时是否允许
2. 测试:存客宝可连通后重新跑 `pytest process/test_article_mention_ckb_flow.py -v`