chore: v0.13.0 — CI pipeline (build → unit → e2e) on PRs to master + push, dind-isolated e2e stack (docker-compose.ci.yml), playwright config env-var overrides (PW_REMOTE_BROWSER/E2E_DEPLOY_CMD/E2E_BASE_URL/E2E_COMPOSE_ARGS, backward-compatible), @playwright/test pinned as devDependency; AGENTS.md switched to pull-request workflow
This commit is contained in:
+16
-12
@@ -1,11 +1,20 @@
|
||||
import { defineConfig } from '@playwright/test';
|
||||
|
||||
const remoteRunner = true;
|
||||
// Browsers run on the shared remote Playwright server by default (AGENTS.md).
|
||||
// PW_REMOTE_BROWSER=0 → local browsers instead (CI, or boxes without LAN access to 192.168.1.4).
|
||||
const remoteBrowser = process.env.PW_REMOTE_BROWSER !== '0';
|
||||
|
||||
if (!process.env.PW_TEST_CONNECT_WS_ENDPOINT) {
|
||||
if (!process.env.PW_TEST_CONNECT_WS_ENDPOINT && remoteBrowser) {
|
||||
process.env.PW_TEST_CONNECT_WS_ENDPOINT = 'ws://192.168.1.4:3000/';
|
||||
}
|
||||
|
||||
// App under test. Default: the live compose instance behind Traefik, deployed manually
|
||||
// before running the suite (AGENTS.md). When E2E_DEPLOY_CMD is set it runs as a webServer
|
||||
// and the suite waits for baseURL to come up — CI uses this to target an isolated stack
|
||||
// inside dind instead of production. All vars optional; unset = current local behavior.
|
||||
const deployCmd = process.env.E2E_DEPLOY_CMD;
|
||||
const baseUrl = process.env.E2E_BASE_URL ?? 'https://flight.dev.kkhost.pl';
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './e2e',
|
||||
// Serial execution: e2e/state.spec.ts restarts the compose container mid-run,
|
||||
@@ -14,15 +23,10 @@ export default defineConfig({
|
||||
timeout: 300_000,
|
||||
retries: 1,
|
||||
use: {
|
||||
baseURL: process.env.E2E_BASE_URL ?? 'https://flight.dev.kkhost.pl',
|
||||
baseURL: baseUrl,
|
||||
trace: 'on-first-retry',
|
||||
},
|
||||
webServer: remoteRunner
|
||||
? undefined
|
||||
: {
|
||||
command: 'docker compose up -d --build',
|
||||
url: 'https://flight.dev.kkhost.pl',
|
||||
reuseExistingServer: true,
|
||||
timeout: 600_000,
|
||||
},
|
||||
});
|
||||
webServer: deployCmd
|
||||
? { command: deployCmd, url: baseUrl, reuseExistingServer: true, timeout: 600_000 }
|
||||
: undefined,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user