forked from ariakit/ariakit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
74 lines (71 loc) · 1.74 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
import { defineConfig, devices } from "@playwright/test";
if (process.argv.includes("--headed")) {
process.env.PWHEADED = "true";
}
const CI = !!process.env.CI;
const HEADED = process.env.PWHEADED === "true";
export default defineConfig({
fullyParallel: !HEADED,
ignoreSnapshots: HEADED,
workers: HEADED ? 1 : CI ? "100%" : "80%",
forbidOnly: CI,
reportSlowTests: null,
reporter: CI ? [["github"], ["dot"]] : [["list"]],
retries: 1,
webServer: {
command: "npm start",
reuseExistingServer: !CI,
port: 3000,
},
expect: {
toMatchSnapshot: {
maxDiffPixelRatio: 0.05,
},
},
use: {
screenshot: "only-on-failure",
trace: "on-first-retry",
launchOptions: {
slowMo: HEADED ? 150 : undefined,
},
},
projects: [
{
name: "chrome",
testMatch: [/\/test[^\/]*\-chrome/, /\/test[^\/]*\-browser/],
use: devices["Desktop Chrome"],
},
{
name: "firefox",
testMatch: [/\/test[^\/]*\-firefox/, /\/test[^\/]*\-browser/],
retries: CI ? 2 : 1,
use: devices["Desktop Firefox"],
},
{
name: "safari",
testMatch: [/\/test[^\/]*\-safari/, /\/test[^\/]*\-browser/],
use: devices["Desktop Safari"],
},
{
name: "ios",
testMatch: [/\/test[^\/]*\-ios/, /\/test[^\/]*\-mobile/],
use: devices["iPhone 13 Pro Max"],
},
{
name: "android",
testMatch: [/\/test[^\/]*\-android/, /\/test[^\/]*\-mobile/],
use: devices["Pixel 5"],
},
{
name: "vo",
testMatch: [/\/test[^\/]*\-vo/],
retries: CI ? 4 : 0,
timeout: 5 * 60 * 1000, // 5 minutes
use: {
...devices["Desktop Safari"],
headless: false,
launchOptions: { slowMo: 300 },
},
},
],
});