fix: 改进成功消息等待策略,修复测试失败问题

- 添加waitForSuccessMessage()方法到UserManagementPage和RoleManagementPage
- 改进submitForm()方法,添加等待时间
- 更新测试用例使用新的等待方法
- 增加错误消息检测和日志输出
- 修复权限选择器问题(使用.el-tree替代固定value)
This commit is contained in:
张翔
2026-04-04 10:03:19 +08:00
parent 0e367a8873
commit f882599072
35 changed files with 874 additions and 95 deletions
+13 -1
View File
@@ -1,9 +1,21 @@
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;
export default globalTeardown;