chore: v0.2.4 — e2e default mode targets prod build behind Traefik via docker compose

This commit is contained in:
2026-09-16 21:07:48 +00:00
parent 967bb123b6
commit db624b94e2
3 changed files with 24 additions and 11 deletions
+19 -10
View File
@@ -2,9 +2,11 @@ import { defineConfig } from '@playwright/test';
// Where browsers run and how the app is addressed:
// (default) browsers on the shared remote Playwright server (Docker, 192.168.1.4:3000);
// app local via webServer; baseURL = this box's LAN IP because pages load
// from the remote browser's perspective.
// E2E_LOCAL=1 everything local — browsers here, localhost baseURL (fallback when B is down).
// app = prod build behind Traefik at https://flight.dev.kkhost.pl (docker compose).
// NOTE: don't point this at `next dev` over the LAN — Turbopack's HMR WS fails for
// non-loopback clients and the page renders blank.
// E2E_LOCAL=1 everything local — browsers here, `npm run dev` on localhost:3000
// (fast iteration; fallback when remote server or proxy is down).
// E2E_REMOTE=1 runner not on this box: skip webServer; pair with E2E_BASE_URL if needed.
const local = process.env.E2E_LOCAL === '1';
const remoteRunner = process.env.E2E_REMOTE === '1';
@@ -18,15 +20,22 @@ export default defineConfig({
timeout: 30_000,
retries: 1,
use: {
baseURL: process.env.E2E_BASE_URL ?? (local ? 'http://localhost:3000' : 'http://192.168.1.26:3000'),
baseURL: process.env.E2E_BASE_URL ?? (local ? 'http://localhost:3000' : 'https://flight.dev.kkhost.pl'),
trace: 'on-first-retry',
},
webServer: remoteRunner
? undefined
: {
command: 'npm run dev',
url: 'http://localhost:3000/api/airports',
reuseExistingServer: true,
timeout: 120_000,
},
: local
? {
command: 'npm run dev',
url: 'http://localhost:3000/api/airports',
reuseExistingServer: true,
timeout: 120_000,
}
: {
command: 'docker compose up -d --build',
url: 'https://flight.dev.kkhost.pl/api/airports',
reuseExistingServer: true,
timeout: 300_000,
},
});