-
Notifications
You must be signed in to change notification settings - Fork 31
/
playwright.config.ts
100 lines (96 loc) · 2.23 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import type { PlaywrightTestConfig } from "@playwright/test";
import { devices } from "@playwright/test";
const config: PlaywrightTestConfig = {
testDir: "./tests/e2e",
outputDir: "./tests/artifacts",
timeout: 30_000,
expect: {
timeout: 8000,
},
fullyParallel: true,
workers: process.env.CI ? 1 : undefined,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: "list",
globalSetup: "./tests/support/globalSetup",
use: {
colorScheme: "dark",
actionTimeout: 5000,
baseURL: "http://localhost:3001",
trace: "retain-on-failure",
},
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
},
},
{
name: "firefox",
use: {
...devices["Desktop Firefox"],
},
},
{
name: "webkit",
use: {
...devices["Desktop Safari"],
},
},
{
name: "visual-desktop",
timeout: 60_000,
expect: {
timeout: 30_000,
toHaveScreenshot: {
threshold: 0.01,
scale: "device",
animations: "disabled",
},
},
testDir: "./tests/visual/desktop",
snapshotDir: "./tests/visual/snapshots/desktop",
retries: 0,
use: {
...devices["Desktop Chrome HiDPI"],
actionTimeout: 0,
trace: "off",
},
},
{
name: "visual-mobile",
timeout: 60_000,
expect: {
timeout: 30_000,
toHaveScreenshot: {
threshold: 0.01,
scale: "device",
animations: "disabled",
},
},
testDir: "./tests/visual/mobile",
snapshotDir: "./tests/visual/snapshots/mobile",
retries: 0,
use: {
...devices["iPhone 13 Mini"],
actionTimeout: 0,
trace: "off",
},
},
],
webServer: [
{
command: "npm run start -- --strictPort --port 3001",
port: 3001,
},
// Required by test tests/e2e/repo/commits.spec.ts "loading more commits, adds them to the commits list"
{
command: "npm run start -- --strictPort --port 3002",
port: 3002,
// eslint-disable-next-line @typescript-eslint/naming-convention
env: { COMMITS_PER_PAGE: "4" },
},
],
};
export default config;