-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.config.js
More file actions
73 lines (63 loc) · 2.04 KB
/
playwright.config.js
File metadata and controls
73 lines (63 loc) · 2.04 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
import { defineConfig } from '@playwright/test';
// Docker relay ports - Using 17xxx range to avoid conflicts with other projects
const RELAY_URLS = {
amb: 'ws://localhost:17001',
calendar: 'ws://localhost:17002',
strfry: 'ws://localhost:17003',
hanging: 'ws://localhost:19738' // Mock relay for timedPool timeout tests
};
// Blossom server for file uploads
const BLOSSOM_SERVER_URL = 'http://localhost:13000';
// Web server port - Using 14173 to avoid conflicts with other projects
const WEB_SERVER_PORT = 14173;
export default defineConfig({
testDir: 'e2e',
testMatch: '**/*.test.js',
globalSetup: './e2e/global-setup.js',
globalTeardown: './e2e/global-teardown.js',
// Run test files in parallel across workers
// Tests within each file still run sequentially (safe for create/modify flows)
// Increased workers for better parallelization: 6 local, 8 CI
workers: process.env.CI ? 8 : 6,
timeout: 60_000,
expect: { timeout: 15_000 },
retries: 1,
reporter: 'html',
use: {
baseURL: `http://localhost:${WEB_SERVER_PORT}`,
screenshot: 'only-on-failure',
trace: 'on-first-retry'
},
projects: [
{
name: 'chromium',
use: {
browserName: 'chromium',
launchOptions: {
executablePath: process.env.CHROMIUM_BIN || 'chromium'
}
}
}
],
webServer: {
command: `pnpm run build && pnpm run preview --port ${WEB_SERVER_PORT}`,
port: WEB_SERVER_PORT,
reuseExistingServer: !process.env.CI,
timeout: 120_000,
env: {
CALENDAR_RELAYS: RELAY_URLS.calendar,
COMMUNIKEY_RELAYS: RELAY_URLS.strfry,
AMB_RELAYS: RELAY_URLS.amb,
LONGFORM_CONTENT_RELAY: RELAY_URLS.strfry,
FALLBACK_RELAYS: RELAY_URLS.strfry,
RELAY_LIST_LOOKUP_RELAYS: RELAY_URLS.strfry,
INDEXER_RELAYS: RELAY_URLS.strfry,
BLOSSOM_SERVER_URL: BLOSSOM_SERVER_URL,
GATED_MODE_DEFAULT: 'true',
GATED_MODE_FORCE: 'true',
ORIGIN: `http://localhost:${WEB_SERVER_PORT}`,
NODE_ENV: 'production',
PORT: String(WEB_SERVER_PORT)
}
}
});