-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
67 lines (60 loc) · 1.66 KB
/
Copy pathplaywright.config.ts
File metadata and controls
67 lines (60 loc) · 1.66 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { createRequire } from "module";
import path from "path";
import { defineConfig, devices } from "@playwright/test";
import { STORAGE_STATE_LESSONS_ADMIN } from "./tests/helpers/storage-paths";
const { loadEnvConfig } = createRequire(__filename)("@next/env");
loadEnvConfig(path.resolve(__dirname), true);
const baseURL = process.env.BASE_URL || "http://localhost:3501";
export default defineConfig({
testDir: "./tests",
testMatch: /.*\.spec\.ts/,
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: 1,
// Limit workers to 2 to avoid dev-server overwhelm and race conditions.
workers: 2,
reporter: "list",
timeout: 90 * 1000,
expect: { timeout: 10 * 1000 },
globalSetup: "./tests/global-setup.ts",
use: {
baseURL,
storageState: STORAGE_STATE_LESSONS_ADMIN,
trace: "on-first-retry",
screenshot: "only-on-failure",
video: "retain-on-failure",
actionTimeout: 15 * 1000,
navigationTimeout: 30 * 1000
},
webServer: [
{
command: "npm --prefix ../Api run dev",
url: "http://localhost:8084/health",
reuseExistingServer: true,
timeout: 90 * 1000,
stdout: "pipe",
stderr: "pipe"
},
{
command: "npm --prefix ../LessonsApi run dev",
url: "http://localhost:8090/health",
reuseExistingServer: true,
timeout: 90 * 1000,
stdout: "pipe",
stderr: "pipe"
},
{
command: "npm run dev",
url: "http://localhost:3501/login",
reuseExistingServer: true,
timeout: 180 * 1000
}
],
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"], headless: true },
fullyParallel: false
}
]
});