chore: v0.2.5 — e2e workflow mandated in AGENTS.md, local dev path removed from config

This commit is contained in:
2026-09-16 21:23:18 +00:00
parent db624b94e2
commit f3d8f4b163
4 changed files with 22 additions and 25 deletions
+12 -24
View File
@@ -1,17 +1,12 @@
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 = 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';
// Browsers run on the shared remote Playwright server (Docker, 192.168.1.4:3000);
// the app under test is always the prod build behind Traefik (docker compose).
// NOTE: never point this at a local `next dev` — Turbopack's HMR WS fails for
// non-loopback clients and the page renders blank; a second instance also splits state.
const remoteRunner = process.env.E2E_REMOTE === '1';
if (!local && !process.env.PW_TEST_CONNECT_WS_ENDPOINT) {
if (!process.env.PW_TEST_CONNECT_WS_ENDPOINT) {
process.env.PW_TEST_CONNECT_WS_ENDPOINT = 'ws://192.168.1.4:3000/';
}
@@ -20,22 +15,15 @@ export default defineConfig({
timeout: 30_000,
retries: 1,
use: {
baseURL: process.env.E2E_BASE_URL ?? (local ? 'http://localhost:3000' : 'https://flight.dev.kkhost.pl'),
baseURL: process.env.E2E_BASE_URL ?? 'https://flight.dev.kkhost.pl',
trace: 'on-first-retry',
},
webServer: remoteRunner
? undefined
: 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,
},
: {
command: 'docker compose up -d --build',
url: 'https://flight.dev.kkhost.pl/api/airports',
reuseExistingServer: true,
timeout: 300_000,
},
});