Files
PlantAI-rag-new/frontend/playwright.config.js
T
jerryandClaude Fable 5 1e94de7464 PlantAI-rag-new 首次提交:文献知识工作台
- BFF 薄适配层(FastAPI,8090):QA 代理/SSE 中继/Neo4j 直连/抽取代理/会话持久化
- Vue3 前端:五相位检索流水线、文献来源与证据链、知识图谱、提取任务四 tab
- 四档响应式(桌面/笔记本/平板/手机)、深浅主题
- 81 个 FR 全部实现,测试追溯矩阵 81/81,后端 121 测/前端 156 测
- 真实凭据已脱敏,运行时配置在 backend/.env(不入 git)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 20:47:52 +08:00

52 lines
1.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// playwright.config.js —— T(测试 agent)归属。
// L5 端到端骨架:三档视口(TEST_PLAN §3),与 vitest(vitest.config.js)完全独立。
// 完整用例(按 docs/TEST_CASES.md 的 TC-E2E-*)在后续轮次以 spec 文件补齐到 ../tests/e2e/。
import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: '../tests/e2e',
testMatch: '**/*.spec.js',
// 2026-08-25 R2 加固(T 建议采纳):真实 QA 流最长 ~92s 且上游串行排队会放大,
// 全局 timeout 提到 480s;各 spec 内对不含真实流的用例仍可用 test.setTimeout 收紧。
timeout: 480_000,
expect: { timeout: 10_000 },
fullyParallel: false, // 三项目串行,避免 dev server 端口与 mock 场景互相干扰
workers: 1,
retries: 0, // 测试轮次纪律:失败即记录,不自动重试掩盖缺陷
reporter: [['list']],
use: {
baseURL: 'http://127.0.0.1:5180',
browserName: 'chromium',
headless: true, // 远端可改 headed;本地保持无头
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
},
projects: [
{
name: 'mobile',
use: {
viewport: { width: 390, height: 844 }, // iPhone 14
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1',
isMobile: true,
hasTouch: true,
deviceScaleFactor: 3,
},
},
{
name: 'tablet',
use: { viewport: { width: 768, height: 1024 } }, // iPad
},
{
name: 'desktop',
use: { viewport: { width: 1440, height: 900 } },
},
],
webServer: {
command: 'npm run dev -- --strictPort',
url: 'http://127.0.0.1:5180',
timeout: 60_000,
reuseExistingServer: !process.env.CI,
// 复用已由 deploy/start-dev.sh 或手动拉起的 dev server(集成/远端场景)
},
});