33 lines
948 B
TypeScript
33 lines
948 B
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
const PORT = parseInt(process.env.PORT || "3000", 10);
|
|
const BASE_URL = process.env.BASE_URL || `http://localhost:${PORT}`;
|
|
|
|
export default defineConfig({
|
|
testDir: "./tests/e2e",
|
|
timeout: 60_000,
|
|
expect: { timeout: 10_000 },
|
|
fullyParallel: false,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: 1,
|
|
reporter: process.env.CI ? "list" : [["list"], ["html", { open: "never" }]],
|
|
use: {
|
|
baseURL: BASE_URL,
|
|
trace: "on-first-retry",
|
|
screenshot: "only-on-failure",
|
|
extraHTTPHeaders: {
|
|
"X-AIMock-Context": "built-in-agent",
|
|
},
|
|
},
|
|
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
|
|
webServer: process.env.SKIP_WEB_SERVER
|
|
? undefined
|
|
: {
|
|
command: `npm run dev -- --port ${PORT}`,
|
|
url: BASE_URL,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 120_000,
|
|
},
|
|
});
|