-
Notifications
You must be signed in to change notification settings - Fork 828
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
65 lines (63 loc) · 1.39 KB
/
Copy pathplaywright.config.ts
File metadata and controls
65 lines (63 loc) · 1.39 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
import { defineConfig, devices } from "@playwright/test";
const PORT = 4321;
const baseURL = process.env.BASE_URL || `http://localhost:${PORT}`;
export default defineConfig({
testDir: "./tests",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: process.env.CI ? [["github"], ["html", { open: "never" }]] : "list",
use: {
baseURL,
trace: "on-first-retry",
screenshot: "only-on-failure",
},
projects: [
{
name: "chromium-desktop",
use: {
...devices["Desktop Chrome"],
viewport: { width: 1440, height: 900 },
},
},
{
name: "mobile-s",
use: {
...devices["Desktop Chrome"],
viewport: { width: 360, height: 720 },
},
},
{
name: "mobile-l",
use: {
...devices["Desktop Chrome"],
viewport: { width: 480, height: 800 },
},
},
{
name: "tablet",
use: {
...devices["Desktop Chrome"],
viewport: { width: 768, height: 1024 },
},
},
{
name: "desktop-2xl",
use: {
...devices["Desktop Chrome"],
viewport: { width: 1536, height: 1000 },
},
},
],
webServer: {
command: "pnpm preview",
url: baseURL,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
expect: {
toHaveScreenshot: {
maxDiffPixelRatio: 0.02,
},
},
});