feat: integrate test history recording into test execution

This commit is contained in:
张翔
2026-03-13 11:38:00 +08:00
parent dd1ea3f9a9
commit 33a2dd454f
4 changed files with 67 additions and 15 deletions
+24
View File
@@ -0,0 +1,24 @@
import { TestHistoryManager } from './src/utils/test-history';
const historyManager = new TestHistoryManager();
export async function globalTeardown(config: any, result: any) {
console.log('📊 记录测试执行历史...');
for (const suite of result.suites) {
for (const spec of suite.suites) {
for (const test of spec.tests) {
const testId = `${spec.file}::${test.title}`;
historyManager.recordExecution(
testId,
spec.file,
test.title,
test.results[0]?.duration || 0,
test.results[0]?.status === 'passed'
);
}
}
}
console.log('✅ 历史记录完成');
}