Repository navigation
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
59 lines (57 loc) · 1.56 KB
/
Copy pathplaywright.config.ts
File metadata and controls
59 lines (57 loc) · 1.56 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
import { defineConfig, devices } from "@playwright/test";
const baseURL = process.env.BASE_URL ?? "http://127.0.0.1:3000";
const isCI = Boolean(process.env.CI);
export default defineConfig({
testDir: "./tests",
testMatch: ["e2e/**/*.spec.ts", "visual/**/*.spec.ts"],
fullyParallel: true,
forbidOnly: isCI,
retries: isCI ? 2 : 0,
workers: isCI ? 2 : undefined,
reporter: isCI
? [["list"], ["html", { outputFolder: "playwright-report", open: "never" }]]
: [["list"], ["html", { outputFolder: "playwright-report", open: "never" }]],
use: {
baseURL,
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: "retain-on-failure",
colorScheme: "light",
navigationTimeout: 30_000,
actionTimeout: 10_000,
},
expect: {
timeout: 10_000,
toHaveScreenshot: {
animations: "disabled",
caret: "hide",
scale: "css",
},
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"], viewport: { width: 1440, height: 1000 } },
},
{
name: "firefox",
use: { ...devices["Desktop Firefox"], viewport: { width: 1440, height: 1000 } },
},
{
name: "webkit",
use: { ...devices["Desktop Safari"], viewport: { width: 1440, height: 1000 } },
},
{
name: "mobile-chromium",
use: { ...devices["Pixel 5"] },
},
],
webServer: process.env.BASE_URL
? undefined
: {
command: "npm run dev -- --hostname 127.0.0.1 --port 3000",
url: baseURL,
reuseExistingServer: !isCI,
timeout: 120_000,
},
});