/** * E2E Test Runner - JSON Reporter * * Outputs full TestSuiteResult as JSON to file or stdout */ import type { ReporterConfig, TestSuiteResult } from '../types'; import { BaseReporter, type ReporterOptions } from './base.reporter'; /** * JSON output structure with metadata */ export interface JSONReportOutput { metadata: { version: string; timestamp: string; environment?: string; runner: string; }; summary: { total: number; passed: number; failed: number; skipped: number; passRate: number; duration: number; durationFormatted: string; success: boolean; }; tests: JSONTestResult[]; } /** * Test result in JSON format */ export interface JSONTestResult { name: string; status: string; duration: number; durationFormatted: string; retryCount: number; error?: { message: string; stack?: string; }; phases: JSONPhaseResult[]; capturedValues: Record; } /** * Phase result in JSON format */ export interface JSONPhaseResult { phase: string; status: string; duration: number; durationFormatted: string; error?: { message: string; stack?: string; }; steps: JSONStepResult[]; } /** * Step result in JSON format */ export interface JSONStepResult { stepId: string; adapter: string; action: string; description?: string; status: string; duration: number; durationFormatted: string; retryCount: number; data?: unknown; error?: { message: string; stack?: string; }; } /** * JSON reporter for structured output */ export declare class JSONReporter extends BaseReporter { private prettyPrint; private environmentName; constructor(config: ReporterConfig, options?: ReporterOptions); get name(): string; /** * Set the environment name for metadata */ setEnvironment(envName: string): void; generateReport(result: TestSuiteResult): Promise; /** * Build the complete JSON output structure */ private buildJSONOutput; /** * Format a test execution result */ private formatTestResult; /** * Format a phase result */ private formatPhaseResult; /** * Format a step result */ private formatStepResult; /** * Format error for JSON output */ private formatErrorForJSON; /** * Sanitize data to ensure it is JSON-serializable */ private sanitizeData; /** * Write JSON content to file */ private writeFile; } /** * Create a minimal JSON output (for piping to other tools) */ export declare function createMinimalJSONOutput(result: TestSuiteResult): string; //# sourceMappingURL=json.reporter.d.ts.map