From 4f7da8e793cfdf9fef0c96029c7fe8dfb24e688e Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Tue, 21 Jul 2026 07:48:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(e2e):=20=E7=B2=BE=E7=A1=AE=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E5=88=9B=E5=BB=BA=E8=AE=A1=E5=88=92=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=20+=20=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97=20(#668)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: xiaoxia Co-committed-by: xiaoxia --- apps/web/e2e/core-generation.spec.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/apps/web/e2e/core-generation.spec.ts b/apps/web/e2e/core-generation.spec.ts index f206a7255..c86a54a0f 100755 --- a/apps/web/e2e/core-generation.spec.ts +++ b/apps/web/e2e/core-generation.spec.ts @@ -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()