-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
42 lines (38 loc) · 985 Bytes
/
Copy pathplaywright.config.ts
File metadata and controls
42 lines (38 loc) · 985 Bytes
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
import { defineConfig, devices } from "@playwright/test";
const getSmokePort = () => {
const port = Number(process.env.SMOKE_PORT ?? 4323);
if (!Number.isInteger(port) || port < 1 || port > 65_535) {
throw new Error("SMOKE_PORT must be an integer between 1 and 65535.");
}
return port;
};
const smokePort = getSmokePort();
const smokeBaseUrl = `http://127.0.0.1:${smokePort}`;
export default defineConfig({
testDir: "./tests/smoke",
testMatch: "**/*.playwright.ts",
timeout: 30_000,
expect: {
timeout: 5_000,
},
use: {
baseURL: smokeBaseUrl,
trace: "retain-on-failure",
},
webServer: {
command: `bunx wrangler dev --ip 127.0.0.1 --port ${smokePort} --log-level error`,
url: smokeBaseUrl,
reuseExistingServer: false,
timeout: 30_000,
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
name: "mobile-chromium",
use: { ...devices["Pixel 5"] },
},
],
});