import { defineConfig, devices } from "@playwright/test"; const port = Number(process.env.PLAYWRIGHT_PORT || 4173); const baseURL = `http://127.0.0.1:${port}`; const databaseUrl = process.env.PLAYWRIGHT_DATABASE_URL || `file:./data/playwright-${process.pid}-${Date.now()}.sqlite`; export default defineConfig({ testDir: "tests/e2e", fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, reporter: process.env.CI ? [["github"], ["list"]] : "list", use: { baseURL, trace: "retain-on-failure", screenshot: "only-on-failure", }, webServer: { command: `bun run build && DATABASE_URL=${databaseUrl} HOST=127.0.0.1 PORT=${port} bun build/index.js`, url: baseURL, reuseExistingServer: false, timeout: 120_000, }, projects: [ { name: "chromium-desktop", use: { ...devices["Desktop Chrome"], viewport: { width: 1440, height: 1000 }, }, }, { name: "chromium-mobile", use: { ...devices["Pixel 7"], }, }, ], });