fix(e2e): 适配素材卡片网格UI + 注册限流重试
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 2m50s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3m58s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 4m49s
CI/CD Pipeline / Build Staging API Image (push) Successful in 5m17s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 5m13s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 5m47s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 5m15s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 2m5s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m52s
AI Code Review / AI Code Review (pull_request) Failing after 6m41s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 9m23s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 6m33s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 4m13s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m12s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 5m57s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 11m34s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 12m13s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 1m40s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 2m12s
CI/CD Pipeline / Unit Tests (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (push) Has been cancelled
CI/CD Pipeline / Build Production API Image (push) Has been cancelled
CI/CD Pipeline / Build Production Web Image (push) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Production (push) Has been cancelled
CI/CD Pipeline / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / Canary Release to Production (push) Has been cancelled
CI/CD Pipeline / CI Gate (push) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 479h43m48s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 479h43m50s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 479h45m44s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 479h45m59s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 479h46m1s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 479h46m19s
CI/CD Pipeline / PR Build Web Image (push) Failing after 479h46m21s
CI/CD Pipeline / PR Build API Image (push) Failing after 479h46m23s
CI/CD Pipeline / Frontend Lint (push) Failing after 479h47m21s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 479h48m9s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 479h49m15s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 479h49m19s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 479h52m10s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 480h17m50s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 480h19m57s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 480h23m17s

- core-generation.spec.ts: 素材选择从 checkbox 改为点击卡片+验证✓标记
- test_asset.spec.ts: 注册接口增加 429 限流重试逻辑
This commit is contained in:
xiaoxia
2026-08-27 15:33:31 +08:00
parent 29c0d76677
commit 195339d0f8
2 changed files with 29 additions and 9 deletions
+7 -6
View File
@@ -185,15 +185,16 @@ test.describe("Core generation flow", () => {
await expect(page.locator(".xx-choice-item.selected")).toBeVisible()
await page.getByRole("button", { name: "下一步" }).click()
// Step 2: select material
// Step 2: select material (card grid UI)
await expect(page.getByRole("heading", { name: /选择素材/ })).toBeVisible()
const librarySelect = page.locator("select").first()
await librarySelect.selectOption({ label: libraryName })
const materialLabel = page.getByText(sourceFileName).locator("..")
await expect(materialLabel.locator("input[type='checkbox']")).toBeVisible({
timeout: 10_000,
})
await materialLabel.locator("input[type='checkbox']").check()
// 新 UI: 素材以 9:16 竖屏卡片展示,点击卡片选中
const materialCard = page.getByText(sourceFileName).locator("..")
await expect(materialCard).toBeVisible({ timeout: 10_000 })
await materialCard.click()
// 验证选中:卡片应出现勾选标记 ✓
await expect(materialCard.getByText("✓")).toBeVisible({ timeout: 5_000 })
await page.getByRole("button", { name: "下一步" }).click()
// Step 3: voice (可选步骤,新注册用户无配音素材,直接跳过)
+22 -3
View File
@@ -37,14 +37,33 @@ async function loginWithRetry(
})
}
async function registerWithRetry(
request: APIRequestContext,
email: string,
username: string,
password: string,
displayName: string,
maxRetries = 2,
) {
for (let i = 0; i <= maxRetries; i++) {
const response = await request.post(`${apiBase}/auth/register`, {
data: { email, password, username, display_name: displayName },
})
if (response.status() !== 429) return response
console.log(`[register] 触发限流,等待 65s 后重试 (${i + 1}/${maxRetries})`)
await new Promise((r) => setTimeout(r, 65000))
}
return request.post(`${apiBase}/auth/register`, {
data: { email, password, username, display_name: displayName },
})
}
/** 注册并登录,返回 { headers, email, username, userId } */
async function createAuthedUser(request: APIRequestContext, label: string) {
const email = uniqueEmail(label)
const username = uniqueUsername(label)
const reg = await request.post(`${apiBase}/auth/register`, {
data: { email, password: PASSWORD, username, display_name: `E2E ${label}` },
})
const reg = await registerWithRetry(request, email, username, PASSWORD, `E2E ${label}`)
expect(reg.ok(), `注册应成功: ${await reg.text()}`).toBeTruthy()
const regData = await reg.json()