Open History to see the last commit
1import { defineConfig, devices } from '@playwright/test'
2import dotenv from 'dotenv'
3
4// Load environment variables from .env.local
5dotenv.config({ path: '.env.local' })
6
7export default defineConfig({
8 testDir: './tests',
9 // Run tests in parallel by default
10 fullyParallel: true,
11 // Fail the build on CI if you accidentally left test.only in the source code
12 forbidOnly: !!process.env.CI,
13 // Retry on CI only
14 retries: process.env.CI ? 2 : 0,
15 // Use single worker in CI for stability with real API calls
16 workers: process.env.CI ? 1 : undefined,
17 // Reporter configuration
18 reporter: [['html', { open: 'never' }], ['list']],
19 // Extended timeout for real API calls (60 seconds per test)
20 timeout: 60_000,
21 // Expect timeout for assertions
22 expect: {
23 timeout: 30_000,
24 },
25 use: {
26 // Base URL for the testing panel
27 baseURL: 'http://localhost:3010',
28 // Collect trace on first retry
29 trace: 'on-first-retry',
30 // Screenshot on failure
31 screenshot: 'only-on-failure',
32 },
33 projects: [
34 {
35 name: 'chromium',
36 use: { ...devices['Desktop Chrome'] },
37 },
38 ],
39 // Start the dev server before running tests
40 webServer: {
41 command: 'pnpm run dev',
42 url: 'http://localhost:3010',
43 reuseExistingServer: !process.env.CI,
44 timeout: 120_000,
45 },
46})