-
Notifications
You must be signed in to change notification settings - Fork 292
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
57 lines (50 loc) · 1.73 KB
/
Copy pathplaywright.config.ts
File metadata and controls
57 lines (50 loc) · 1.73 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
import { defineConfig, devices } from "@playwright/test";
/**
* End-to-end suite that drives the real web app against a REAL Meshtastic device
* (a simulated `meshtasticd` node by default, or physical hardware) over the
* HTTP(S) phone API, and exercises text messaging across a two-node mesh.
*
* Topology is brought up in e2e/global-setup.ts. The off-browser "mesh peer"
* (e2e/peer/peer.py) drives/asserts the second node. See e2e/README.md.
*/
const WEB_PORT = Number(process.env.E2E_WEB_PORT ?? 3100);
export default defineConfig({
testDir: "./e2e/tests",
outputDir: "./e2e/.results",
globalSetup: "./e2e/global-setup.ts",
globalTeardown: "./e2e/global-teardown.ts",
// Tests share a single two-node mesh + one device identity, so run serially.
fullyParallel: false,
workers: 1,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
timeout: 90_000,
expect: { timeout: 15_000 },
reporter: [["list"], ["html", { outputFolder: "e2e/.report", open: "never" }]],
use: {
baseURL: `http://localhost:${WEB_PORT}`,
// The device webserver uses a self-signed cert (TLS-only on 9443).
ignoreHTTPSErrors: true,
trace: "on-first-retry",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
// Belt-and-suspenders for the device's self-signed cert.
launchOptions: { args: ["--ignore-certificate-errors"] },
},
},
],
webServer: {
command: `pnpm --filter ./apps/web exec vite --port ${WEB_PORT} --strictPort`,
url: `http://localhost:${WEB_PORT}`,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
stdout: "ignore",
stderr: "pipe",
},
});