-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.mjs
More file actions
39 lines (37 loc) · 1.15 KB
/
playwright.config.mjs
File metadata and controls
39 lines (37 loc) · 1.15 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
import { defineConfig } from "@playwright/test";
const isCI = Boolean(process.env.CI);
const defaultPort = process.env.PLAYWRIGHT_PORT || "3100";
const baseURL =
process.env.PLAYWRIGHT_BASE_URL || `http://127.0.0.1:${defaultPort}`;
const baseUrl = new URL(baseURL);
const webServerHost = baseUrl.hostname;
const webServerPort =
baseUrl.port || (baseUrl.protocol === "https:" ? "443" : "80");
const webServerUrl = process.env.PLAYWRIGHT_WEB_SERVER_URL || baseURL;
const webServer =
process.env.PLAYWRIGHT_NO_SERVER === "1"
? undefined
: {
command: `npm run dev -- --hostname ${webServerHost} --port ${webServerPort}`,
url: webServerUrl,
reuseExistingServer: process.env.PLAYWRIGHT_REUSE_SERVER === "1" && !isCI,
timeout: 240_000,
stdout: "inherit",
stderr: "inherit",
env: {
NEXT_TELEMETRY_DISABLED: "1",
},
};
export default defineConfig({
testDir: "./tests",
testMatch: ["smoke.spec.mjs", "e2e/**/*.spec.mjs"],
timeout: 60_000,
retries: 0,
reporter: isCI ? "line" : "list",
use: {
baseURL,
headless: true,
trace: "retain-on-failure",
},
webServer,
});