-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
72 lines (64 loc) · 2.38 KB
/
playwright.config.ts
File metadata and controls
72 lines (64 loc) · 2.38 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
66
67
68
69
70
71
72
import path from "path"
import dotenv from "dotenv"
import { defineConfig, devices } from "@playwright/test"
dotenv.config({ path: path.resolve(__dirname, ".env.local") })
export default defineConfig({
testDir: "./tests",
outputDir: "./tests/__results__",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : 3,
reporter: [
["html", { outputFolder: "./tests/__report__", open: "never" }],
["line"],
process.env.CI ? ["github"] : ["list"],
],
use: {
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || "http://localhost:3000",
trace: "on-first-retry",
screenshot: "only-on-failure",
// Global test timeout
actionTimeout: 10000,
navigationTimeout: 30000,
},
// Global test timeout
timeout: 30000,
// Expect timeout
expect: {
timeout: 10000,
},
projects: [
// ─────────────────────────────────────────────────────────────────────────
// E2E tests - Visual regression + functional tests across browsers/devices
// ─────────────────────────────────────────────────────────────────────────
{
name: "e2e",
testDir: "./tests/e2e",
use: { ...devices["Desktop Chrome"] },
},
{
name: "e2e-webkit",
testDir: "./tests/e2e",
use: { ...devices["Desktop Safari"] },
},
{
name: "e2e-mobile-chrome",
testDir: "./tests/e2e",
use: { ...devices["Pixel 5"] },
},
{
name: "e2e-mobile-safari",
testDir: "./tests/e2e",
use: { ...devices["iPhone 12"] },
},
// ─────────────────────────────────────────────────────────────────────────
// Unit tests
// ─────────────────────────────────────────────────────────────────────────
{
name: "unit",
testDir: "./tests/unit",
use: {},
},
],
})