-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
37 lines (36 loc) · 1.06 KB
/
Copy pathplaywright.config.ts
File metadata and controls
37 lines (36 loc) · 1.06 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
import { defineConfig } from "@playwright/test";
export default defineConfig({
testDir: "./e2e",
testMatch: "**/*.e2e.ts",
timeout: 45_000,
expect: {
timeout: 10_000
},
fullyParallel: false,
reporter: [["list"], ["html", { open: "never" }]],
// 自动托管被测服务:跑 e2e 无需手动起 API/Web;本地已起时复用。
// 前置要求:本地 PG(含种子数据)与系统 Chrome,同 dev 环境。
webServer: [
{
command: "npm run dev:api",
url: "http://127.0.0.1:3000/health",
timeout: 60_000,
reuseExistingServer: true,
// 同 smoke:e2e 不要求本机 SMTP,注册即自动验证。
env: { ...process.env, REGISTRATION_EMAIL_VERIFICATION_REQUIRED: "false" }
},
{
command: "npm run dev:web",
url: "http://127.0.0.1:3001/",
timeout: 120_000,
reuseExistingServer: true
}
],
use: {
baseURL: process.env.E2E_BASE_URL ?? "http://127.0.0.1:3001",
channel: "chrome",
headless: true,
screenshot: "only-on-failure",
trace: "retain-on-failure"
}
});