Files
novalon-website/test-framework/shared/utils/reporting/EnhancedTestReporter.ts
T
张翔 4c8714c12d feat: complete system test fixes - 100% pass rate (85/85)
- Fixed all form tests (20/20 passing)
- Fixed all performance tests (35/35 passing)
- Fixed all SEO and accessibility tests (30/30 passing)
- Enhanced test framework with custom reporting
- Added performance baseline tracking
- Improved test reliability and error handling
2026-03-06 19:37:02 +08:00

44 lines
1.3 KiB
TypeScript

import { TestResult, TrendReport, PerformanceBaseline as PerformanceBaselineType, CoverageReport } from '../../types/reporting';
import { TrendAnalyzer } from './TrendAnalyzer';
import { PerformanceBaseline } from './PerformanceBaseline';
export class EnhancedTestReporter {
private results: TestResult[] = [];
private trendAnalyzer: TrendAnalyzer;
private performanceBaseline: PerformanceBaseline;
constructor() {
this.trendAnalyzer = new TrendAnalyzer();
this.performanceBaseline = new PerformanceBaseline();
}
addResult(result: TestResult): void {
this.results.push(result);
}
generateTrendReport(): TrendReport {
return this.trendAnalyzer.analyze(this.results);
}
generatePerformanceBaseline(): PerformanceBaselineType {
return this.performanceBaseline.calculate(this.results);
}
generateCoverageReport(): CoverageReport {
const totalTests = this.results.length;
const passed = this.results.filter(r => r.status === 'passed').length;
const failed = this.results.filter(r => r.status === 'failed').length;
const skipped = this.results.filter(r => r.status === 'skipped').length;
return { totalTests, passed, failed, skipped };
}
getResults(): TestResult[] {
return this.results;
}
clearResults(): void {
this.results = [];
}
}