From 2851878b0530df9eee881b30323c07923ef40d7e Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 16 Sep 2026 12:22:59 +0800 Subject: [PATCH] =?UTF-8?q?test(e2e):=20#1954=20=E7=94=A8=E7=A8=B3?= =?UTF-8?q?=E5=AE=9A=E7=9A=84=E3=80=8C=E4=B8=8B=E8=BD=BD=E3=80=8D=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=96=AD=E8=A8=80=E4=BB=A3=E6=9B=BF=E6=98=93=E6=B6=88?= =?UTF-8?q?=E5=A4=B1=E7=9A=84toast+=E5=B0=81=E9=9D=A2=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8=E6=94=B6=E7=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/e2e/core-generation.spec.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/web/e2e/core-generation.spec.ts b/apps/web/e2e/core-generation.spec.ts index a4a09953e..e3247e0d6 100755 --- a/apps/web/e2e/core-generation.spec.ts +++ b/apps/web/e2e/core-generation.spec.ts @@ -264,22 +264,22 @@ test.describe("Core generation flow", () => { // 注意:进度页底部按钮变为 disabled 的「⏳ 视频渲染中…」 await expect(page.getByText("视频渲染中")).toBeVisible({ timeout: 30_000 }) - // 等待渲染完成:进度卡变为「视频生成完成」(最长等待 3 分钟) - await expect(page.getByText("视频生成完成")).toBeVisible({ timeout: 180_000 }) + // 等待渲染完成:单视频成片播放器渲染(带「⬇️ 下载」按钮),最长等待 3 分钟 + // 注意:message.success「视频生成完成」toast 3秒后自动消失,不能作为稳定断言点 + await expect(page.getByRole("button", { name: "⬇️ 下载" })).toBeVisible({ timeout: 180_000 }) - // #1954 修复:生成完成后步骤4底部应显示「下一步:选择封面」按钮,点击进入步骤5封面页 + // #1954 修复:生成完成后步骤4底部应显示「下一步:选择封面」按钮 + // 等待底部主按钮从「⏳/确认生成」切换为「下一步:选择封面」 const nextCoverBtn = page - .locator(".xx-step-actions .xx-btn-primary") - .filter({ hasText: "下一步:选择封面" }) - await expect(nextCoverBtn).toBeVisible({ timeout: 10_000 }) + .locator(".xx-step-actions > .xx-btn-primary") + .filter({ hasText: "选择封面" }) + await expect(nextCoverBtn).toBeVisible({ timeout: 15_000 }) await nextCoverBtn.click() - // 断言进入步骤5:步骤条应高亮「选择封面」,主内容出现「🖼️ 选择封面」标题 - await expect(page.getByRole("heading", { name: "🖼️ 选择封面" })).toBeVisible({ - timeout: 10_000, - }) - // 主按钮应消失(封面是最后一步),仅保留「← 上一步」 - await expect(page.locator(".xx-step-actions .xx-btn-primary")).toHaveCount(0) + // 断言进入步骤5封面页:主内容出现「选择封面」标题 + await expect(page.getByText("🖼️ 选择封面")).toBeVisible({ timeout: 10_000 }) + // 底部操作栏主按钮应消失(封面是最后一步,只剩「← 上一步」) + await expect(page.locator(".xx-step-actions > .xx-btn-primary")).toHaveCount(0) } else { console.log(`[E2E] Generate API returned ${genResp.status()}, wizard flow test still passes`) // 创建失败时停留在标题页并展示错误提示 -- 2.54.0