Files
prompt-optimizer/scripts/smart-e2e.js
linshen afb0f92d19 refactor(e2e): 全面重构端到端测试基础设施
- 实现 VCR 在启用真实 LLM 时默认使用 off 模式
- 实现动态数据库隔离以支持并行测试
- 修复 Pro 模式 session 持久化测试
- 移除 VCR fixtures 中的时间戳字段
- 改进测试隔离以防止路由状态泄漏
- 修正 smart-e2e 只检查实际调用 LLM API 的测试 fixture
- 简化 smart-e2e 使用 auto 模式
- 重命名 analyze-prompt.spec.ts 为 route-initialization.spec.ts
- 添加 session 持久化测试,验证下拉框选择刷新后丢失问题
2026-01-10 15:47:00 +08:00

35 lines
810 B
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.
#!/usr/bin/env node
/**
* 智能 E2E 测试运行器
*
* 使用 VCR auto 模式:每个测试独立检查自己的 fixture
* - fixture 存在 → 回放(快速)
* - fixture 不存在 → 录制(自动创建)
*
* 使用:
* node scripts/smart-e2e.js
*/
const { execSync } = require('child_process')
/**
* 主函数
*/
function main() {
console.log('\n🎬 使用 VCR auto 模式运行 E2E 测试')
console.log(' - 有 fixture 的测试:回放')
console.log(' - 无 fixture 的测试:录制\n')
try {
// 不设置 E2E_VCR_MODE使用默认的 auto 模式
execSync('playwright test', {
stdio: 'inherit',
env: process.env // 继承现有环境变量,不覆盖 E2E_VCR_MODE
})
} catch (error) {
process.exit(error.status || 1)
}
}
main()