-
Notifications
You must be signed in to change notification settings - Fork 816
/
playwright.config.ts
35 lines (33 loc) · 946 Bytes
/
playwright.config.ts
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
import { type PlaywrightTestConfig, devices } from "@playwright/test";
const overrideUrl = "";
const { CI, PORT = 3000 } = process.env;
const {
"Desktop Chrome": chrome,
"Desktop Firefox": firefox,
"Desktop Safari": safari,
} = devices;
const baseURL = overrideUrl || `http://localhost:${PORT}`;
const config: PlaywrightTestConfig = {
fullyParallel: true,
projects: [
{ name: "chromium", use: chrome },
{ name: "firefox", use: firefox },
{ name: "webkit", use: safari },
],
reporter: [["list"], ["html", { open: CI ? "never" : "always" }]],
retries: CI ? 3 : 1,
testDir: "e2e",
use: {
baseURL,
trace: "retain-on-failure",
video: "retain-on-failure",
},
webServer: {
command: overrideUrl ? "" : CI ? "yarn serve" : "yarn dev",
reuseExistingServer: Boolean(overrideUrl),
url: overrideUrl || baseURL,
},
workers: CI ? 1 : undefined,
};
// ts-prune-ignore-next
export default config;