deerflow2/frontend/playwright.config.ts
MT-Mint 29203a14b8 test(e2e): 添加 E2E 测试基础设施和线程记忆测试
- 配置 Playwright:baseURL 改为 localhost:2026,视频仅在 CI 保留
- 更新 .gitignore 排除 Playwright 报告/缓存
- 新增线程记忆 E2E 测试:验证发送消息后可加载 summary 且无日志报错
- thread-memory-panel 添加 data-testid 属性便于定位
2026-06-11 17:47:25 +08:00

35 lines
933 B
TypeScript

import path from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig, devices } from "@playwright/test";
import { config as loadEnv } from "dotenv";
const configDir = path.dirname(fileURLToPath(import.meta.url));
loadEnv({ path: path.resolve(configDir, ".env.local") });
loadEnv({ path: path.resolve(configDir, ".env") });
const baseURL = process.env.FRONTEND_E2E_BASE_URL ?? "http://localhost:2026";
export default defineConfig({
testDir: "./tests/e2e",
timeout: 30_000,
expect: {
timeout: 10_000,
},
fullyParallel: true,
retries: process.env.CI ? 1 : 0,
reporter: process.env.CI ? [["list"], ["html", { open: "never" }]] : "list",
use: {
baseURL,
trace: "on-first-retry",
screenshot: "only-on-failure",
video: process.env.CI ? "retain-on-failure" : "off",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
});