-
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathplaywright.config.js
More file actions
55 lines (53 loc) · 1.83 KB
/
Copy pathplaywright.config.js
File metadata and controls
55 lines (53 loc) · 1.83 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
// @ts-check
const { defineConfig } = require('@playwright/test');
const playwrightPort = Number(process.env.ENGRAPHIS_PLAYWRIGHT_PORT || 8700);
if (!Number.isInteger(playwrightPort) || playwrightPort < 1024 || playwrightPort > 65535) {
throw new Error('ENGRAPHIS_PLAYWRIGHT_PORT must be an integer from 1024 to 65535');
}
const playwrightBaseURL = `http://127.0.0.1:${playwrightPort}`;
module.exports = defineConfig({
testDir: './tests/e2e',
timeout: 60_000,
retries: 0,
use: {
baseURL: playwrightBaseURL,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
},
webServer: {
// Run the checked-out source, not a possibly stale globally installed console script.
command: `python -m scripts.start_dashboard --no-open --port ${playwrightPort}`,
url: `${playwrightBaseURL}/api/health`,
timeout: 120_000,
reuseExistingServer: false,
env: {
// Never migrate or mutate the developer's configured database during browser tests.
// The single Playwright web server owns this process-local database for the run.
ENGRAPHIS_DB_PATH: ':memory:',
ENGRAPHIS_EMBED_MODEL: '',
ENGRAPHIS_EXTRACTOR: 'none',
ENGRAPHIS_LOOP_INTERVAL: '0',
ENGRAPHIS_HOST: '127.0.0.1',
// Public test fixture, never the owner's configured credential. The real
// browser smoke uses this to exercise governed source approval.
ENGRAPHIS_API_TOKEN: 'engraphis-playwright-local-only',
ENGRAPHIS_SERVICE_MODE: 'customer',
},
},
projects: [
{
name: 'chromium',
use: { browserName: 'chromium' },
},
{
name: 'firefox-smoke',
testMatch: '**/workspace-smoke.spec.js',
use: { browserName: 'firefox' },
},
{
name: 'webkit-smoke',
testMatch: '**/workspace-smoke.spec.js',
use: { browserName: 'webkit' },
},
],
});