From 967bb123b6490b110aed25ed4906053ecaadf33a Mon Sep 17 00:00:00 2001 From: Kamil Krzywda Date: Wed, 16 Sep 2026 20:31:24 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20v0.2.3=20=E2=80=94=20e2e=20launches=20?= =?UTF-8?q?browsers=20on=20shared=20remote=20Playwright=20server=20by=20de?= =?UTF-8?q?fault=20(E2E=5FLOCAL/E2E=5FREMOTE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ package.json | 2 +- playwright.config.ts | 17 ++++++++++++++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 249e50d..eeef210 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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`) diff --git a/package.json b/package.json index aa237a8..7bc177d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flight-ops", - "version": "0.2.2", + "version": "0.2.3", "private": true, "scripts": { "dev": "next dev -p 3000", diff --git a/playwright.config.ts b/playwright.config.ts index d0db9c3..51f82b5 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -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',