UNPKG

agentic-qe

Version:

Agentic Quality Engineering Fleet System - AI-driven quality management platform

146 lines 3.42 kB
/** * TestFrameworkExecutor - Real test execution via child_process * * Replaces mock test execution with actual framework integration. * Supports Jest, Mocha, Playwright with proper output parsing. * * @version 1.0.0 * @priority P0 */ export interface TestFrameworkConfig { framework: 'jest' | 'mocha' | 'playwright' | 'cypress'; testPattern?: string; workingDir: string; timeout?: number; coverage?: boolean; environment?: string; config?: string; } export interface TestExecutionResult { framework: string; status: 'passed' | 'failed' | 'timeout' | 'error'; totalTests: number; passedTests: number; failedTests: number; skippedTests: number; duration: number; tests: TestCaseResult[]; coverage?: CoverageData; stdout: string; stderr: string; exitCode: number | null; error?: string; } export interface TestCaseResult { name: string; fullName: string; status: 'passed' | 'failed' | 'skipped' | 'pending'; duration: number; failureMessages?: string[]; ancestorTitles?: string[]; } export interface CoverageData { lines: { total: number; covered: number; pct: number; }; statements: { total: number; covered: number; pct: number; }; functions: { total: number; covered: number; pct: number; }; branches: { total: number; covered: number; pct: number; }; files: Record<string, FileCoverage>; } export interface FileCoverage { lines: { pct: number; }; statements: { pct: number; }; functions: { pct: number; }; branches: { pct: number; }; } /** * Real test framework executor using child_process */ export declare class TestFrameworkExecutor { private static readonly FRAMEWORK_COMMANDS; private static readonly FRAMEWORK_ARGS; /** * Execute tests with a specific framework */ execute(config: TestFrameworkConfig): Promise<TestExecutionResult>; /** * Detect test framework from package.json */ detectFramework(workingDir: string): Promise<'jest' | 'mocha' | 'playwright' | 'cypress' | null>; /** * Verify working directory exists and is accessible */ private verifyWorkingDirectory; /** * Check if test framework is available */ private checkFrameworkAvailable; /** * Parse test results based on framework */ private parseResults; /** * Get parser function for framework */ private getParser; /** * Parse Jest JSON output */ private parseJestResults; /** * Parse Mocha JSON output */ private parseMochaResults; /** * Parse Playwright JSON output */ private parsePlaywrightResults; /** * Parse Cypress JSON output */ private parseCypressResults; /** * Generic results parser (fallback) */ private parseGenericResults; /** * Extract JSON from output (handles noise before/after JSON) */ private extractJSON; /** * Parse Jest coverage data */ private parseJestCoverage; /** * Create timeout result */ private createTimeoutResult; /** * Create error result */ private createErrorResult; } //# sourceMappingURL=TestFrameworkExecutor.d.ts.map