fix(e2e): 用真实视频文件替换假buffer,修复Staging E2E上传失败 (#634)
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Build Staging API Image (push) Successful in 6m13s
CI/CD Pipeline / Build Staging Web Image (push) Failing after 6m24s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 8m38s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Successful in 8m12s
CI/CD Pipeline / Validate Code Quality And Tests (push) Successful in 5m40s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 6m47s
CI/CD Pipeline / Unit Tests (push) Failing after 7m28s
CI/CD Pipeline / Integration Tests (push) Successful in 3m52s

Co-authored-by: xiaoxia <dev@xiaoxiajianji.com>
Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
This commit was merged in pull request #634.
This commit is contained in:
2026-07-20 12:56:34 +08:00
committed by auto-approve-bot
parent f01f4803e4
commit afae36bf04
2 changed files with 15 additions and 7 deletions
+5 -1
View File
@@ -1,4 +1,6 @@
import { expect, test, type APIRequestContext } from "@playwright/test"
import * as fs from "node:fs"
import * as path from "node:path"
const PASSWORD = "SmokePass123!"
const apiBase = process.env.E2E_API_BASE || "/api/v1"
@@ -88,6 +90,8 @@ test.describe("Core generation flow", () => {
// Upload source video
const sourceFileName = "e2e-gen-source.mp4"
const sampleVideoPath = path.join(__dirname, "fixtures", "sample.mp4")
const sampleVideoBuffer = fs.readFileSync(sampleVideoPath)
const upload = await request.post(`${apiBase}/upload`, {
headers,
multipart: {
@@ -96,7 +100,7 @@ test.describe("Core generation flow", () => {
file: {
name: sourceFileName,
mimeType: "video/mp4",
buffer: Buffer.from("e2e source data"),
buffer: sampleVideoBuffer,
},
},
})
+10 -6
View File
@@ -1,4 +1,6 @@
import { expect, test, type APIRequestContext } from "@playwright/test"
import * as fs from "node:fs"
import * as path from "node:path"
const PASSWORD = "SmokePass123!"
const apiBase = process.env.E2E_API_BASE || "/api/v1"
@@ -116,15 +118,17 @@ test.describe("Core media upload flow", () => {
timeout: 20_000,
})
const sampleVideoPath = path.join(__dirname, "fixtures", "sample.mp4")
const sampleVideoBuffer = fs.readFileSync(sampleVideoPath)
const upload = await request.post(`${apiBase}/upload`, {
headers,
multipart: {
project_id: projectData.id,
library_id: libraryData.id,
file: {
name: "e2e-sample.MOV",
mimeType: "video/quicktime",
buffer: Buffer.from("playwright mov upload smoke"),
name: "e2e-sample.mp4",
mimeType: "video/mp4",
buffer: sampleVideoBuffer,
},
},
})
@@ -152,7 +156,7 @@ test.describe("Core media upload flow", () => {
mime_type?: string
}>
}
const asset = data.items.find((item) => item.name === "e2e-sample.MOV")
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] },
@@ -169,12 +173,12 @@ test.describe("Core media upload flow", () => {
await expect(page.locator(".xx-assets-content")).toBeVisible({
timeout: 20_000,
})
await expect(page.getByText("e2e-sample.MOV", { exact: true })).toBeVisible({
await expect(page.getByText("e2e-sample.mp4", { exact: true })).toBeVisible({
timeout: 20_000,
})
// Verify asset card shows status
const assetCard = page.locator(".xx-asset-card").filter({ hasText: "e2e-sample.MOV" })
const assetCard = page.locator(".xx-asset-card").filter({ hasText: "e2e-sample.mp4" })
await expect(assetCard).toBeVisible()
await expect(assetCard.locator(".xx-asset-diagnose-btn")).toBeVisible()