-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
64 lines (62 loc) · 1.19 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
import { defineConfig, devices } from "@playwright/test";
const prodUrl = "https://shiny-poems.vercel.app";
const localUrl = "http://localhost:3000";
export default defineConfig({
reporter: "html",
timeout: 30 * 1000,
retries: 1,
fullyParallel: true,
expect: {
timeout: 10 * 1000,
toHaveScreenshot: {
threshold: 0.2,
maxDiffPixelRatio: 0.015
}
},
use: {
baseURL: process.env.PROD ? prodUrl : localUrl,
trace: "retain-on-failure"
},
webServer: process.env.PROD
? undefined
: {
command: "pnpm build && pnpm start",
port: 3000,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI
},
projects: [
{
name: "chrome",
use: {
...devices["Desktop Chrome"]
}
},
{
name: "firefox",
use: {
...devices["Desktop Firefox"]
}
},
{
name: "safari",
use: {
...devices["Desktop Safari"]
}
},
{
name: "android",
grepInvert: /@desktop/,
use: {
...devices["Pixel 5"]
}
},
{
name: "iphone",
grepInvert: /@desktop/,
use: {
...devices["iPhone 13"]
}
}
]
});