| 1 | 认证 | 无 Authorization header → 401 | ✅ PASS | message: Missing Authorization header |
| 2 | 认证 | 空 Bearer token → 401 | ✅ PASS | |
| 3 | 认证 | 错误 API Key → 401 | ✅ PASS | message: Invalid API Key |
| 4 | 认证 | 错误认证方式 (Basic) → 401 | ✅ PASS | |
| 5 | model验证 | 缺少 model 字段 → 400 | ✅ PASS | |
| 6 | model验证 | model=‘seedance-20’ (常见错误) → 400 | ✅ PASS | seedance-20 不是合法的顶层 model |
| 7 | model验证 | model=‘seedance20-video-generation’ (旧错误名) → 接受但后端失败 | ✅ PASS | HTTP 500 — 虽然在 supportedModels 中,但后端任务路由不支持 |
| 8 | model验证 | model=” (空字符串) → 400 | ✅ PASS | |
| 9 | model验证 | model=‘nonexistent-model’ → 400 | ✅ PASS | |
| 10 | model验证 | model=‘wan22-video-generation’ (正确) → 200 | ✅ PASS | 正确: model=‘wan22-video-generation’ |
| 11 | inputs.model | 不指定 inputs.model → 使用默认子模型 | ✅ PASS | HTTP 200 — inputs.model 是可选字段,不指定时使用默认子模型 |
| 12 | inputs.model | inputs.model=‘invalid-model’ → 400 | ✅ PASS | 合法值: z video, sora2, sora2 pro, seedance-20, grok-imagine-video |
| 13 | inputs.model | inputs.model=‘seedance-20’ (正确) → 200 | ✅ PASS | |
| 14 | resolution | resolution=‘720x720’ → 200 | ✅ PASS | |
| 15 | resolution | resolution=‘720x960’ → 200 | ✅ PASS | |
| 16 | resolution | resolution=‘960x720’ → 200 | ✅ PASS | |
| 17 | resolution | resolution=‘1280x720’ → 200 | ✅ PASS | |
| 18 | resolution | resolution=‘720x1280’ → 200 | ✅ PASS | |
| 19 | resolution | resolution=‘1920x1080’ → 400 | ✅ PASS | |
| 20 | resolution | resolution=‘1080x1920’ → 400 | ✅ PASS | |
| 21 | resolution | resolution=‘640x480’ → 400 | ✅ PASS | |
| 22 | resolution | resolution=‘2K’ → 400 | ✅ PASS | |
| 23 | resolution | resolution=‘4K’ → 400 | ✅ PASS | |
| 24 | duration | duration=‘5s’ → credits=200 | ✅ PASS | credits=200 (5s×40) |
| 25 | duration | duration=’10s’ → credits=400 | ✅ PASS | credits=400 (10s×40) |
| 26 | duration | 不指定 duration → 使用默认值 | ✅ PASS | 不指定 duration,默认 credits=200 |
| 27 | videoInputMode | keyframe → credits=200 (40/s) | ✅ PASS | credits=200 (5s×40/s) |
| 28 | videoInputMode | reference → credits=450 (90/s) | ✅ PASS | credits=450 (5s×90/s) |
| 29 | videoInputMode | videoInputMode=‘invalid’ → 400 | ✅ PASS | |
| 30 | 响应字段 | code/message/taskId/orderId/creditsUsed 格式正确 | ✅ PASS | taskId=task_yhbbk7gn47gjk1ltw9mlpdtb, orderId=ord_ecljcrobcxhm5zkz9kf8wtuw, credits=200 |
| 31 | 查询状态 | 查询已创建任务 → state 合法, model=seedance20-video-generation | ✅ PASS | state=generating, model=seedance20-video-generation |
| 32 | 查询状态 | 响应包含所有必要字段 | ✅ PASS | taskId, orderId, model, state, creditsUsed, output, error, createTime, updateTime |
| 33 | 查询状态 | 不存在的 taskId → 404 | ✅ PASS | |
| 34 | 查询状态 | 缺少 taskId 参数 → 400 | ✅ PASS | |
| 35 | 查询状态 | 空 taskId → 400/404 | ✅ PASS | |
| 36 | 查询状态 | 查询时无 Auth → 401 | ✅ PASS | |
| 37 | callBackUrl | 合法 callBackUrl → 200 | ✅ PASS | |
| 38 | callBackUrl | 非法 callBackUrl → 400 | ✅ PASS | HTTP 400 — 被拒绝 |
| 39 | 端到端 | Text-to-Video 创建→轮询→生成视频 | ⏱ TIMEOUT | 轮询 300s 超时,但任务最终成功生成 (排队任务过多导致) |
| 40 | 积分不足 | credits=10 创建任务(需200) → 402 | ✅ PASS | {"code":402,"message":"Insufficient credits","required":200,"available":10} |
| 41 | 失败状态 | 查询已知失败任务 → state=fail | ✅ PASS | task_crbo11thacvalmsbgxs5ppxm: error.code="500", error.message="Task execution failed" |
| 42 | 失败状态 | 查询失败任务(credit预扣失败) → state=fail | ✅ PASS | task_ugxvo5j2yw5wk26iexb5aqle: error.message="[生成失败]: credit prededuct failed" |