-
Notifications
You must be signed in to change notification settings - Fork 667
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
31 lines (29 loc) · 889 Bytes
/
Copy pathplaywright.config.ts
File metadata and controls
31 lines (29 loc) · 889 Bytes
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
import { defineConfig } from '@playwright/test';
// Worktrees often run a side-by-side dev server on a non-default port
// (PORT=3001/3002/...) to avoid clashing with the main directory.
// `PLAYWRIGHT_BASE_URL` lets a one-off run target the worktree's port
// without editing this file. Default stays at :3000 so CI / main runs
// are unchanged.
const baseURL = process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:3000';
export default defineConfig({
testDir: './src/__tests__/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
use: {
baseURL,
trace: 'on-first-retry',
},
expect: {
toHaveScreenshot: {
maxDiffPixelRatio: 0.01,
},
},
webServer: {
command: 'npm run dev',
url: baseURL,
reuseExistingServer: !process.env.CI,
},
});