-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
57 lines (56 loc) · 2.08 KB
/
Copy pathplaywright.config.ts
File metadata and controls
57 lines (56 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';
/**
* E2E for the security-critical flows: approval, sealing, and places — a
* location is the most sensitive thing this app stores, so the seal has to hold
* on every surface a pin can reach.
* Requires the local postgres from `docker compose up -d db`.
*/
export default defineConfig({
testDir: 'e2e',
// Each spec drives two or three full OIDC round trips against a cold vite dev
// server, which compiles routes on first hit. 60s ran out mid-test and the
// failure surfaced as whatever step the clock happened to stop on.
timeout: 180_000,
// The fake IdP's "current user" is global state — no parallel workers.
workers: 1,
use: {
baseURL: 'http://localhost:5174',
// Headless Chromium stops producing animation frames when it considers the
// window backgrounded or occluded — which it often does on a loaded dev
// machine. Playwright's actionability check waits for two stable frames, so
// with rAF stalled every click hangs until the test times out, reported as
// "waiting for element to be visible, enabled and stable".
launchOptions: {
args: [
'--disable-renderer-backgrounding',
'--disable-backgrounding-occluded-windows',
'--disable-features=CalculateNativeWinOcclusion'
]
}
},
webServer: [
{
command: 'bun scripts/dev-oidc.ts',
port: 9443,
reuseExistingServer: true
},
{
command: 'bun run dev -- --port 5174 --strictPort',
port: 5174,
reuseExistingServer: false,
env: {
// Explicitly off: bun loads .env, where dev sets DEV_MODE=true. That
// auto-logs-in a single fixed user, so every identity the fake IdP
// switches to became the same person and the multi-user flows these
// tests exist to cover silently collapsed.
DEV_MODE: 'false',
DATABASE_URL: 'postgres://root:mysecretpassword@localhost:5432/local',
POCKET_ID_ISSUER: 'http://localhost:9443',
POCKET_ID_CLIENT_ID: 'budget-e2e',
POCKET_ID_CLIENT_SECRET: 'e2e-secret',
OIDC_REDIRECT_URI: 'http://localhost:5174/auth/callback',
PUBLIC_ORIGIN: 'http://localhost:5174'
}
}
]
});