// @ts-check const { defineConfig, devices } = require('@playwright/test'); /** * Playwright-Konfig für GeoGraSim. * * Standardziel: lokaler XAMPP unter http://localhost/geograsim/App * Über die ENV-Variable GGS_BASE_URL umstellbar (z. B. auf Prod READ-ONLY). * * Stand: 2026-06-11 */ module.exports = defineConfig({ testDir: './tests', fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 1, // Bei Prod-Tests: max 4 Workers, damit wir nicht selbst unsere Domain // rate-limiten. Lokal CI darf 1. Lokal manuell ohne CI: 4. workers: process.env.CI ? 1 : 4, reporter: [ ['list'], ['html', { outputFolder: 'reports/html', open: 'never' }], ['json', { outputFile: 'reports/results.json' }], ], use: { baseURL: process.env.GGS_BASE_URL || 'http://localhost/geograsim/App', trace: 'on-first-retry', screenshot: 'only-on-failure', video: 'retain-on-failure', actionTimeout: 10000, navigationTimeout: 25000, }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, // Bei Bedarf einkommentieren — kostet beim ersten Lauf ~200 MB Download // { // name: 'firefox', // use: { ...devices['Desktop Firefox'] }, // }, // { // name: 'webkit', // use: { ...devices['Desktop Safari'] }, // }, ], outputDir: 'reports/artifacts', });