test: systemTest.ts

This commit is contained in:
ISA
2025-08-29 11:57:25 +02:00
parent 05c1c9c0cf
commit 6df31455a9
9 changed files with 131 additions and 39 deletions

View File

@@ -4,62 +4,38 @@ const CI = !!process.env.CI;
export default defineConfig({
testDir: "./playwright/tests",
// Globale Zeitlimits
timeout: 90_000,
expect: { timeout: 15_000 }, // etwas großzügiger im CI
expect: { timeout: 15_000 },
// Setup/Parallelisierung
globalSetup: "./playwright/global-setup",
fullyParallel: true,
forbidOnly: CI,
retries: CI ? 2 : 0,
workers: CI ? 1 : undefined,
// Reporter & Ausgabepfade
reporter: [
["list"],
["html", { outputFolder: "playwright/report", open: "never" }],
],
outputDir: "playwright/test-results",
// Standard-Defaults für alle Tests/Projekte
use: {
// Base-URL: im CI per ENV steuerbar
baseURL: process.env.E2E_BASE_URL || "http://localhost:3000",
// Headless im CI (und wenn PW_HEADLESS=1); lokal darfst du headed verwenden
headless: process.env.PW_HEADLESS === "1" || CI,
// Container-robuste Flags
launchOptions: {
args: ["--no-sandbox", "--disable-dev-shm-usage"],
},
headless: process.env.PW_HEADLESS === "1" || CI, // <- Headless-Steuerung hier
launchOptions: { args: ["--no-sandbox", "--disable-dev-shm-usage"] },
viewport: { width: 1920, height: 1080 },
// Artefakte sparsam, aber genug fürs Debugging
video: CI ? "retain-on-failure" : "on-first-retry",
screenshot: CI ? "only-on-failure" : "only-on-failure",
screenshot: "only-on-failure",
trace: "retain-on-failure",
// Optional: falls du Test-IDs nutzt
testIdAttribute: "data-testid",
},
// Projekte (nur Chromium)
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
// Webserver: baue & starte Next.js (statt "dev")
webServer: {
command: "npm run build && npm run start -p 3000",
url: process.env.E2E_BASE_URL || "http://localhost:3000",
reuseExistingServer: !CI,
timeout: 120_000, // Zeit für Build+Start
timeout: 120_000,
},
});