e65da6f294
- 新增法制日报机构种子数据(机构/用户/分类/15应用/知识库),登录页默认账号预填 - 引入 Playwright e2e:登录复用 storageState,覆盖对话/补全/工作流/智能体四类交互 - 配置测试脚本与产物 gitignore Co-authored-by: Cursor <cursor@cursor.com>
36 lines
848 B
TypeScript
36 lines
848 B
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
const BASE_URL = process.env.E2E_BASE_URL || "http://localhost:3000";
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
outputDir: "./e2e/.artifacts",
|
|
fullyParallel: false,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: 0,
|
|
workers: 2,
|
|
reporter: [["list"], ["html", { outputFolder: "./e2e/.report", open: "never" }]],
|
|
timeout: 120_000,
|
|
expect: { timeout: 90_000 },
|
|
use: {
|
|
baseURL: BASE_URL,
|
|
trace: "retain-on-failure",
|
|
screenshot: "only-on-failure",
|
|
actionTimeout: 30_000,
|
|
locale: "zh-CN",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "setup",
|
|
testMatch: /auth\.setup\.ts/,
|
|
},
|
|
{
|
|
name: "apps",
|
|
use: {
|
|
...devices["Desktop Chrome"],
|
|
storageState: "./e2e/.auth/state.json",
|
|
},
|
|
dependencies: ["setup"],
|
|
},
|
|
],
|
|
}); |