import { StepId } from '../../domain/value-objects/StepId'; import { NavigationResult, FormFillResult, ClickResult, WaitResult, ModalResult, AutomationResult, } from './AutomationResults'; /** * Browser automation interface for Playwright-based automation. * * This interface defines the contract for browser automation using * standard DOM manipulation via Playwright. All automation is done * through browser DevTools protocol - no OS-level automation. */ export interface IBrowserAutomation { /** * Navigate to a URL. */ navigateToPage(url: string): Promise; /** * Fill a form field by name or selector. */ fillFormField(fieldName: string, value: string): Promise; /** * Click an element by selector or action name. */ clickElement(target: string): Promise; /** * Wait for an element to appear. */ waitForElement(target: string, maxWaitMs?: number): Promise; /** * Handle modal dialogs. */ handleModal(stepId: StepId, action: string): Promise; /** * Execute a complete workflow step. */ executeStep?(stepId: StepId, config: Record): Promise; /** * Initialize the browser connection. * Returns an AutomationResult indicating success or failure. */ connect?(): Promise; /** * Clean up browser resources. */ disconnect?(): Promise; /** * Check if browser is connected and ready. */ isConnected?(): boolean; } /** * @deprecated Use IBrowserAutomation directly. IScreenAutomation was for OS-level * automation which has been removed in favor of browser-only automation. */ export type IScreenAutomation = IBrowserAutomation;