-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathplaywright.ui.config.js
More file actions
45 lines (42 loc) · 1.51 KB
/
Copy pathplaywright.ui.config.js
File metadata and controls
45 lines (42 loc) · 1.51 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
const { defineConfig, devices } = require("@playwright/test");
if (process.env.E2E_BACKEND_PORT === undefined || process.env.E2E_BACKEND_PORT === "") {
process.env.E2E_BACKEND_PORT = "18079";
}
const HOST = process.env.E2E_VITE_HOST || "127.0.0.1";
const PORT = parseInt(process.env.E2E_VITE_PORT || "5173", 10);
const LH_DEBUG_PORT = parseInt(process.env.LH_DEBUG_PORT || "9222", 10);
const useProd = process.env.MESHCHAT_UI_PROD === "1";
const baseURL = useProd ? `http://127.0.0.1:${process.env.E2E_BACKEND_PORT}` : `http://${HOST}:${PORT}`;
module.exports = defineConfig({
testDir: "./tests/ui",
testIgnore: /lighthouse\.spec\.js$/,
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: 1,
reporter: process.env.CI ? "line" : [["list"], ["html", { open: "never" }]],
timeout: 120000,
use: {
...devices["Desktop Chrome"],
baseURL,
trace: "on-first-retry",
screenshot: "only-on-failure",
launchOptions: {
args: [`--remote-debugging-port=${LH_DEBUG_PORT}`],
},
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
webServer: {
command: "bash scripts/ui/start-ui-stack.sh",
url: useProd ? `http://127.0.0.1:${process.env.E2E_BACKEND_PORT}/api/v1/status` : `${baseURL}/`,
reuseExistingServer: !process.env.CI,
timeout: 360000,
stdout: "pipe",
stderr: "pipe",
},
});