/** * E2E Test Helpers * * Utility functions for E2E testing including health checks, * site availability verification, and graceful test skipping. */ /** * Health check result for a target site */ export interface HealthCheckResult { url: string; available: boolean; status?: number; latency?: number; error?: string; } /** * Health check options */ export interface HealthCheckOptions { timeout?: number; method?: 'GET' | 'HEAD' | 'OPTIONS'; expectedStatus?: number[]; } /** * Perform a health check on a URL * * @param url - URL to check * @param options - Health check options * @returns Health check result */ export declare function healthCheck(url: string, options?: HealthCheckOptions): Promise; /** * Check if a site is healthy before running E2E tests * * @param url - URL to check * @param options - Health check options * @returns true if site is healthy, false otherwise */ export declare function isSiteHealthy(url: string, options?: HealthCheckOptions): Promise; /** * Perform health checks on multiple URLs * * @param urls - URLs to check * @param options - Health check options * @returns Array of health check results */ export declare function healthCheckMany(urls: string[], options?: HealthCheckOptions): Promise; /** * Skip test if site is unhealthy with a clear message * * Usage in beforeEach: * await skipIfUnhealthy('https://example.com'); * * @param url - URL to check * @param options - Health check options */ export declare function skipIfUnhealthy(url: string, options?: HealthCheckOptions): Promise; /** * Health check configuration for known E2E targets */ export declare const E2E_TARGETS: { readonly b2bshop: { readonly url: "https://b2bshop.lovable.app"; readonly timeout: 10000; readonly description: "B2BShop E-commerce platform"; }; readonly reqres: { readonly url: "https://reqres.in/api"; readonly timeout: 10000; readonly description: "Reqres.in fake REST API"; }; }; /** * Get health check config for a known target * * @param target - Target name * @returns Health check options for the target */ export declare function getTargetConfig(target: keyof typeof E2E_TARGETS): HealthCheckOptions & { url: string; description: string; }; /** * Perform health check on a known E2E target * * @param target - Target name * @returns Health check result */ export declare function healthCheckE2ETarget(target: keyof typeof E2E_TARGETS): Promise; /** * Skip test if known E2E target is unhealthy * * @param target - Target name */ export declare function skipIfE2ETargetUnhealthy(target: keyof typeof E2E_TARGETS): Promise; /** * Log health status of all known E2E targets * * Useful for debugging or CI output */ export declare function logE2ETargetsStatus(): Promise;