import { StepId } from '../../domain/value-objects/StepId'; import type { NavigationResultDTO } from '../dto/NavigationResultDTO'; import type { ClickResultDTO } from '../dto/ClickResultDTO'; import type { WaitResultDTO } from '../dto/WaitResultDTO'; import type { ModalResultDTO } from '../dto/ModalResultDTO'; import type { AutomationResultDTO } from '../dto/AutomationResultDTO'; import type { FormFillResultDTO } from '../dto/FormFillResultDTO'; /** * 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; }