import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ testDir: './tests', fullyParallel: true, reporter: 'html', use: { // Pokud v terminálu nastavíš BASE_URL, použije ho. Jinak použije localhost. baseURL: process.env.BASE_URL || 'http://localhost:8080', trace: 'on-first-retry', }, webServer: { // WebServer se spustí pouze tehdy, pokud NENÍ nastavena jiná BASE_URL // (nechceme spouštět lokální server, když testujeme produkci) command: process.env.BASE_URL ? undefined : 'npx http-server ../../ -p 8080', url: process.env.BASE_URL || 'http://localhost:8080', reuseExistingServer: !process.env.CI, }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, ], });