fix(e2e): 素材卡片点击命中播放按钮导致选中失败
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3m49s
CI/CD Pipeline / Build Staging API Image (push) Successful in 4m13s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 1m17s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 6m32s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 4m7s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m25s
AI Code Review / AI Code Review (pull_request) Failing after 4m50s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 26s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 29s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m47s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 2m28s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 14m50s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 15m53s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1m55s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m39s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m31s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 19m2s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 19m12s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 41m46s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 42m16s
CI/CD Pipeline / Unit Tests (push) Has been cancelled
CI/CD Pipeline / 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 471h49m53s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 471h49m55s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 471h51m48s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 471h52m19s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 471h55m22s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 471h52m47s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 471h57m41s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 471h52m49s
CI/CD Pipeline / PR Build API Image (push) Failing after 471h57m45s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 471h57m47s
CI/CD Pipeline / Frontend Lint (push) Failing after 471h59m34s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 471h57m49s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 471h57m51s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 472h3m24s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 472h23m57s
CI/CD Pipeline / PR Build Web Image (push) Failing after 472h31m43s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3m49s
CI/CD Pipeline / Build Staging API Image (push) Successful in 4m13s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 1m17s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 6m32s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 4m7s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m25s
AI Code Review / AI Code Review (pull_request) Failing after 4m50s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 26s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 29s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m47s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 2m28s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 14m50s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 15m53s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1m55s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m39s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m31s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 19m2s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 19m12s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 41m46s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 42m16s
CI/CD Pipeline / Unit Tests (push) Has been cancelled
CI/CD Pipeline / 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 471h49m53s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 471h49m55s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 471h51m48s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 471h52m19s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Failing after 471h55m22s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 471h52m47s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 471h57m41s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 471h52m49s
CI/CD Pipeline / PR Build API Image (push) Failing after 471h57m45s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 471h57m47s
CI/CD Pipeline / Frontend Lint (push) Failing after 471h59m34s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 471h57m49s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 471h57m51s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 472h3m24s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 472h23m57s
CI/CD Pipeline / PR Build Web Image (push) Failing after 472h31m43s
根因:Playwright 默认点击卡片中心(150px 宽卡片中心约 x=55,y=100), 正好命中 36×36 播放按钮。播放按钮 stopPropagation 只切换视频播放, 不会触发 onToggle 选中,因此勾选标记 ✓ 永远不出现,E2E 5s 超时失败。 修复: - MaterialCard 勾选标记加 data-testid=material-card-check,卡片加 data-testid=material-card - E2E 用 testid 定位卡片,点击左上角 (15,15) 避开播放按钮 - 勾选标记断言改用 testid,避免 ✓ 字符文本匹配不稳定
This commit is contained in:
@@ -190,11 +190,12 @@ test.describe("Core generation flow", () => {
|
||||
const librarySelect = page.locator("select").first()
|
||||
await librarySelect.selectOption({ label: libraryName })
|
||||
// 新 UI: 素材以 9:16 竖屏卡片展示,点击卡片选中
|
||||
const materialCard = page.getByText(sourceFileName).locator("..")
|
||||
// 注意:卡片中心是播放按钮(stopPropagation 会阻止选中),所以点击左上角避开
|
||||
const materialCard = page.getByTestId("material-card").filter({ hasText: sourceFileName })
|
||||
await expect(materialCard).toBeVisible({ timeout: 10_000 })
|
||||
await materialCard.click()
|
||||
// 验证选中:卡片应出现勾选标记 ✓
|
||||
await expect(materialCard.getByText("✓")).toBeVisible({ timeout: 5_000 })
|
||||
await materialCard.click({ position: { x: 15, y: 15 } })
|
||||
// 验证选中:卡片应出现勾选标记(用 testid 定位,避免 ✓ 字符文本匹配不稳定)
|
||||
await expect(materialCard.getByTestId("material-card-check")).toBeVisible({ timeout: 5_000 })
|
||||
await page.getByRole("button", { name: "下一步" }).click()
|
||||
|
||||
// Step 3: voice (可选步骤,新注册用户无配音素材,直接跳过)
|
||||
|
||||
@@ -70,6 +70,7 @@ const MaterialCard: React.FC<{
|
||||
|
||||
return (
|
||||
<div
|
||||
data-testid="material-card"
|
||||
onClick={handleCardClick}
|
||||
style={{
|
||||
position: "relative",
|
||||
@@ -216,6 +217,8 @@ const MaterialCard: React.FC<{
|
||||
{/* 选中勾选标记(左上角) */}
|
||||
{checked && (
|
||||
<div
|
||||
data-testid="material-card-check"
|
||||
aria-label="已选中"
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 6,
|
||||
|
||||
Reference in New Issue
Block a user