forked from JetBrains/kotlin-web-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
85 lines (81 loc) · 2.21 KB
/
playwright.config.ts
File metadata and controls
85 lines (81 loc) · 2.21 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { defineConfig, devices } from '@playwright/test';
const MAX_DIFF_PIXEL_RATIO = 0.025 as const;
export default defineConfig({
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI ? 'dot' : 'list',
snapshotDir: 'test/snapshots',
expect: {
toMatchSnapshot: { maxDiffPixelRatio: MAX_DIFF_PIXEL_RATIO },
toHaveScreenshot: { maxDiffPixelRatio: MAX_DIFF_PIXEL_RATIO }
},
use: {
baseURL: process.env.BASE_URL || 'http://localhost:9000',
trace: 'off',
screenshot: 'only-on-failure',
video: 'retain-on-failure'
},
projects: getProjects()
});
function getProjects() {
if (process.env.E2E_PROJECTS === 'breakpoints-v2') return [
{
name: 'MS',
use: {
viewport: { width: 414, height: 736 },
deviceScaleFactor: 2,
isMobile: true,
hasTouch: true
}
},
{
name: 'ML',
use: {
viewport: { width: 473, height: 896 },
deviceScaleFactor: 2,
isMobile: true,
hasTouch: true
}
},
{
name: 'TS',
use: {
viewport: { width: 648, height: 864 },
deviceScaleFactor: 2,
isMobile: true,
hasTouch: true
}
},
{
name: 'TL',
use: {
viewport: { width: 810, height: 1080 },
deviceScaleFactor: 2,
isMobile: true,
hasTouch: true
}
},
{
name: 'DS',
use: {
viewport: { width: 1008, height: 1792 },
deviceScaleFactor: 2,
isMobile: false,
hasTouch: false
}
},
{
name: 'DL',
use: {
viewport: { width: 1280, height: 720 },
deviceScaleFactor: 2,
isMobile: false,
hasTouch: false
}
}
];
return [{
name: 'chromium',
use: { ...devices['Desktop Chrome'] }
}];
}