-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
75 lines (64 loc) · 2.38 KB
/
playwright.config.ts
File metadata and controls
75 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
73
74
75
import { defineConfig, devices } from "@playwright/test";
import { tmpdir } from "node:os";
import { join } from "node:path";
const PORT = process.env.TEST_PORT ? parseInt(process.env.TEST_PORT) : 4444;
const BASE_URL = `http://127.0.0.1:${PORT}`;
const PLAYWRIGHT_RUNTIME_DIR =
process.env.PLAYWRIGHT_RUNTIME_DIR ?? join(tmpdir(), "otc-agent-playwright");
const PLAYWRIGHT_REPORT_DIR = join(PLAYWRIGHT_RUNTIME_DIR, "playwright-report");
const PLAYWRIGHT_RESULTS_DIR = join(PLAYWRIGHT_RUNTIME_DIR, "test-results");
// Page route warm-up is needed for browser E2E stability, but unit/integration
// harnesses now disable it to keep their API-only bootstrap lighter.
process.env.E2E_WARM_APP_ROUTES ??= "true";
process.env.E2E_NEXT_MODE ??= "production";
process.env.E2E_EAGER_SOLANA ??= "true";
process.env.SOLANA_RPC_URL ??= "http://127.0.0.1:38999";
process.env.SOLANA_WS_URL ??= "ws://127.0.0.1:39000";
process.env.NEXT_PUBLIC_SOLANA_RPC_URL ??= process.env.SOLANA_RPC_URL;
process.env.NEXT_PUBLIC_SOLANA_WS_URL ??= process.env.SOLANA_WS_URL;
process.env.SOLANA_FAUCET_PORT ??= "39900";
/**
* Playwright configuration for E2E tests
*
* Uses headless wallet injection (headless-web3-provider + Phantom mock)
* instead of Synpress browser extensions. Fully headless and CI-friendly.
*
* Test dir: tests/e2e/
*
* Run all: bunx playwright test
* Run login: bunx playwright test tests/e2e/login.spec.ts
* Run UI: bunx playwright test tests/e2e/ui-coverage.spec.ts
* Run EVM: bunx playwright test tests/e2e/evm-flow.spec.ts
* Run Solana: bunx playwright test tests/e2e/solana-flow.spec.ts
*/
export default defineConfig({
testDir: "./tests/e2e",
testMatch: /.*\.spec\.ts$/,
// Bring up real infrastructure (teardown is handled by global-setup's return fn)
globalSetup: "./tests/global-setup.ts",
fullyParallel: false,
workers: 1,
timeout: 180_000,
expect: {
timeout: 15_000,
},
forbidOnly: !!process.env.CI,
retries: 0,
reporter: process.env.CI
? [["html", { open: "never", outputFolder: PLAYWRIGHT_REPORT_DIR }], ["github"]]
: [["html", { open: "never", outputFolder: PLAYWRIGHT_REPORT_DIR }], ["list"]],
outputDir: PLAYWRIGHT_RESULTS_DIR,
use: {
baseURL: BASE_URL,
trace: "on-first-retry",
screenshot: "only-on-failure",
actionTimeout: 30_000,
navigationTimeout: 60_000,
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
});