2023-09-22 14:34:16 +02:00
|
|
|
import { defineConfig, devices } from "@playwright/test";
|
2025-10-07 10:54:19 -07:00
|
|
|
import { Logger } from "@waku/utils";
|
|
|
|
|
|
|
|
|
|
const log = new Logger("playwright-config");
|
2023-09-22 14:34:16 +02:00
|
|
|
|
2025-05-29 09:33:05 -07:00
|
|
|
if (!process.env.CI) {
|
2025-10-07 10:54:19 -07:00
|
|
|
try {
|
|
|
|
|
await import("dotenv-flow/config.js");
|
|
|
|
|
} catch (e) {
|
|
|
|
|
log.warn("dotenv-flow not found; skipping env loading");
|
|
|
|
|
}
|
2025-05-29 09:33:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const EXAMPLE_PORT = process.env.EXAMPLE_PORT || "8080";
|
2025-10-07 10:54:19 -07:00
|
|
|
const BASE_URL = `http://127.0.0.1:${EXAMPLE_PORT}`;
|
|
|
|
|
const TEST_IGNORE = process.env.CI ? ["tests/e2e.spec.ts"] : [];
|
2023-09-22 14:34:16 +02:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
testDir: "./tests",
|
2025-10-07 10:54:19 -07:00
|
|
|
testIgnore: TEST_IGNORE,
|
2023-09-22 14:34:16 +02:00
|
|
|
fullyParallel: true,
|
|
|
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
|
retries: process.env.CI ? 2 : 0,
|
|
|
|
|
workers: process.env.CI ? 2 : undefined,
|
|
|
|
|
reporter: "html",
|
|
|
|
|
use: {
|
|
|
|
|
baseURL: BASE_URL,
|
|
|
|
|
|
|
|
|
|
trace: "on-first-retry"
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
projects: [
|
|
|
|
|
{
|
|
|
|
|
name: "chromium",
|
|
|
|
|
use: { ...devices["Desktop Chrome"] }
|
|
|
|
|
}
|
2025-10-07 10:54:19 -07:00
|
|
|
]
|
2023-09-22 14:34:16 +02:00
|
|
|
|
|
|
|
|
});
|