import { TestRecord, TestSummary, SlowTest, TestFailure, BuildInfo } from '../types'; import { TestCase } from '@playwright/test/reporter'; /** * Utility class containing static methods for test result processing and calculations. * Provides functionality for formatting time, calculating statistics, and processing test results. */ export declare class TestUtils { /** * Formats a time duration from seconds into a human-readable string. * Converts to minutes if the duration is longer than 60 seconds. * * @param timeInSeconds - The time duration to format in seconds * @returns A formatted string with appropriate units (e.g., "1.23s" or "2.50min") */ static formatTime(timeInSeconds: number): string; /** * Calculates the average duration from an array of time measurements. * * @param durations - Array of durations in seconds * @returns The average duration in seconds, or 0 if the array is empty */ static calculateAverageTime(durations: number[]): number; /** * Finds the slowest tests from all test records. * Only considers passed tests when calculating the slowest ones. * * @param testRecords - Map of all test records * @param limit - Maximum number of slow tests to return * @returns Array of the slowest tests, sorted by duration */ static findSlowestTests(testRecords: Map, limit: number): SlowTest[]; /** * Categorizes the error message into predefined types * @param message - Error message * @returns Error category */ static categorizeError(message: string): string; /** * Convert test outcome to status * @param outcome - Test outcome * @returns Standardized status */ static outcomeToStatus(outcome: string): string; /** * Determines the team that owns a test based on test name and annotations * @param test - Test case to analyze * @returns Name of the team that owns the test */ static getOwningTeam(test: TestCase): string; /** * Helper method to wrap a string for team name matching * @param text - Text to wrap * @returns Wrapped text */ private static wrap; /** * Processes all test records to generate comprehensive test results. * Calculates passed, failed, and skipped test counts, and collects timing information. * * @param testRecords - Map of all test records * @returns Object containing test counts, failures, and timing information */ static processTestResults(testRecords: Map): { passedCount: number; testCount: number; skippedCount: number; failedCount: number; failures: TestFailure[]; passedDurations: number[]; }; } /** * Logger class responsible for formatting and outputting test results. * Provides methods for logging test summaries, metrics, and failures with appropriate formatting. */ export declare class Logger { /** * Logs the overall test run summary with appropriate coloring. * Includes total tests, passed tests, skipped tests, and total time. * * @param summary - The test summary to log */ static logSummary(summary: TestSummary): void; /** * Logs build information if available * * @param buildInfo - The build information to log */ static logBuildInfo(buildInfo: BuildInfo): void; /** * Logs detailed metrics about the test run. * Includes average test time and information about slow tests. * * @param summary - The test summary containing metrics to log */ static logMetrics(summary: TestSummary): void; /** * Logs detailed information about test failures. * Includes test title, stack trace, and timeout information. * * @param failures - Array of test failures to log */ static logFailures(failures: TestFailure[]): void; }