Files
goodgo-platform/playwright.config.ts
Ho Ngoc Hai 271ad76e6f fix: resolve E2E test failures and API runtime issues for Docker dev environment
- Fix DI issues: circular MCP module dependency, EventBus type import,
  SearchModule provider, CacheService metric counters placement
- Fix Express 5 readonly req.query in SanitizeInputMiddleware
- Fix Typesense client lazy initialization (getter instead of constructor)
- Fix MinIO bucket init error handling (non-fatal on 403)
- Fix missing class-validator decorators on bigint DTO fields (priceVND, amountVND)
- Fix subscription plan 404 (was returning 500 for invalid tier)
- Disable CSRF and raise rate limits in test environment
- Update E2E tests to match actual API response shapes
- Update CI workflow with Redis, Typesense, MinIO services and env vars

All 101 API E2E tests now pass against Docker dev environment.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-08 05:44:00 +07:00

63 lines
1.5 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
/**
* Playwright E2E configuration for Goodgo Platform.
*
* Projects:
* - "api" — tests against the NestJS API (port 3001)
* - "web" — tests against the Next.js frontend (port 3000)
*/
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI
? [['html', { open: 'never' }], ['github']]
: [['html', { open: 'on-failure' }]],
use: {
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
// API E2E tests — no browser needed, uses APIRequestContext
{
name: 'api',
testDir: './e2e/api',
use: {
baseURL: process.env.API_BASE_URL ?? 'http://localhost:3001',
},
},
// Web E2E tests — Chromium browser
{
name: 'web',
testDir: './e2e/web',
use: {
...devices['Desktop Chrome'],
baseURL: process.env.WEB_BASE_URL ?? 'http://localhost:3000',
},
},
],
webServer: [
{
command: 'pnpm --filter @goodgo/api run dev',
url: 'http://localhost:3001/api/docs',
reuseExistingServer: !process.env.CI,
timeout: 60_000,
env: {
NODE_ENV: 'test',
},
},
{
command: 'pnpm --filter @goodgo/web run dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 30_000,
},
],
});