/** * E2E Test Runner - Test Orchestrator * * Manages test lifecycle: setup -> execute -> verify -> teardown */ import { AdapterRegistry } from '../adapters'; import type { LoadedConfig, Logger, TestExecutionResult, TestSuiteResult, UnifiedTestDefinition } from '../types'; /** * Options for the test orchestrator */ export interface OrchestratorOptions { /** Maximum parallel test executions */ parallel: number; /** Default test timeout in milliseconds */ timeout: number; /** Default retry count for steps */ retries: number; /** Base delay between retries */ retryDelay: number; /** Whether to skip setup phases */ skipSetup: boolean; /** Whether to skip teardown phases */ skipTeardown: boolean; /** Stop on first failure */ bail: boolean; /** Dry run mode - do not execute steps */ dryRun: boolean; } /** * Event types for progress reporting */ export type OrchestratorEventType = 'suite:start' | 'suite:end' | 'test:start' | 'test:end' | 'phase:start' | 'phase:end' | 'step:start' | 'step:end'; /** * Event listener callback */ export type OrchestratorEventListener = (event: OrchestratorEventType, data: unknown) => void; /** * Orchestrates test execution lifecycle */ export declare class TestOrchestrator { private readonly config; private readonly adapters; private readonly logger; private readonly options; private readonly contextFactory; private readonly stepExecutor; private readonly eventListeners; private shouldBail; private currentTestIndex; private totalTests; private currentTest; private currentPhase; constructor(config: LoadedConfig, adapters: AdapterRegistry, logger: Logger, options?: Partial); /** * Merge provided options with defaults */ private mergeOptions; /** * Add an event listener for progress reporting */ addEventListener(listener: OrchestratorEventListener): void; /** * Remove an event listener */ removeEventListener(listener: OrchestratorEventListener): void; /** * Emit an event to all listeners */ private emit; /** * Run a test suite (collection of tests) */ runSuite(tests: UnifiedTestDefinition[]): Promise; /** * Run a single test through all lifecycle phases */ runTest(test: UnifiedTestDefinition): Promise; /** * Execute main test phases (setup, execute, verify) */ private executeTestPhases; /** * Run teardown phase with error handling */ private runTeardownPhase; /** * Build test execution result object */ private buildTestResult; /** * Run a single phase (setup, execute, verify, or teardown) */ private runPhase; /** * Run a hook from the configuration */ private runHook; /** * Separate skipped tests from runnable tests */ private separateSkippedTests; /** * Create a skipped test result */ private createSkippedResult; /** * Create the final suite result */ private createSuiteResult; } /** * Create a test orchestrator * * @param config - Loaded configuration * @param adapters - Adapter registry * @param logger - Logger instance * @param options - Orchestrator options * @returns A new TestOrchestrator instance */ export declare function createOrchestrator(config: LoadedConfig, adapters: AdapterRegistry, logger: Logger, options?: Partial): TestOrchestrator; /** * Create and initialize a complete test runner * Connects adapters and returns ready-to-use orchestrator * * @param config - Loaded configuration * @param logger - Logger instance * @param options - Orchestrator options * @returns Initialized TestOrchestrator */ export declare function createAndInitializeRunner(config: LoadedConfig, logger: Logger, options?: Partial): Promise<{ orchestrator: TestOrchestrator; cleanup: () => Promise; }>; //# sourceMappingURL=test-orchestrator.d.ts.map