e2e: make playwright BASE_URL-driven for remote runs

This commit is contained in:
2026-04-25 02:28:11 +03:00
parent eda3352f90
commit 92641e1037
+22 -7
View File
@@ -1,16 +1,31 @@
import { defineConfig } from "@playwright/test";
const baseURL = process.env.BASE_URL ?? "http://localhost:8080";
const startLocalServer = !process.env.BASE_URL;
export default defineConfig({
testDir: "tests/e2e",
timeout: 30000,
use: {
baseURL: "http://localhost:8080",
baseURL,
headless: true,
httpCredentials:
process.env.BASIC_AUTH_USER && process.env.BASIC_AUTH_PASS
? {
username: process.env.BASIC_AUTH_USER,
password: process.env.BASIC_AUTH_PASS,
}
: undefined,
},
webServer: {
command: "pnpm dev",
url: "http://localhost:8080",
reuseExistingServer: true,
timeout: 30000,
},
reporter: [["html", { open: "never" }], ["list"]],
...(startLocalServer
? {
webServer: {
command: "pnpm dev",
url: "http://localhost:8080",
reuseExistingServer: true,
timeout: 30000,
},
}
: {}),
});