fix(e2e): 加固核心生成向导冒烟测试(v2:按钮定位/等待/进度页断言) (#1950)
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 0s
CI/CD Pipeline / Check push changed paths (push) Successful in 4s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 1m54s
CI/CD Pipeline / Integration Tests (push) Successful in 3m5s
CI/CD Pipeline / Build Staging API Image (push) Successful in 3m14s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 3m26s
CI/CD Pipeline / Validate - Style (push) Successful in 3m28s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 3m42s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 58s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m49s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m38s
CI/CD Pipeline / Validate - Security (push) Successful in 7m23s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m5s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 3m9s
CI/CD Pipeline / Unit Tests (push) Successful in 13m2s
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / CI Gate (push) Failing after 6h26m59s
CI/CD Pipeline / Frontend Lint (push) Failing after 6h40m1s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 6h39m15s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 6h35m41s
CI/CD Pipeline / PR Build Web Image (push) Failing after 6h39m9s
CI/CD Pipeline / Deploy Production (push) Failing after 6h26m3s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 6h26m7s
CI/CD Pipeline / Build Production Web Image (push) Failing after 6h26m7s
CI/CD Pipeline / Build Production API Image (push) Failing after 6h26m7s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 6h35m40s
CI/CD Pipeline / Canary Release to Production (push) Failing after 6h26m3s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 6h35m40s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 6h39m9s
CI/CD Pipeline / PR Build API Image (push) Failing after 6h39m10s

Co-authored-by: xiaoxia <dev@xiaoxiajianji.com>
Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
This commit was merged in pull request #1950.
This commit is contained in:
2026-09-16 08:43:36 +08:00
committed by auto-approve-bot
parent 67b270bce2
commit 3f27d199f5
+19 -12
View File
@@ -51,7 +51,7 @@ type AssetListResponse = {
test.describe("Core generation flow", () => {
test.describe.configure({ timeout: 360_000 })
test("walks through 5-step wizard and starts generation", async ({ page, request }) => {
test("walks through wizard with count modal and starts generation", async ({ page, request }) => {
test.setTimeout(360_000)
await routeBrowserApiToTestApi(page)
@@ -215,19 +215,25 @@ test.describe("Core generation flow", () => {
.waitFor({ state: "detached", timeout: 30_000 })
.catch(() => {})
// Wait for generation API to be called
// 前端直接创建生成任务:POST /generation/tasks
// 定位底部操作栏的「✨ 确认生成视频」按钮(带 emoji 前缀,Playwright hasText 是子串匹配,无需写全)
// 使用底部操作栏 xx-step-actions 作用域,避免命中标题页内的"换一个""生成标题"等其他 primary 按钮
const confirmBtn = page
.locator(".xx-step-actions .xx-btn-primary")
.filter({ hasText: "确认生成" })
await expect(confirmBtn).toBeVisible({ timeout: 30_000 })
await expect(confirmBtn).toBeEnabled({ timeout: 30_000 })
// Wait for generation API to be called — 先挂监听再点击,避免竞态
const generatePromise = page.waitForResponse(
(response) => {
const url = response.url()
const path = new URL(url).pathname
return response.request().method() === "POST" && path.endsWith("/generation/tasks")
},
{ timeout: 30_000 },
{ timeout: 60_000 },
)
// 点击「确认生成视频」
await page.locator(".xx-btn-primary").filter({ hasText: "确认生成视频" }).first().click()
await confirmBtn.click()
// Verify generation was triggered
const genResp = await generatePromise
@@ -247,16 +253,17 @@ test.describe("Core generation flow", () => {
expect(genData.items.length).toBeGreaterThan(0)
expect(genData.items[0].id).toBeTruthy()
// 单视频(N=1):点击「确认生成视频」后跳 Step 4「确认生成」,展示实时渲染进度
await expect(page.getByRole("heading", { name: "🎬 确认生成" })).toBeVisible({
timeout: 30_000,
})
// 单视频(N=1):点击「确认生成视频」后跳步骤 4「确认生成」进度页,展示进度卡
// 注意:Step4 内容只有进度卡/错误卡,没有 h3「🎬 确认生成」标题;标题由 StepsBar 展示
await expect(page.getByText("视频渲染中")).toBeVisible({ timeout: 30_000 })
// 等待渲染完成:进度卡变为「视频生成完成」(最长等待 3 分钟)
await expect(page.getByText("视频生成完成")).toBeVisible({ timeout: 180_000 })
// 全部完成后「下一步:选择封面」解锁,点击进入 Step 5
await page.getByRole("button", { name: /下一步:选择封面/ }).click()
// 全部完成后底部按钮变为「下一步:选择封面」,点击进入 Step 5
const nextCoverBtn = page.getByRole("button", { name: /下一步:选择封面/ })
await expect(nextCoverBtn).toBeVisible({ timeout: 30_000 })
await nextCoverBtn.click()
await expect(page.getByRole("heading", { name: /选择封面/ })).toBeVisible({
timeout: 30_000,
})