70 lines
1.4 KiB
TypeScript
70 lines
1.4 KiB
TypeScript
|
|
import { defineConfig, devices } from '@playwright/test';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Playwright E2E Test Configuration
|
||
|
|
*
|
||
|
|
* Run with: npm run test:e2e
|
||
|
|
* UI mode: npm run test:e2e:ui
|
||
|
|
*/
|
||
|
|
export default defineConfig({
|
||
|
|
testDir: './tests/e2e',
|
||
|
|
|
||
|
|
// Run tests in parallel
|
||
|
|
fullyParallel: true,
|
||
|
|
|
||
|
|
// Fail CI if test.only is left in code
|
||
|
|
forbidOnly: !!process.env.CI,
|
||
|
|
|
||
|
|
// Retry on CI only
|
||
|
|
retries: process.env.CI ? 2 : 0,
|
||
|
|
|
||
|
|
// Parallel workers
|
||
|
|
workers: process.env.CI ? 1 : undefined,
|
||
|
|
|
||
|
|
// Reporter configuration
|
||
|
|
reporter: [
|
||
|
|
['html', { outputFolder: 'playwright-report' }],
|
||
|
|
['list'],
|
||
|
|
],
|
||
|
|
|
||
|
|
// Global settings
|
||
|
|
use: {
|
||
|
|
// Base URL for navigation
|
||
|
|
baseURL: 'http://localhost:3003',
|
||
|
|
|
||
|
|
// Collect trace on first retry
|
||
|
|
trace: 'on-first-retry',
|
||
|
|
|
||
|
|
// Screenshot on failure
|
||
|
|
screenshot: 'only-on-failure',
|
||
|
|
|
||
|
|
// Video on failure
|
||
|
|
video: 'on-first-retry',
|
||
|
|
},
|
||
|
|
|
||
|
|
// Browser projects
|
||
|
|
projects: [
|
||
|
|
{
|
||
|
|
name: 'chromium',
|
||
|
|
use: { ...devices['Desktop Chrome'] },
|
||
|
|
},
|
||
|
|
// Uncomment to test on more browsers
|
||
|
|
// {
|
||
|
|
// name: 'firefox',
|
||
|
|
// use: { ...devices['Desktop Firefox'] },
|
||
|
|
// },
|
||
|
|
// {
|
||
|
|
// name: 'webkit',
|
||
|
|
// use: { ...devices['Desktop Safari'] },
|
||
|
|
// },
|
||
|
|
],
|
||
|
|
|
||
|
|
// Start dev server before tests
|
||
|
|
webServer: {
|
||
|
|
command: 'npm run dev',
|
||
|
|
url: 'http://localhost:3003',
|
||
|
|
reuseExistingServer: !process.env.CI,
|
||
|
|
timeout: 120000,
|
||
|
|
},
|
||
|
|
});
|