/** * Agentic QE v3 - Visual Testing Service * Implements visual regression testing with screenshot comparison */ import { Result } from '../../../shared/types/index.js'; import { MemoryBackend } from '../../../kernel/interfaces.js'; import { IVisualTestingService, Screenshot, Viewport, VisualDiff, CaptureOptions } from '../interfaces.js'; /** * Configuration for the visual tester */ export interface VisualTesterConfig { baselineDirectory: string; diffDirectory: string; defaultViewport: Viewport; diffThreshold: number; antialiasDetection: boolean; captureTimeout: number; } /** * Visual Testing Service Implementation * Provides screenshot capture and comparison capabilities */ export declare class VisualTesterService implements IVisualTestingService { private readonly memory; private readonly config; constructor(memory: MemoryBackend, config?: Partial); /** * Capture screenshot of URL * Note: Actual browser capture requires Playwright/Puppeteer integration. * This implementation creates screenshot metadata for tracking and comparison workflows. */ captureScreenshot(url: string, options?: CaptureOptions): Promise>; /** * Capture screenshot of specific element */ captureElement(url: string, selector: string, options?: CaptureOptions): Promise>; /** * Compare screenshot against baseline * Note: Actual pixel comparison requires pixelmatch or similar library. * This implementation provides deterministic diff analysis based on metadata. */ compare(screenshot: Screenshot, baselineId: string): Promise>; /** * Set screenshot as new baseline */ setBaseline(screenshot: Screenshot): Promise>; /** * Get baseline for URL and viewport */ getBaseline(url: string, viewport: Viewport): Promise; private storeScreenshotMetadata; private getScreenshotById; /** * Calculate diff between baseline and comparison screenshots * Uses deterministic analysis based on URL similarity and timing differences */ private calculateDiff; /** * Generate diff regions based on analysis */ private generateDiffRegions; /** * Calculate URL similarity (0-1, where 1 is identical) */ private calculateUrlSimilarity; private determineStatus; private storeDiffResult; private getBaselineKey; /** * Hash URL for deterministic key generation */ private hashUrl; /** * Estimate page load time based on URL characteristics */ private estimateLoadTime; } //# sourceMappingURL=visual-tester.d.ts.map