-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplaywright.proxy.config.js
More file actions
43 lines (38 loc) · 1.28 KB
/
playwright.proxy.config.js
File metadata and controls
43 lines (38 loc) · 1.28 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
require('dotenv').config();
const { defineConfig } = require('@playwright/test');
// This config validates the app works when served via the **client dev server**
// (e.g. http://localhost:2080/2081/2082...), where `/api/*` must be proxied to
// the backend. This catches regressions where the UI hard-codes backend ports.
const DEFAULT_BACKEND_PORT = 4001;
const DEFAULT_CLIENT_PORT = 4100;
const BACKEND_PORT = Number.parseInt(process.env.ORCHESTRATOR_TEST_PORT || '', 10) || DEFAULT_BACKEND_PORT;
const CLIENT_PORT = Number.parseInt(process.env.CLIENT_TEST_PORT || '', 10) || DEFAULT_CLIENT_PORT;
module.exports = defineConfig({
testDir: './tests/e2e',
timeout: 30000,
retries: 1,
use: {
baseURL: `http://localhost:${CLIENT_PORT}`,
headless: true,
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{
name: 'chromium',
use: { browserName: 'chromium' },
},
],
webServer: {
command: [
'AUTO_START_DIFF_VIEWER=false',
`ORCHESTRATOR_PORT=${BACKEND_PORT}`,
`CLIENT_PORT=${CLIENT_PORT}`,
'concurrently -k -s first "npm run dev:server" "npm run dev:client"'
].join(' '),
url: `http://localhost:${CLIENT_PORT}`,
timeout: 120000,
reuseExistingServer: false,
},
outputDir: 'test-results',
});