fix(e2e): 精确匹配创建计划接口路径 + 增加错误调试日志 (#668)
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Build Staging Web Image (push) Successful in 2m43s
CI/CD Pipeline / Frontend Lint (push) Successful in 3m25s
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 5m17s
CI/CD Pipeline / Unit Tests (push) Successful in 5m6s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 4m50s
CI/CD Pipeline / Integration Tests (push) Successful in 2m42s
CI/CD Pipeline / Build Staging API Image (push) Successful in 13m35s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 16m51s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m14s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 57s
CI/CD Pipeline / Staging E2E Tests (push) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (push) Has been cancelled

Co-authored-by: xiaoxia <dev@xiaoxiajianji.com>
Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
This commit was merged in pull request #668.
This commit is contained in:
2026-07-21 07:48:50 +08:00
committed by auto-approve-bot
parent cda899ad5f
commit 4f7da8e793
+15 -4
View File
@@ -220,11 +220,16 @@ test.describe("Core generation flow", () => {
await expect(page.getByRole("heading", { name: /确认生成/ })).toBeVisible()
// Wait for plan creation API to be called
// 精确匹配 POST /template-editors(创建接口),排除所有子路径(/generate, /clips, /ai-recommend 等)
const createPlanPromise = page.waitForResponse(
(response) =>
response.url().includes("/template-editors") &&
response.request().method() === "POST" &&
!response.url().includes("/generate"),
(response) => {
const url = response.url()
const path = new URL(url).pathname
return (
response.request().method() === "POST" &&
(path.endsWith("/template-editors") || path.endsWith("/template-editors/"))
)
},
{ timeout: 30_000 },
)
@@ -233,6 +238,12 @@ test.describe("Core generation flow", () => {
// Verify plan was created successfully
const planResp = await createPlanPromise
if (!planResp.ok()) {
const body = await planResp.text()
console.error(
`[E2E DEBUG] 创建计划接口失败: status=${planResp.status()} url=${planResp.url()} body=${body.slice(0, 500)}`,
)
}
expect(planResp.ok()).toBeTruthy()
const planData = (await planResp.json()) as { id: string }
expect(planData.id).toBeTruthy()