import { defineConfig, devices } from '@playwright/test'; /** * Playwright E2E test configuration for Synor Desktop Wallet * * Tests run against the Vite dev server with mocked Tauri APIs. * This allows testing the complete UI flow without requiring the * full Tauri application to be running. */ export default defineConfig({ testDir: './e2e', // Run tests in parallel fullyParallel: true, // Fail the build on CI if you accidentally left test.only in the source code forbidOnly: !!process.env.CI, // Retry on CI only retries: process.env.CI ? 2 : 0, // Workers for parallel execution workers: process.env.CI ? 1 : undefined, // Reporter configuration reporter: [ ['html', { outputFolder: 'playwright-report' }], ['list'], ], // Shared settings for all projects use: { // Base URL for the dev server baseURL: 'http://localhost:1420', // Collect trace when retrying the failed test trace: 'on-first-retry', // Screenshot on failure screenshot: 'only-on-failure', // Video on failure video: 'on-first-retry', }, // Configure projects for different browsers projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, { name: 'webkit', use: { ...devices['Desktop Safari'] }, }, ], // Run dev server before starting tests webServer: { command: 'pnpm run dev', url: 'http://localhost:1420', reuseExistingServer: !process.env.CI, timeout: 120000, }, });