forked from chakra-ui/zag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
34 lines (32 loc) · 929 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
import { PlaywrightTestConfig, ReporterDescription } from "@playwright/test"
function getBaseUrl() {
const port = process.env.PORT || "3000"
return `http://localhost:${port}`
}
const config: PlaywrightTestConfig = {
testDir: "./e2e",
outputDir: "./e2e/results",
testMatch: "*.e2e.ts",
timeout: 30_000,
fullyParallel: true,
expect: {
timeout: 5_000,
},
forbidOnly: !!process.env.CI,
workers: process.env.CI ? 1 : undefined,
reporter: [
process.env.CI ? ["list"] : ["line"],
process.env.CI ? ["junit", { outputFile: "e2e/junit.xml" }] : null,
["html", { outputFolder: "e2e/report", open: "never" }],
].filter(Boolean) as ReporterDescription[],
retries: process.env.CI ? 2 : 0,
use: {
trace: "retain-on-failure",
baseURL: getBaseUrl(),
screenshot: "only-on-failure",
video: "retain-on-failure",
locale: "en-US",
timezoneId: "GMT",
},
}
export default config