chore: v0.2.3 — e2e launches browsers on shared remote Playwright server by default (E2E_LOCAL/E2E_REMOTE)

This commit is contained in:
2026-09-16 20:31:24 +00:00
parent 185e914db2
commit 967bb123b6
3 changed files with 19 additions and 4 deletions
+4
View File
@@ -1,5 +1,9 @@
# Changelog
## 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`
- `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
## v0.2.2 — 2026-09-16 20:05
- `playwright.config.ts`: e2e suite can now run on a different machine than the app — with `E2E_REMOTE=1` the local `webServer` block is skipped entirely and `baseURL` defaults to `http://flight.dev.kkhost.pl`; `E2E_BASE_URL` overrides `baseURL` in both modes; with no env vars set behavior is unchanged (local `webServer` auto-starts `npm run dev`)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "flight-ops",
"version": "0.2.2",
"version": "0.2.3",
"private": true,
"scripts": {
"dev": "next dev -p 3000",
+14 -3
View File
@@ -1,16 +1,27 @@
import { defineConfig } from '@playwright/test';
const remote = !!process.env.E2E_REMOTE;
// 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).
// 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';
if (!local && !process.env.PW_TEST_CONNECT_WS_ENDPOINT) {
process.env.PW_TEST_CONNECT_WS_ENDPOINT = 'ws://192.168.1.4:3000/';
}
export default defineConfig({
testDir: './e2e',
timeout: 30_000,
retries: 1,
use: {
baseURL: process.env.E2E_BASE_URL ?? (remote ? 'http://flight.dev.kkhost.pl' : 'http://localhost:3000'),
baseURL: process.env.E2E_BASE_URL ?? (local ? 'http://localhost:3000' : 'http://192.168.1.26:3000'),
trace: 'on-first-retry',
},
webServer: remote
webServer: remoteRunner
? undefined
: {
command: 'npm run dev',