import process from 'node:process' import { fileURLToPath } from 'node:url' import { defineConfig, devices } from '@playwright/test' import type { ConfigOptions } from '@nuxt/test-utils/playwright' const baseURL = 'http://localhost:5678' export default defineConfig({ testDir: './test/e2e', fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, reporter: 'html', timeout: 120_000, webServer: { command: 'pnpm start:playwright:webserver', url: baseURL, reuseExistingServer: false, timeout: 60_000, }, // Start/stop mock connector server before/after all tests (teardown via returned closure) globalSetup: fileURLToPath(new URL('./test/e2e/global-setup.ts', import.meta.url)), // We currently only test on one browser on one platform snapshotPathTemplate: '{snapshotDir}/{testFileDir}/{testFileName}-snapshots/{arg}{ext}', use: { baseURL, trace: 'on-first-retry', nuxt: { rootDir: fileURLToPath(new URL('.', import.meta.url)), host: baseURL, }, }, projects: [ { name: 'chromium-headless-shell', use: { ...devices['Desktop Chrome'] }, }, ], })