45 lines
1.2 KiB
TypeScript
45 lines
1.2 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: "http://localhost:3000",
|
|
headless: true,
|
|
launchOptions: { args: ["--no-sandbox", "--disable-dev-shm-usage"] },
|
|
viewport: { width: 1920, height: 1080 },
|
|
video: "on",
|
|
screenshot: "on",
|
|
trace: "on",
|
|
testIdAttribute: "data-testid",
|
|
},
|
|
|
|
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
|
|
// In CI starten wir den statischen Simulator selbst (siehe .woodpecker.yml),
|
|
// daher kein automatischer dev-Webserver hier.
|
|
webServer: CI
|
|
? undefined
|
|
: {
|
|
command: "npm run dev -- -p 3000", // wichtig: "--" damit npm das "-p" an next weiterreicht
|
|
url: "http://localhost:3000",
|
|
reuseExistingServer: true,
|
|
timeout: 120_000,
|
|
},
|
|
});
|