From ac5353b3358e01d4a66d2fe71c821785f95d769d Mon Sep 17 00:00:00 2001 From: frontend-dev Date: Sat, 26 Sep 2026 11:20:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(e2e):=20=E9=80=82=E9=85=8D=20#1970=20?= =?UTF-8?q?=E4=BA=94=E6=AD=A5=E5=90=91=E5=AF=BC=E9=87=8D=E6=9E=84=20+=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20upload=20=E8=BD=AC=E7=A0=81=E8=B6=85?= =?UTF-8?q?=E6=97=B6=20(#2048)=20(#2049)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: frontend-dev Co-committed-by: frontend-dev --- apps/web/e2e/core-generation.spec.ts | 36 +++++++++++++--------------- apps/web/e2e/core-upload.spec.ts | 2 +- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/apps/web/e2e/core-generation.spec.ts b/apps/web/e2e/core-generation.spec.ts index 62a69202e..459c72cc2 100755 --- a/apps/web/e2e/core-generation.spec.ts +++ b/apps/web/e2e/core-generation.spec.ts @@ -160,12 +160,14 @@ test.describe("Core Smart-Edit Flow (#1970)", () => { ) await page.goto("/app/generate") - await expect(page.getByRole("heading", { name: "智能剪辑" })).toBeVisible({ - timeout: 30000, - }) + // ── 页面标题 ───────────────────────────────────────────────── + // GenerateHeader:

智能剪辑

+ // SVG icon 可能干扰 role=heading 的 accessible name,用文本包含兜底 + await expect(page.getByText("智能剪辑").first()).toBeVisible({ timeout: 30000 }) // ── Step 1:默认随机混剪选中,点下一步 ────────────────────────── - await expect(page.getByText("选择模式", { exact: true })).toBeVisible() + // h3 实际文案: "🎬 选择剪辑模式"(非 "选择模式"),用正则包含匹配 + await expect(page.getByText(/选择剪辑模式/)).toBeVisible() await expect(page.getByText("随机混剪")).toBeVisible() await page.getByRole("button", { name: /下一步/ }).click() @@ -180,11 +182,8 @@ test.describe("Core Smart-Edit Flow (#1970)", () => { await page.getByTestId("material-card").first().click() await page.getByRole("button", { name: /下一步/ }).click() - // ── 数量弹窗:默认 1 个 → 确认 ─────────────────────────────── - await expect(page.getByText("要生成几个视频?")).toBeVisible({ timeout: 5000 }) - await page.getByRole("button", { name: "生成 1 个视频" }).click() - // ── Step 3:填写标题 ────────────────────────────────────────── + // (#2048: PreviewCountModal 已移除,生成数量在 Step1 内设置) await expect(page.getByText("选择标题", { exact: true })).toBeVisible({ timeout: 10000 }) const titleInput = page.getByPlaceholder("输入或从标题库选择") await expect(titleInput).toBeVisible({ timeout: 5000 }) @@ -192,9 +191,10 @@ test.describe("Core Smart-Edit Flow (#1970)", () => { await page.getByRole("button", { name: /下一步/ }).click() // ── Step 4:确认生成 ────────────────────────────────────────── - await expect(page.getByText("📋 生成配置")).toBeVisible({ timeout: 10000 }) - await expect(page.getByText("随机混剪")).toBeVisible() + // (#2024: Step4 不再显示"📋 生成配置"卡片,内容区仅显示进度/错误) + // 等待底部操作栏的「✨ 确认生成视频」按钮可见即可 const confirmBtn = page.getByRole("button", { name: /确认生成视频/ }) + await expect(confirmBtn).toBeVisible({ timeout: 10000 }) await expect(confirmBtn).toBeEnabled({ timeout: 5000 }) const createTask = page.waitForResponse( @@ -324,12 +324,11 @@ test.describe("Core Smart-Edit Flow (#1970)", () => { ) await page.goto("/app/generate") - await expect(page.getByRole("heading", { name: "智能剪辑" })).toBeVisible({ - timeout: 30000, - }) + // ── 页面标题 ───────────────────────────────────────────────── + await expect(page.getByText("智能剪辑").first()).toBeVisible({ timeout: 30000 }) // ── Step 1:切到叙事剪辑 → 下一步 ──────────────────────────── - await expect(page.getByText("选择模式", { exact: true })).toBeVisible() + await expect(page.getByText(/选择剪辑模式/)).toBeVisible() await page.getByText("叙事剪辑").click() await page.getByRole("button", { name: /下一步/ }).click() @@ -351,11 +350,8 @@ test.describe("Core Smart-Edit Flow (#1970)", () => { await page.getByTestId("material-card").first().click() await page.getByRole("button", { name: /下一步/ }).click() - // ── 数量弹窗 ───────────────────────────────────────────────── - await expect(page.getByText("要生成几个视频?")).toBeVisible({ timeout: 5000 }) - await page.getByRole("button", { name: "生成 1 个视频" }).click() - // ── Step 3:填写标题(handleScriptModalConfirm 已预填 script.title,但我们再覆盖一次) ─ + // (#2048: PreviewCountModal 已移除) await expect(page.getByText("选择标题", { exact: true })).toBeVisible({ timeout: 10000 }) const titleInput2 = page.getByPlaceholder("输入或从标题库选择") await expect(titleInput2).toBeVisible({ timeout: 5000 }) @@ -363,9 +359,9 @@ test.describe("Core Smart-Edit Flow (#1970)", () => { await page.getByRole("button", { name: /下一步/ }).click() // ── Step 4:确认生成 ────────────────────────────────────────── - await expect(page.getByText("📋 生成配置")).toBeVisible({ timeout: 10000 }) - await expect(page.getByText("叙事剪辑")).toBeVisible() + // (#2024: Step4 不再显示"📋 生成配置"卡片) const confirmBtn2 = page.getByRole("button", { name: /确认生成视频/ }) + await expect(confirmBtn2).toBeVisible({ timeout: 10000 }) await expect(confirmBtn2).toBeEnabled({ timeout: 5000 }) const createTask2 = page.waitForResponse( diff --git a/apps/web/e2e/core-upload.spec.ts b/apps/web/e2e/core-upload.spec.ts index 9c036632d..16ed06549 100755 --- a/apps/web/e2e/core-upload.spec.ts +++ b/apps/web/e2e/core-upload.spec.ts @@ -161,7 +161,7 @@ test.describe("Core media upload flow", () => { const asset = data.items.find((item) => item.name === "e2e-sample.mp4") return asset ? `${asset.mime_type || asset.file_type || ""}:${asset.status}` : "missing" }, - { timeout: 30_000, intervals: [1_000, 2_000, 3_000] }, + { timeout: 90_000, intervals: [3_000, 5_000, 10_000] }, ) .toMatch(/^(video\/quicktime|video\/mp4|video)?:ready$/)