develop #1

Merged
zhangxiang merged 60 commits from develop into main 2026-04-05 10:28:15 +08:00
2 changed files with 18 additions and 19 deletions
Showing only changes of commit 80c4e56e0c - Show all commits
+1 -19
View File
@@ -1,21 +1,3 @@
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('✅ 全局测试环境清理完成');
}
import { globalTeardown } from './global-setup';
export default globalTeardown;
@@ -39,6 +39,23 @@ test.describe('系统全面集成测试', () => {
localStorage.clear();
sessionStorage.clear();
});
// 检查后端服务健康状态
try {
const response = await fetch('http://localhost:8084/actuator/health', {
signal: AbortSignal.timeout(5000)
} as any);
if (!response.ok) {
console.log('⚠️ 后端服务健康检查失败,等待恢复...');
await page.waitForTimeout(5000);
}
} catch (error) {
console.log('⚠️ 后端服务无响应,等待恢复...');
await page.waitForTimeout(5000);
}
// 增加测试间隔,让后端服务有时间恢复
await page.waitForTimeout(2000);
});
test.describe('1. 用户认证流程测试', () => {