Repository navigation
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
86 lines (85 loc) · 3.22 KB
/
Copy pathplaywright.config.ts
File metadata and controls
86 lines (85 loc) · 3.22 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: process.env.CI
? [["github"], ["html", { outputFolder: "playwright-report", open: "never" }]]
: [["html"]],
use: {
baseURL: "http://localhost:3000",
trace: "on-first-retry",
},
// ── Visual regression — Issue #664 ──────────────────────────────────────────
// Baseline screenshots are stored in e2e/screenshots/.
// The {projectName} token keeps baselines separate per browser/viewport so
// a chromium-desktop baseline does not conflict with mobile-chrome.
snapshotDir: "./e2e/screenshots",
snapshotPathTemplate: "{snapshotDir}/{testFilePath}/{projectName}/{arg}{ext}",
// ────────────────────────────────────────────────────────────────────────────
projects: [
// ── Desktop ──────────────────────────────────────────────────────────────
{
name: "chromium-desktop",
use: { ...devices["Desktop Chrome"] },
// Only run visual regression tests in this project by default; other
// specs use msedge locally and chromium in CI.
},
// Local-only: Edge (skip in CI where it is unavailable on ubuntu)
...(!process.env.CI
? [
{
name: "msedge",
use: { ...devices["Desktop Edge"], channel: "msedge" },
},
]
: []),
// ── Mobile ───────────────────────────────────────────────────────────────
{
name: "mobile-chrome",
use: { ...devices["Pixel 5"] },
},
{
name: "mobile-safari",
use: { ...devices["iPhone 13"] },
},
{
name: "iphone",
use: { ...devices["iPhone 13"] },
},
{
name: "pixel",
use: { ...devices["Pixel 5"] },
},
// Dark-mode / CSS-compat project (runs on Chromium emulation)
{
name: "chromium-dark",
use: { ...devices["Desktop Chrome"], colorScheme: "dark", reducedMotion: "reduce" },
},
// Optional wallet-extension project: only enabled when WALLET_EXTENSION_PATH is set
...(process.env.WALLET_EXTENSION_PATH
? [
{
name: "chromium-wallet",
use: {
...devices["Desktop Chrome"],
launchOptions: {
args: [
`--disable-extensions-except=${process.env.WALLET_EXTENSION_PATH}`,
`--load-extension=${process.env.WALLET_EXTENSION_PATH}`,
],
},
},
},
]
: []),
],
webServer: {
command: "pnpm dev",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
});