/** * QA360 UI Artifacts Manager * * Manages screenshots, videos, traces, and other test artifacts * with content-addressable storage (CAS) integration */ export type ScreenshotFormat = 'png' | 'jpeg' | 'webp'; export interface ScreenshotOptions { fullPage?: boolean; quality?: number; type?: ScreenshotFormat; animations?: 'disabled' | 'allow'; } export interface ArtifactMetadata { testId: string; stepIndex?: number; stepName?: string; type: 'screenshot' | 'video' | 'trace' | 'network' | 'console' | 'coverage'; timestamp: string; status?: 'passed' | 'failed' | 'flaky'; tags?: string[]; } export interface StoredArtifact { casPath: string; localPath: string; hash: string; metadata: ArtifactMetadata; size: number; type: 'screenshot' | 'video' | 'trace' | 'network' | 'console' | 'coverage'; } export interface VideoArtifact extends StoredArtifact { type: 'video'; format: 'webm'; duration: number; } export interface ScreenshotArtifact extends StoredArtifact { type: 'screenshot'; format: ScreenshotFormat; width: number; height: number; } export interface TraceArtifact extends StoredArtifact { type: 'trace'; format: 'zip'; } /** * UI Artifacts Manager * * Handles: * - Automatic screenshots (before/after steps, on error) * - Video recording * - Trace files * - Network captures * - Console logs * - Storage in CAS for deduplication */ export declare class UIArtifactsManager { private artifactDir; private casDir; private currentRunId; private currentTestId?; private artifacts; private cas; constructor(artifactDir?: string, casDir?: string); private ensureDirectories; /** * Start a new test session */ startTest(testId: string): void; /** * End current test session */ endTest(): void; /** * Take a screenshot and store it */ takeScreenshot(page: any, // Playwright Page options?: ScreenshotOptions, metadata?: Partial): Promise; /** * Take screenshot before a step */ takeBeforeScreenshot(page: any, stepName: string, stepIndex: number): Promise; /** * Take screenshot after a step */ takeAfterScreenshot(page: any, stepName: string, stepIndex: number, success: boolean): Promise; /** * Take screenshot on error */ takeErrorScreenshot(page: any, error: Error, stepName?: string): Promise; /** * Save video artifact */ saveVideo(videoPath: string, metadata?: Partial): Promise; /** * Save trace artifact */ saveTrace(tracePath: string, metadata?: Partial): Promise; /** * Get artifact by ID */ getArtifact(id: string): StoredArtifact | undefined; /** * Get all artifacts for current test */ getTestArtifacts(): StoredArtifact[]; /** * Get all artifacts by type */ getArtifactsByType(type: StoredArtifact['type']): StoredArtifact[]; /** * Clean up old artifacts */ cleanup(maxAge?: number): void; /** * Generate CAS path from hash */ private getCasPath; /** * Generate artifacts summary for reporting */ generateSummary(): { screenshots: number; videos: number; traces: number; totalSize: number; casDedupSavings: number; }; } /** * Create a UI artifacts manager */ export declare function createUIArtifactsManager(artifactDir?: string, casDir?: string): UIArtifactsManager;