fix(e2e): replace removed POST /templates with GET /templates (#1926 auto-default)
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m33s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m41s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m53s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m53s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 4m42s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 4m50s
AI Code Review / AI Code Review (pull_request) Successful in 6m43s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 10m13s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 4s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 9m19s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 21s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 39s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 12m59s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 25h34m45s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 25h45m17s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 25h45m23s
CI/CD Pipeline / PR Build API Image (pull_request) Failing after 25h45m25s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 25h44m46s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 25h44m45s
CI/CD Pipeline / PR Build Worker Image (pull_request) Failing after 25h44m47s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 25h34m9s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 25h34m9s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 25h34m11s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 25h44m49s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 25h34m6s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 25h44m39s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 25h44m44s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 25h44m45s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 25h44m39s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 25h44m43s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 25h44m44s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 25h44m46s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 26h20m20s

This commit is contained in:
2026-09-15 13:38:02 +08:00
parent 0c59f83a7f
commit 8e9e8a1c8e
+11 -23
View File
@@ -40,7 +40,6 @@ async function loginWithRetry(
type ProjectResponse = { id: string }
type LibraryResponse = { id: string }
type TemplateResponse = { id: string }
type AssetListResponse = {
items: Array<{
id: string
@@ -126,28 +125,17 @@ test.describe("Core generation flow", () => {
)
.toBe("ready")
// Create an editing template so the generate page has at least one template
// (templates are now loaded from API; new users have none by default)
const template = await request.post(`${apiBase}/templates`, {
headers,
data: {
name: `E2E 测试模板 ${suffix}`,
mode: "pip",
estimated_duration: 30,
segments: [
{
segment_order: 1,
duration_min: 5,
duration_max: 30,
material_type: "video",
},
],
tags: ["e2e"],
},
})
expect(template.status(), await template.text()).toBe(201)
const templateData = (await template.json()) as TemplateResponse
expect(templateData.id).toBeTruthy()
// #1926 P0 fix: POST /templates CRUD endpoint removed; GET /templates
// now auto-creates a default template for new users. Use the first one.
const templatesResp = await request.get(`${apiBase}/templates`, { headers })
expect(templatesResp.status(), await templatesResp.text()).toBe(200)
const templatesData = (await templatesResp.json()) as {
items: Array<{ id: string }>
}
expect(Array.isArray(templatesData.items)).toBe(true)
expect(templatesData.items.length).toBeGreaterThan(0)
const templateId = templatesData.items[0].id
expect(templateId).toBeTruthy()
// Set auth in localStorage
await page.addInitScript(