-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
39 lines (33 loc) · 1.04 KB
/
playwright.config.ts
File metadata and controls
39 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { defineConfig, devices } from '@playwright/test';
const baseURL = 'http://localhost:3000';
const isLocalEnvironment = baseURL.includes('localhost');
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: 5, // Enable retries for flaky tests (rate limiting, timing issues)
workers: process.env.CI ? 1 : 5, // Limit workers to reduce backend load and rate limiting
reporter: 'html',
// Global setup and teardown: starts/stops mock API server on port 8080
globalSetup: require.resolve('./e2e/global-setup.ts'),
globalTeardown: require.resolve('./e2e/global-teardown.ts'),
use: {
baseURL,
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
// Only start local dev server when testing against localhost
...(isLocalEnvironment && {
webServer: {
command: 'pnpm run dev',
url: baseURL,
reuseExistingServer: !process.env.CI,
timeout: 120000,
},
}),
});