42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
const CI = !!process.env.CI;
|
|
|
|
export default defineConfig({
|
|
testDir: "./playwright/tests",
|
|
timeout: 300_000,
|
|
expect: { timeout: 15_000 },
|
|
|
|
globalSetup: "./playwright/global-setup",
|
|
fullyParallel: true,
|
|
forbidOnly: CI,
|
|
retries: CI ? 2 : 0,
|
|
workers: CI ? 1 : undefined,
|
|
|
|
reporter: [
|
|
["list"],
|
|
["html", { outputFolder: "playwright/report", open: "never" }],
|
|
],
|
|
outputDir: "playwright/test-results",
|
|
|
|
use: {
|
|
baseURL: process.env.E2E_BASE_URL || "http://localhost:3000",
|
|
headless: true,
|
|
launchOptions: { args: ["--no-sandbox", "--disable-dev-shm-usage"] },
|
|
viewport: { width: 1920, height: 1080 },
|
|
video: CI ? "retain-on-failure" : "on-first-retry",
|
|
screenshot: "only-on-failure",
|
|
trace: "retain-on-failure",
|
|
testIdAttribute: "data-testid",
|
|
},
|
|
|
|
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
|
|
|
|
webServer: {
|
|
command: "npm run build && npm run start -p 3000",
|
|
url: process.env.E2E_BASE_URL || "http://localhost:3000",
|
|
reuseExistingServer: !CI,
|
|
timeout: 120_000,
|
|
},
|
|
});
|