-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
50 lines (48 loc) · 1.17 KB
/
Copy pathplaywright.config.ts
File metadata and controls
50 lines (48 loc) · 1.17 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
import { defineConfig, devices } from '@playwright/test';
const isCI = process.env['CI'] === 'true' || process.env['CI'] === '1';
const workers = isCI ? 4 : 5;
const baseURL =
process.env['PLAYWRIGHT_BASE_URL'] ?? (isCI ? 'http://localhost:4200/timer-5/' : 'http://localhost:4200/');
export default defineConfig({
testDir: './e2e/fixtures',
testMatch: '*.ts',
timeout: 30_000,
expect: {
timeout: 5_000,
toHaveScreenshot: {
animations: 'disabled',
scale: 'device',
},
},
retries: 0,
fullyParallel: true,
workers,
reporter: [['line'], ['html', { open: 'never' }]],
use: {
baseURL,
locale: 'en-US',
testIdAttribute: 'data-e2e',
headless: true,
viewport: { width: 1920, height: 1080 },
video: 'retain-on-failure',
screenshot: 'only-on-failure',
trace: 'retain-on-failure',
},
webServer: isCI
? {
command: 'npm run serve:ci',
url: baseURL,
reuseExistingServer: true,
timeout: 120_000,
}
: undefined,
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
viewport: { width: 1920, height: 1080 },
},
},
],
});