- 前端 React+TypeScript (源码+构建产物) - 后端 Python FastAPI - 数据库迁移 001-015 - Docker部署配置 - 微信ClawBot API频道绑定 - 项目文档 README.md
18 KiB
18 KiB
AI智能自动化PaaS平台 - 接口自动化测试报告
报告信息
| 项目 | 内容 |
|---|---|
| 测试时间 | 2026-05-27 13:52:37 |
| 后端地址 | http://localhost:18080 |
| 测试管理员 | admin |
| 测试账号A | testuserA_1779861154 |
| 测试账号B | testuserB_1779861155 |
测试统计
| 统计项 | 数值 |
|---|---|
| 总测试项 | 130 |
| 通过 | 105 |
| 失败 | 25 |
| 通过率 | 80.8% |
初始准备
模块通过率: 3/3 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 管理员登录 | POST | /auth/login | username=admin | code=0 | code=0 | PASS |
| 注册测试用户A | POST | /auth/register | username=testuserA_1779861154 | code=0 | OK | PASS |
| 注册测试用户B | POST | /auth/register | username=testuserB_1779861155 | code=0 | OK | PASS |
认证模块
模块通过率: 7/7 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 用户名密码登录-正常 | POST | /auth/login | username=testuserA_1779861154 | code=0 | OK | PASS |
| 错误密码登录-异常 | POST | /auth/login | wrong_password | 401 | status=N/A | PASS |
| 不存在用户登录-异常 | POST | /auth/login | nonexistent_user | 401 | status=N/A | PASS |
| 获取当前用户信息 | GET | /auth/me | code=0 | OK | PASS | |
| 用户登出 | POST | /auth/logout | code=0 | OK | PASS | |
| 重复注册-异常 | POST | /auth/register | username=testuserA_1779861154(已存在) | 400 | status=N/A | PASS |
| 获取注册设置 | GET | /auth/settings | code=0 | OK | PASS |
AI聊天
模块通过率: 4/13 (30.8%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取可用模型列表 | GET | /chat/models | code=0 | OK | PASS | |
| 创建新对话 | POST | /chat/conversations | title=测试对话1 | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL |
| 创建第二个对话 | POST | /chat/conversations | title=测试对话2 | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL |
| 获取对话列表 | GET | /chat/conversations | code=0 | OK | PASS | |
| 搜索对话 | GET | /chat/conversations | search=测试 | code=0 | OK | PASS |
| 对话重命名 | PUT | /chat/conversations/None | title=已重命名 | code=0 | HTTP状态码 404, 期望 200, 响应: {"detail":"对话不存在"} | FAIL |
| 对话置顶 | PUT | /chat/conversations/None | pinned=true | code=0 | HTTP状态码 404, 期望 200, 响应: {"detail":"对话不存在"} | FAIL |
| 发送消息-正常 | POST | /chat/conversations/None/messages | content=你好... | code=0 | HTTP状态码 404, 期望 200, 响应: {"detail":"对话不存在"} | FAIL |
| 获取消息历史 | GET | /chat/conversations/None/messages | code=0 | HTTP状态码 404, 期望 200, 响应: {"detail":"对话不存在"} | FAIL | |
| 清空对话上下文 | POST | /chat/conversations/None/clear | code=0 | HTTP状态码 404, 期望 200, 响应: {"detail":"对话不存在"} | FAIL | |
| 删除(归档)对话 | DELETE | /chat/conversations/None | code=0 | HTTP状态码 404, 期望 200, 响应: {"detail":"对话不存在"} | FAIL | |
| 对话归档 | PUT | /chat/conversations/None | status=archived | code=0 | HTTP状态码 404, 期望 200, 响应: {"detail":"对话不存在"} | FAIL |
| 访问不存在对话-异常 | GET | /chat/conversations/nonexistent/messages | 404 | status=N/A | PASS |
频道模块
模块通过率: 1/2 (50.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 创建频道 | POST | /channels/ | name=测试频道 | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL |
| 获取频道列表 | GET | /channels/ | code=0 | OK | PASS |
知识库
模块通过率: 10/11 (90.9%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 创建知识库 | POST | /knowledge/bases | name=测试知识库 | code=0 | OK | PASS |
| 获取知识库列表 | GET | /knowledge/bases | code=0 | OK | PASS | |
| 获取知识库详情 | GET | /knowledge/bases/3017102b-b728-44d6-85ca-7e28a5175f12 | code=0 | OK | PASS | |
| 更新知识库 | PUT | /knowledge/bases/3017102b-b728-44d6-85ca-7e28a5175f12 | name=已更新 | code=0 | OK | PASS |
| 上传文档 | POST | /knowledge/bases/3017102b-b728-44d6-85ca-7e28a5175f12/documents | filename=test.pdf | code=0 | OK | PASS |
| 获取文档列表 | GET | /knowledge/bases/3017102b-b728-44d6-85ca-7e28a5175f12/documents | code=0 | OK | PASS | |
| 创建目录 | POST | /knowledge/directories | name=测试目录 | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL |
| 获取目录列表 | GET | /knowledge/directories | code=0 | OK | PASS | |
| 删除文档 | DELETE | /knowledge/bases/3017102b-b728-44d6-85ca-7e28a5175f12/documents/a484b3de-d934-408a-9f95-c2676f920697 | code=0 | OK | PASS | |
| 访问不存在知识库-异常 | GET | /knowledge/bases/nonexistent | 404 | status=N/A | PASS | |
| 删除知识库 | DELETE | /knowledge/bases/3017102b-b728-44d6-85ca-7e28a5175f12 | code=0 | OK | PASS |
应用市场
模块通过率: 5/6 (83.3%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取应用列表 | GET | /market/apps | code=0 | OK | PASS | |
| 按类型筛选应用 | GET | /market/apps | type=skill | code=0 | OK | PASS |
| 搜索应用 | GET | /market/apps | search=AI | code=0 | OK | PASS |
| 上传应用 | POST | /market/apps | name=测试Skill应用 | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL |
| 获取已购应用 | GET | /market/my-apps | code=0 | OK | PASS | |
| 获取不存在应用-异常 | GET | /market/apps/nonexistent | 404 | status=N/A | PASS |
Token驾驶舱
模块通过率: 5/6 (83.3%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取消耗总览 | GET | /token/overview | code=0 | OK | PASS | |
| 获取消耗排名 | GET | /token/rankings | code=0 | OK | PASS | |
| 获取消耗明细 | GET | /token/logs | code=0 | OK | PASS | |
| 按日期筛选明细 | GET | /token/logs | start_date=2026-01-01&end_date=2026-12-31 | code=0 | OK | PASS |
| 获取余额 | GET | /token/balance | code=0 | OK | PASS | |
| Token充值 | POST | /token/recharge | amount=1000 | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL |
付费中心
模块通过率: 2/5 (40.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取会员计划列表 | GET | /payment/plans | code=0 | OK | PASS | |
| 获取增值服务列表 | GET | /payment/services | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL | |
| 创建会员订单 | POST | /payment/orders | plan_id=plan-free | code=0 | HTTP状态码 422, 期望 200, 响应: {"detail":[{"type":"missing","loc":["body","item_id"],"msg":"Field required | FAIL |
| 获取订单列表 | GET | /payment/orders | code=0 | OK | PASS | |
| 获取优惠券列表 | GET | /payment/coupons | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL |
个人中心
模块通过率: 4/9 (44.4%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取个人信息 | GET | /profile/ | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL | |
| 更新个人信息 | PUT | /profile/ | nickname=测试昵称A | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL |
| 修改密码 | PUT | /profile/password | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL | |
| 修改密码-错误旧密码 | PUT | /profile/password | wrong_old_password | 400 | status=N/A | PASS |
| 获取登录日志 | GET | /profile/login-logs | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL | |
| 创建API密钥 | POST | /profile/api-keys | name=测试密钥 | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL |
| 获取API密钥列表 | GET | /profile/api-keys | code=0 | OK | PASS | |
| 获取会员信息 | GET | /profile/membership | code=0 | OK | PASS | |
| 获取已购应用 | GET | /profile/purchased-apps | code=0 | OK | PASS |
消息通知
模块通过率: 3/3 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取通知列表 | GET | /notifications/ | code=0 | OK | PASS | |
| 获取未读数量 | GET | /notifications/unread-count | code=0 | OK | PASS | |
| 全部标记已读 | PUT | /notifications/read-all | code=0 | OK | PASS |
资产管理
模块通过率: 1/3 (33.3%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 创建资产 | POST | /assets/ | name=测试文件.txt | code=0 | HTTP状态码 500, 期望 200, 响应: Internal Server Error | FAIL |
| 获取资产列表 | GET | /assets/ | code=0 | OK | PASS | |
| 获取分类列表 | GET | /assets/categories | code=0 | HTTP状态码 404, 期望 200, 响应: {"detail":"资产不存在"} | FAIL |
管理仪表盘
模块通过率: 3/3 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取仪表盘统计 | GET | /admin/dashboard/stats | 200 | status=200 | PASS | |
| 获取最近操作日志 | GET | /admin/dashboard/recent-logs | 200 | status=200 | PASS | |
| 获取最近审计日志 | GET | /admin/dashboard/recent-audit | 200 | status=200 | PASS |
用户管理
模块通过率: 6/7 (85.7%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取用户列表 | GET | /admin/users/ | 200 | status=200 | PASS | |
| 搜索用户 | GET | /admin/users/ | search=testuserA | 找到用户 | items=1 | PASS |
| 获取用户详情 | GET | /admin/users/e6c7907b-44cf-4459-829f-078974def746 | 200 | status=200 | PASS | |
| 封禁用户 | PUT | /admin/users/e6c7907b-44cf-4459-829f-078974def746/ban | 200 | status=200 | PASS | |
| 解封用户 | PUT | /admin/users/e6c7907b-44cf-4459-829f-078974def746/unban | 200 | status=200 | PASS | |
| 获取注册设置 | GET | /admin/users/register-settings | 200 | status=N/A | FAIL | |
| 更新注册设置 | PUT | /admin/users/register-settings | real_name_required=false | 200 | status=200 | PASS |
模型管理
模块通过率: 9/9 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取供应商列表 | GET | /admin/models/providers | 200 | status=200 | PASS | |
| 创建供应商 | POST | /admin/models/providers | name=TestProvider_1779861154 | 200 | status=200 | PASS |
| 更新供应商 | PUT | /admin/models/providers/8872a9de-c947-44ee-9115-10d0da23e588 | name=Updated | 200 | status=200 | PASS |
| 创建模型 | POST | /admin/models/ | name=TestModel_1779861154 | 200 | status=200 | PASS |
| 获取模型列表 | GET | /admin/models/ | 200 | status=200 | PASS | |
| 更新模型计费 | PUT | /admin/models/47174336-e4b0-43ec-b8cd-f335578b9e01 | price=3.0 | 200 | status=200 | PASS |
| 禁用模型 | PUT | /admin/models/47174336-e4b0-43ec-b8cd-f335578b9e01/toggle | is_enabled=false | 200 | status=200 | PASS |
| 获取模型调用统计 | GET | /admin/models/stats | 200 | status=200 | PASS | |
| 删除模型 | DELETE | /admin/models/47174336-e4b0-43ec-b8cd-f335578b9e01 | 200 | status=200 | PASS |
网站设置
模块通过率: 4/4 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取网站设置 | GET | /admin/settings/site | 200 | status=200 | PASS | |
| 更新网站设置 | PUT | /admin/settings/site | site_name=AI测试平台 | 200 | status=200 | PASS |
| 获取邮件配置 | GET | /admin/settings/email | 200 | status=200 | PASS | |
| 获取短信配置 | GET | /admin/settings/sms | 200 | status=200 | PASS |
支付渠道
模块通过率: 3/3 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取支付配置列表 | GET | /admin/payment/configs | 200 | status=200 | PASS | |
| 获取全平台订单 | GET | /admin/payment/orders | 200 | status=200 | PASS | |
| 导出订单CSV | GET | /admin/payment/orders/export | 200 | status=200 | PASS |
增值服务
模块通过率: 5/5 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 创建增值服务 | POST | /admin/services/ | name=测试增值服务_1779861154 | 200 | status=200 | PASS |
| 获取增值服务列表 | GET | /admin/services/ | 200 | status=200 | PASS | |
| 更新增值服务 | PUT | /admin/services/78a15eb2-178f-481f-ac3d-9b0110496189 | price=29.9 | 200 | status=200 | PASS |
| 获取定制服务订单 | GET | /admin/services/custom-orders | 200 | status=200 | PASS | |
| 删除增值服务 | DELETE | /admin/services/78a15eb2-178f-481f-ac3d-9b0110496189 | 200 | status=200 | PASS |
会员体系
模块通过率: 5/5 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取会员计划列表 | GET | /admin/membership/plans | 200 | status=200 | PASS | |
| 获取订阅列表 | GET | /admin/membership/subscriptions | 200 | status=200 | PASS | |
| 获取自动化规则 | GET | /admin/membership/automation-rules | 200 | status=200 | PASS | |
| 创建会员计划 | POST | /admin/membership/plans | name=TestPlan_1779861154 | 200 | status=200 | PASS |
| 删除会员计划 | DELETE | /admin/membership/plans/dd5615ac-588b-440d-bc11-2d5a581d0523 | 200 | status=200 | PASS |
广告位
模块通过率: 4/4 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 创建广告 | POST | /admin/ads/ | title=测试广告_1779861154 | 200 | status=200 | PASS |
| 获取广告列表 | GET | /admin/ads/ | 200 | status=200 | PASS | |
| 更新广告 | PUT | /admin/ads/15ff26ba-a15d-466e-b08a-60621ae9ee63 | title=已更新 | 200 | status=200 | PASS |
| 删除广告 | DELETE | /admin/ads/15ff26ba-a15d-466e-b08a-60621ae9ee63 | 200 | status=200 | PASS |
市场审核
模块通过率: 5/5 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取待审核应用 | GET | /admin/market/apps/pending | 200 | status=200 | PASS | |
| 获取所有应用(管理员) | GET | /admin/market/apps | 200 | status=200 | PASS | |
| 获取优惠券列表 | GET | /admin/market/coupons | 200 | status=200 | PASS | |
| 创建优惠券 | POST | /admin/market/coupons | code=TEST1779861154 | 200 | status=200 | PASS |
| 发放优惠券 | POST | /admin/market/coupons/4aca9fb4-8446-4c69-8847-0c4c3354af46/assign | user_id=e6c7907b-44cf-4459-829f-078974def746 | 200 | status=200 | PASS |
日志风控
模块通过率: 10/10 (100.0%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 获取操作日志 | GET | /admin/logs/operations | 200 | status=200 | PASS | |
| 获取Token日志 | GET | /admin/logs/token-logs | 200 | status=200 | PASS | |
| 获取付费日志 | GET | /admin/logs/payment-logs | 200 | status=200 | PASS | |
| 获取审计日志 | GET | /admin/logs/audit-logs | 200 | status=200 | PASS | |
| 导出操作日志CSV | GET | /admin/logs/export/operations | 200 | status=200 | PASS | |
| 导出Token日志CSV | GET | /admin/logs/export/token-logs | 200 | status=200 | PASS | |
| 获取风控规则 | GET | /admin/logs/risk-rules | 200 | status=200 | PASS | |
| 创建风控规则 | POST | /admin/logs/risk-rules | name=限流规则_1779861154 | 200 | status=200 | PASS |
| 更新风控规则 | PUT | /admin/logs/risk-rules/90f17aad-9b9c-44ed-ab44-989f04ef958f | threshold=200 | 200 | status=200 | PASS |
| 删除风控规则 | DELETE | /admin/logs/risk-rules/90f17aad-9b9c-44ed-ab44-989f04ef958f | 200 | status=200 | PASS |
核心检查
模块通过率: 6/7 (85.7%)
| 用例名称 | 方法 | 接口路径 | 请求参数 | 预期结果 | 实际结果 | 状态 |
|---|---|---|---|---|---|---|
| 普通用户访问后台API-拒绝 | GET | /admin/users/ | userA_token | 403 | status=N/A | PASS |
| 普通用户访问仪表盘-拒绝 | GET | /admin/dashboard/stats | userB_token | 403 | status=N/A | PASS |
| 普通用户访问操作日志-拒绝 | GET | /admin/logs/operations | userA_token | 403 | status=N/A | PASS |
| Token数据隔离验证 | GET | /token/overview | userA vs userB | 数据隔离 | A=0, B=0 | PASS |
| 操作日志无DELETE路由 | DELETE | /admin/logs/operations/id | 不可删除(404/405) | status=N/A | PASS | |
| Token日志无DELETE路由 | DELETE | /admin/logs/token-logs/id | 不可删除(404/405) | status=N/A | PASS | |
| Token计费-创建对话(预备) | POST | /chat/conversations | 200 | status=N/A | FAIL |
报告生成时间: 2026-05-27 13:52:37
测试工程师: QA