import { defineConfig, devices } from "@playwright/test"; const apiPort = process.env.E2E_API_PORT ?? "3101"; const clientPort = process.env.E2E_CLIENT_PORT ?? "5174"; export default defineConfig({ testDir: "./tests", fullyParallel: false, workers: 1, retries: 0, reporter: "list", use: { baseURL: `http://127.0.0.1:${clientPort}`, trace: "retain-on-failure", }, webServer: { command: "npm run dev", url: `http://127.0.0.1:${apiPort}/api/health`, reuseExistingServer: false, timeout: 120_000, env: { MOCK_DISCOVERY: "true", MOCK_WEATHER: "true", DATABASE_PATH: "./data/e2e-canon-v1.db", HOST: "127.0.0.1", PORT: apiPort, VITE_API_PORT: apiPort, VITE_PORT: clientPort, }, }, projects: [ { name: "desktop-chromium", use: { ...devices["Desktop Chrome"], viewport: { width: 1440, height: 900 }, }, }, { name: "tablet-chromium", use: { ...devices["Desktop Chrome"], viewport: { width: 768, height: 1024 }, }, }, { name: "mobile-chromium", use: { ...devices["Pixel 7"], viewport: { width: 390, height: 844 }, deviceScaleFactor: 1, }, }, { name: "ultrawide-chromium", use: { ...devices["Desktop Chrome"], viewport: { width: 3440, height: 1440 }, }, }, { name: "fullhd-chromium", use: { ...devices["Desktop Chrome"], viewport: { width: 1920, height: 1080 }, }, }, ], });