-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
55 lines (53 loc) · 1.54 KB
/
Copy pathplaywright.config.ts
File metadata and controls
55 lines (53 loc) · 1.54 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
import { defineConfig, devices } from "@playwright/test";
/**
* Playwright web/mock E2E harness (issue #1609).
*
* Runs the Vite/React frontend in a plain browser with Tauri IPC and event
* mocks (see `src/main.e2e.tsx`, enabled via `vite --mode e2e`). Captures PNG
* evidence screenshots under `test-results/captures/`.
*
* A dedicated port (1521) is used so a regular `npm run dev` server
* (1520, without mocks) is never reused by accident.
*/
const E2E_PORT = 1521;
export default defineConfig({
testDir: "./e2e",
testIgnore: ["**/perf/**"],
outputDir: "./test-results/output",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
reporter: process.env.CI
? [
["list"],
["html", { outputFolder: "test-results/report", open: "never" }],
]
: [["list"]],
use: {
baseURL: `http://localhost:${E2E_PORT}`,
colorScheme: "dark",
locale: "en-US",
timezoneId: "UTC",
contextOptions: { reducedMotion: "reduce" },
screenshot: "only-on-failure",
trace: "on-first-retry",
},
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
// Locked viewport + scale factor for deterministic captures.
viewport: { width: 1280, height: 800 },
deviceScaleFactor: 1,
},
},
],
webServer: {
command: `vite dev --mode e2e --port ${E2E_PORT} --strictPort`,
url: `http://localhost:${E2E_PORT}`,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
env: { VITE_E2E_MOCK: "true" },
},
});