-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathplaywright.config.ts
49 lines (39 loc) · 1.11 KB
/
playwright.config.ts
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
// playwright.config.ts
import { PlaywrightTestConfig, devices } from '@playwright/test';
declare global {
var __DEV__: boolean;
}
// Define __DEV__ globally for the test environment
global.__DEV__ = !process.env.CI;
const width = 1400;
const height = 1200;
const config: PlaywrightTestConfig = {
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 12 : 1,
// Limit the number of failures on CI to save resources
maxFailures: process.env.CI ? 12 : undefined,
timeout: process.env.CI ? 10000 : 5000,
workers: 4,
fullyParallel: true,
reporter: 'list',
use: {
trace: process.env.CI ? 'on-first-retry' : 'retain-on-failure',
// video: 'on-first-retry',
// video: 'retain-on-failure',
headless: true,
viewport: { width, height },
ignoreHTTPSErrors: true,
// launchOptions: {
// slowMo: 500000, // uncomment this and also add headless: false, so you can easily debug
// },
baseURL: 'http://localhost:5555/',
},
projects: [
{
name: 'chromium',
testMatch: /.*.spec.ts/,
use: { ...devices['Desktop Chrome'] },
},
],
};
export default config;