Repository navigation
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
57 lines (55 loc) · 2.08 KB
/
Copy pathplaywright.config.ts
File metadata and controls
57 lines (55 loc) · 2.08 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 } from "@playwright/test";
/**
* Phase 3.2 browser E2E. Runs against a local anvil fork of Sepolia (real deployed
* Opaque contracts, free test ETH, deterministic) and the vite dev server. Solana
* stays on devnet for read-only scanning; no Solana writes happen in the suite.
*
* FORK_URL=https://… npx playwright test
*/
const FORK_URL = process.env.FORK_URL ?? "https://ethereum-sepolia-rpc.publicnode.com";
const ANVIL_PORT = 8545;
const APP_PORT = 4173;
export default defineConfig({
testDir: "./e2e",
timeout: 240_000,
expect: { timeout: 45_000 },
retries: process.env.CI ? 1 : 0,
workers: 1, // one anvil, one session: serial
reporter: process.env.CI ? [["github"], ["list"]] : [["list"]],
use: {
baseURL: `http://127.0.0.1:${APP_PORT}`,
trace: "retain-on-failure",
launchOptions: {
// Long single-session run: without these, Chromium suspends timers/network in
// the occluded headless page (ERR_NETWORK_IO_SUSPENDED) and scans stall.
args: [
"--disable-background-timer-throttling",
"--disable-backgrounding-occluded-windows",
"--disable-renderer-backgrounding",
],
},
},
webServer: [
{
command: `anvil --fork-url ${FORK_URL} --chain-id 11155111 --port ${ANVIL_PORT}`,
port: ANVIL_PORT,
reuseExistingServer: false, // fresh fork every run: no registry/announcer state bleed
timeout: 120_000,
},
{
// Production build + preview: the dev server's on-demand dependency
// re-optimization force-reloads the page mid-session (the WASM glue is a
// lazily discovered dep), which wipes the in-memory client state.
command: `npm run build && npm run preview -- --host 127.0.0.1 --port ${APP_PORT} --strictPort`,
port: APP_PORT,
reuseExistingServer: false,
timeout: 180_000,
env: {
VITE_SEPOLIA_RPC_URL: `http://127.0.0.1:${ANVIL_PORT}`,
VITE_SOLANA_CLUSTER: "devnet",
// Keep inbox getLogs inside the local fork range (post-fork blocks only).
VITE_EVM_SCAN_WINDOW: "30",
},
},
],
});