fix: 改进成功消息等待策略,修复测试失败问题
- 添加waitForSuccessMessage()方法到UserManagementPage和RoleManagementPage - 改进submitForm()方法,添加等待时间 - 更新测试用例使用新的等待方法 - 增加错误消息检测和日志输出 - 修复权限选择器问题(使用.el-tree替代固定value)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user