-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
40 lines (38 loc) · 1.14 KB
/
Copy pathplaywright.config.ts
File metadata and controls
40 lines (38 loc) · 1.14 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
import { defineConfig, devices } from "@playwright/test";
const port = Number(process.env.PLAYWRIGHT_PORT ?? 18777);
const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? `http://127.0.0.1:${port}`;
const browserChannel = process.env.PLAYWRIGHT_CHANNEL === "bundled"
? undefined
: process.env.PLAYWRIGHT_CHANNEL ?? "chrome";
const reuseExistingServer = process.env.PLAYWRIGHT_REUSE_EXISTING_SERVER === "1";
export default defineConfig({
testDir: "./tests/browser",
fullyParallel: true,
timeout: 30_000,
expect: { timeout: 15_000 },
reporter: "list",
use: {
baseURL,
permissions: ["clipboard-read", "clipboard-write"],
screenshot: "only-on-failure",
trace: "retain-on-failure",
video: "off",
},
webServer: process.env.PLAYWRIGHT_BASE_URL
? undefined
: {
command: `npm run dev -w @interactive-os/json-document-site -- --port ${port} --strictPort`,
reuseExistingServer,
timeout: 60_000,
url: baseURL,
},
projects: [
{
name: "chrome",
use: {
...devices["Desktop Chrome"],
...(browserChannel ? { channel: browserChannel } : {}),
},
},
],
});