-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
67 lines (54 loc) · 1.56 KB
/
playwright.config.ts
File metadata and controls
67 lines (54 loc) · 1.56 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* Playwright E2E Test Configuration
*
* Configures isolated E2E testing infrastructure for the markdown-ticket application.
* Uses ports 6173 (frontend) and 4001 (backend) to avoid conflicts with dev servers.
*/
import process from 'node:process'
import { defineConfig, devices } from '@playwright/test'
/**
* Read environment variables
*/
const isCI = !!process.env.CI
/**
* See https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
// Test directory
testDir: './tests/e2e',
// Run tests in files in parallel
fullyParallel: false, // Sequential for shared environment
// Fail the build on CI if you accidentally left test.only in source code
forbidOnly: isCI,
// Retry on CI only
retries: isCI ? 2 : 0,
// Workers - use 1 for shared environment isolation
workers: 1,
// Reporter to use
reporter: 'html',
// Shared settings for all projects
use: {
// Base URL for page.goto('/')
baseURL: 'http://localhost:6173',
// Collect trace when retrying the failed test
trace: 'on-first-retry',
// Screenshot on failure
screenshot: 'only-on-failure',
},
// Configure projects for major browsers
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
// Run local dev server before tests
webServer: {
command: 'VITE_BACKEND_URL=http://localhost:4001 npm run dev -- --port 6173 --strictPort',
url: 'http://localhost:6173',
reuseExistingServer: !isCI,
timeout: 120 * 1000, // 2 minutes
stdout: 'pipe',
stderr: 'pipe',
},
})