-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
39 lines (37 loc) · 890 Bytes
/
playwright.config.ts
File metadata and controls
39 lines (37 loc) · 890 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
32
33
34
35
36
37
38
39
import { defineConfig, devices } from '@playwright/test';
const DEV = (process.env.NODE_ENV ?? 'production') === 'development';
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './src/e2e',
snapshotDir: `./${DEV ? 'tmp' : 'src'}/e2e/snapshots`,
testMatch: ['**/*.e2e.ts', '**/*.spec.ts'],
fullyParallel: true,
forbidOnly: !!process.env.CI,
workers: process.env.CI ? 1 : undefined,
expect: {
toHaveScreenshot: {
animations: 'disabled',
caret: 'hide'
}
},
webServer: {
command: 'npm run prepare && npm run dev',
url: 'http://localhost:5173',
reuseExistingServer: DEV,
timeout: 120 * 1000
},
use: {
testIdAttribute: 'data-tid',
baseURL: 'http://localhost:5173',
trace: 'on',
...(DEV && { headless: false })
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] }
}
]
});