Files
token-circles/frontend/playwright.config.ts
T
Komediruzecki 4697f45c7a fix(e2e): make the vite dev proxy target configurable; pin Playwright to the seeded backend
The previous commit hardcoded the dev proxy to the worker (:8787), which would
break the e2e job: Playwright runs `vite dev` and the @smoke CRUD specs hit the
backend seeded on :3847. Read API_PROXY_TARGET (default :8787 for local worker
dev) and set it to :3847 in the Playwright webServer env so E2E is unaffected.
2026-06-27 19:33:06 +02:00

41 lines
999 B
TypeScript

import { defineConfig, devices } from '@playwright/test'
import os from 'os'
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
timeout: 60000,
testDir: './tests',
fullyParallel: true,
forbidOnly: process.env.CI !== undefined,
retries: 0,
workers: os.cpus().length,
reporter: 'list',
use: {
baseURL: 'http://127.0.0.1:3800',
trace: 'retain-on-failure',
headless: true,
testIdAttribute: 'data-test-id',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: 'npm run dev',
url: 'http://127.0.0.1:3800',
reuseExistingServer: !process.env.CI,
timeout: 120000,
stdout: 'pipe',
stderr: 'pipe',
// The e2e backend runs on :3847 (started + seeded in CI). Pin the vite dev proxy there,
// regardless of the local-dev default (the Cloudflare worker on :8787).
env: { API_PROXY_TARGET: 'http://127.0.0.1:3847' },
},
})