test(e2e): p1b cross-frontend playwright journey

- viewer playwright.config: third webServer boots admin dev (5176,
  reuseExisting) so one config serves both frontends
- journey.spec.ts: admin UI (login, zh+en album, real-jpeg banner via
  file chooser, category, staffB invite by account search, logout) ->
  staffB API uploads x3 (init/presign-PUT/complete) -> worker
  PublishService.processPhoto x3 -> public list verify -> viewer UI
  (banner bytes, zh->en switch, waterfall 3, chip filter 1, lightbox
  zoom/close, deep link) -> admin hide -> viewer 2 + hidden deep-link
  404 notice -> empty album state
- cleanup: journey album domain rows + staffB account via Prisma

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-18 12:54:18 +08:00
parent 50c59ca9d4
commit 40f8f37ca4
2 changed files with 472 additions and 0 deletions
+9
View File
@@ -3,6 +3,8 @@ import { defineConfig, devices } from '@playwright/test';
// Task 6 起 e2e 打真实后端:webServer 先等 API(8080,仓库根 `pnpm dev:api`
// 构建+启动;已在跑的实例直接复用),再等 viewer dev(5175,/v1 代理 → 8080)。
// compose 基础设施(MySQL/MinIO/Redis)需预先 `docker compose up -d`(计划约定)。
// Task 11 起跨端联调:第三个 webServer 一并等 admin dev(5176,/v1 代理 → 8080,
// 同样复用已在跑的实例)——journey.spec.ts 以绝对 baseURL 驱动 admin 腿。
export default defineConfig({
testDir: './e2e',
timeout: 30_000,
@@ -27,5 +29,12 @@ export default defineConfig({
reuseExistingServer: true,
timeout: 60_000,
},
{
command: 'pnpm run dev',
cwd: '../admin',
url: 'http://127.0.0.1:5176',
reuseExistingServer: true,
timeout: 120_000, // 首次含模板依赖预构建
},
],
});