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
+4
View File
@@ -1,5 +1,9 @@
# Changelog # Changelog
## v0.2.4 — 2026-09-16 21:06
- `playwright.config.ts`: default e2e mode now targets the prod build behind Traefik (`https://flight.dev.kkhost.pl`) — `baseURL` defaults to that URL and `webServer` runs `docker compose up -d --build` (300 s timeout) instead of `npm run dev`, because `next dev` does not render for non-loopback clients: Turbopack's HMR WebSocket fails from the remote browsers, so the page loads blank
- `E2E_LOCAL=1` keeps the local iteration path (browsers on this box, `webServer` auto-starts `npm run dev`, baseURL `localhost:3000`) as a fallback when the proxy or compose stack is down; `E2E_REMOTE=1` and explicit `PW_TEST_CONNECT_WS_ENDPOINT`/`E2E_BASE_URL` overrides are unchanged
## v0.2.3 — 2026-09-16 20:30 ## v0.2.3 — 2026-09-16 20:30
- `playwright.config.ts`: e2e now launches browsers on the shared remote Playwright server (Docker, `ws://192.168.1.4:3000/`) by default — when no env vars are set it exports `PW_TEST_CONNECT_WS_ENDPOINT` pointing at that box; in this mode `baseURL` defaults to this box's LAN IP (`http://192.168.1.26:3000`) because pages load from the remote browser's perspective, while the local `webServer` still auto-starts `npm run dev` - `playwright.config.ts`: e2e now launches browsers on the shared remote Playwright server (Docker, `ws://192.168.1.4:3000/`) by default — when no env vars are set it exports `PW_TEST_CONNECT_WS_ENDPOINT` pointing at that box; in this mode `baseURL` defaults to this box's LAN IP (`http://192.168.1.26:3000`) because pages load from the remote browser's perspective, while the local `webServer` still auto-starts `npm run dev`
- `E2E_LOCAL=1` restores fully-local runs (browsers on this box, `localhost:3000` baseURL) as a fallback when the remote server is down; `E2E_REMOTE=1` keeps its previous behavior for runners on other machines — skips `webServer` entirely and pairs with `E2E_BASE_URL`; an explicit `PW_TEST_CONNECT_WS_ENDPOINT` always wins over the default - `E2E_LOCAL=1` restores fully-local runs (browsers on this box, `localhost:3000` baseURL) as a fallback when the remote server is down; `E2E_REMOTE=1` keeps its previous behavior for runners on other machines — skips `webServer` entirely and pairs with `E2E_BASE_URL`; an explicit `PW_TEST_CONNECT_WS_ENDPOINT` always wins over the default
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "flight-ops", "name": "flight-ops",
"version": "0.2.3", "version": "0.2.4",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev -p 3000", "dev": "next dev -p 3000",
+19 -10
View File
@@ -2,9 +2,11 @@ import { defineConfig } from '@playwright/test';
// Where browsers run and how the app is addressed: // Where browsers run and how the app is addressed:
// (default) browsers on the shared remote Playwright server (Docker, 192.168.1.4:3000); // (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 // app = prod build behind Traefik at https://flight.dev.kkhost.pl (docker compose).
// from the remote browser's perspective. // NOTE: don't point this at `next dev` over the LAN — Turbopack's HMR WS fails for
// E2E_LOCAL=1 everything local — browsers here, localhost baseURL (fallback when B is down). // 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. // 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 local = process.env.E2E_LOCAL === '1';
const remoteRunner = process.env.E2E_REMOTE === '1'; const remoteRunner = process.env.E2E_REMOTE === '1';
@@ -18,15 +20,22 @@ export default defineConfig({
timeout: 30_000, timeout: 30_000,
retries: 1, retries: 1,
use: { 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', trace: 'on-first-retry',
}, },
webServer: remoteRunner webServer: remoteRunner
? undefined ? undefined
: { : local
command: 'npm run dev', ? {
url: 'http://localhost:3000/api/airports', command: 'npm run dev',
reuseExistingServer: true, url: 'http://localhost:3000/api/airports',
timeout: 120_000, reuseExistingServer: true,
}, timeout: 120_000,
}
: {
command: 'docker compose up -d --build',
url: 'https://flight.dev.kkhost.pl/api/airports',
reuseExistingServer: true,
timeout: 300_000,
},
}); });