Files
novalon-manage-system/novalon-manage-web/e2e/global-teardown.ts
T
张翔 f882599072 fix: 改进成功消息等待策略,修复测试失败问题
- 添加waitForSuccessMessage()方法到UserManagementPage和RoleManagementPage
- 改进submitForm()方法,添加等待时间
- 更新测试用例使用新的等待方法
- 增加错误消息检测和日志输出
- 修复权限选择器问题(使用.el-tree替代固定value)
2026-04-04 10:03:19 +08:00

22 lines
625 B
TypeScript

import { FullConfig } from '@playwright/test';
import { exec } from 'child_process';
import { promisify } from 'util';
const execAsync = promisify(exec);
async function globalTeardown(config: FullConfig) {
console.log('🧹 开始全局测试环境清理...');
console.log('🛑 停止后端服务...');
try {
await execAsync('lsof -ti:8084 | xargs kill -9 2>/dev/null || true');
console.log('✅ 后端服务已停止');
} catch (error) {
console.log('⚠️ 后端服务停止时出现警告:', error);
}
console.log('✅ 全局测试环境清理完成');
}
export default globalTeardown;