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"] } }], webServer: { command: "npm run dev -- -p 3000", // wichtig: "--" damit npm das "-p" an next weiterreicht url: "http://localhost:3000", reuseExistingServer: true, timeout: 120_000, }, });