e2e: make playwright BASE_URL-driven for remote runs
This commit is contained in:
+22
-7
@@ -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,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user