- 配置 Playwright:baseURL 改为 localhost:2026,视频仅在 CI 保留 - 更新 .gitignore 排除 Playwright 报告/缓存 - 新增线程记忆 E2E 测试:验证发送消息后可加载 summary 且无日志报错 - thread-memory-panel 添加 data-testid 属性便于定位
35 lines
933 B
TypeScript
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"] },
|
|
},
|
|
],
|
|
});
|