chore: v0.2.3 — e2e launches browsers on shared remote Playwright server by default (E2E_LOCAL/E2E_REMOTE)
This commit is contained in:
+14
-3
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user