forked from Thorium-Sim/thorium-nova
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
43 lines (37 loc) · 988 Bytes
/
Copy pathplaywright.config.ts
File metadata and controls
43 lines (37 loc) · 988 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
43
import { type PlaywrightTestConfig, devices } from "@playwright/test";
function envToBool(value: string | undefined) {
if (!value) {
return false;
}
return ["true", "1"].includes(value);
}
const TEST_SERVER_PORT = Number(process.env.PORT || "4010");
const IS_CI = envToBool(process.env.CI);
const config: PlaywrightTestConfig = {
// exit CI with error if any tests are marked as `.only`
forbidOnly: IS_CI,
retries: IS_CI ? 2 : 0,
// the timeout for each test
timeout: 60000,
expect: {
// We have a few actions that can take a while to complete. Rather than set
// a timeout each time just bump the timeout for expect.
timeout: 20000,
},
testMatch: "**/*.e2e.ts",
// Don't run in parallel
fullyParallel: IS_CI,
workers: IS_CI ? 4 : 1,
use: {
headless: true,
trace: "retain-on-failure",
baseURL: `http://localhost:${TEST_SERVER_PORT}`,
},
projects: [
{
name: "Chromium",
use: { ...devices["Desktop Chrome"] },
},
],
};
export default config;