/** * Models and interfaces for execution screen step components */ export declare type StepStatus = 'success' | 'failed' | 'pending' | 'running' | 'skipped' | 'SUCCESS' | 'FAILED' | 'PENDING' | 'RUNNING' | 'SKIPPED'; export interface TimingBreakdown { app: number; tool: number; } export interface SubStep { id: string; description: string; status: StepStatus; duration: number; remainingSeconds?: number | null; timestamp?: string; } export interface LoopIteration { id: string; label: string; status: StepStatus; subSteps?: SubStep[]; } export interface ConditionBranch { type: 'if' | 'else' | 'else if'; label: string; conditionText?: string; conditionType?: string; executed: boolean; subSteps?: SubStep[]; branchStepId?: string | number; isIfBranch?: boolean; branchStep: any; } export interface ScreenshotData { baseline?: string; current?: string; difference?: string; } export interface LogEntry { level: 'info' | 'warning' | 'error'; message: string; timestamp?: string; } export interface FailureDetails { testStepId: string; expected: string; actual: string; failedAction?: string; aiFixApplied?: boolean; aiFixMessage?: string; screenshots?: ScreenshotData; logs?: LogEntry[]; } export interface BaseStepConfig { id: string; uniqueId?: string; testStepId: number | undefined; testStepResultId: string; stepNumber: string; title: string; status: StepStatus; duration: number; timingBreakdown?: TimingBreakdown; expanded?: boolean; failureDetails?: FailureDetails; reasoning?: string[]; confidence?: string; stepDeleted?: boolean; executedResult?: { video_start_time: number; video_end_time: number; }; selectedIterationId?: string; /** Internal debug/portal-only flags used at runtime (not persisted). */ isStepGroupChildren?: boolean; stepMoreMenuOptions?: boolean; debugPointDisabled?: boolean; isRunResult?: boolean; } export interface SelfHealAnalysisData { originalLocator: string; healedLocator: string; confidence: number; healMethod: string; } export interface SelfHealActionEvent { type: SelfHealAction; id: string; healedLocator: string; testStepId?: string; } export declare type SelfHealAction = 'accept' | 'reject' | 'modify-accept'; export interface BasicStepConfig extends BaseStepConfig { displayType: 'basic'; subSteps: SubStep[]; selfHealAnalysis?: SelfHealAnalysisData; selfHealed?: boolean; selfHealDuration?: number; nestedSteps?: ExecutionStepConfig[]; } export interface StepGroupConfig extends BaseStepConfig { displayType: 'step-group'; groupName: string; steps: ExecutionStepConfig[]; } export interface LoopStepConfig extends BaseStepConfig { displayType: 'loop'; loopType?: 'for' | 'while'; iterations: LoopIteration[]; selectedIterationId?: string; defaultIteration?: 'first' | 'last'; nestedSteps?: ExecutionStepConfig[]; showViewAllIterations?: boolean; subSteps?: SubStep[]; iterationData?: any; } export interface ConditionStepConfig extends BaseStepConfig { displayType: 'condition'; conditionText: string; branches: ConditionBranch[]; nestedSteps?: ExecutionStepConfig[]; } export interface FailedStepConfig extends BaseStepConfig { displayType: 'failed'; subSteps: SubStep[]; failureDetails: FailureDetails; reasoning?: string[]; confidence?: string; } export interface AIAgentAction { id: string; description: string; type: 'extract' | 'validate' | 'AI_AGENT_ACTION' | 'TYPE' | 'CLICK'; status: StepStatus; confidence?: number; duration: number; reasoning?: string; } export interface AIAgentStepConfig extends BaseStepConfig { displayType: 'ai-agent'; prompt: string; optimizedRun?: boolean; actionCount?: number; actions: AIAgentAction[]; selectedTab?: 'action-trace' | 'planner-timeline' | 'ai-reasoning'; } export interface AIActionStepConfig extends BaseStepConfig { displayType: 'ai-action'; actionCount?: number; actionName?: 'ai_text_verification' | 'ai_ask' | 'ai_document_ask' | 'ai_verify'; actions: AIAgentAction[]; } export interface ApiAssertion { id: string; description: string; status: 'passed' | 'failed'; expected: string; actual: string; } export interface ApiStepConfig extends BaseStepConfig { displayType: 'api'; method: string; endpoint: string; statusCode: number; responseTime: number; requestBody?: any; responseBody?: any; requestHeaders?: any; responseHeaders?: any; assertions?: ApiAssertion[]; initialActions?: SubStep[]; } export interface FileDownloadStepConfig extends BaseStepConfig { displayType: 'file-download'; fileName: string; fileType: string; fileSize?: string; filePath?: string; downloaded: boolean; } export interface ExtractedField { label: string; value: string; confidence: number; } export interface VerificationCheck { id: string; description: string; status: 'pass' | 'fail'; expected: string; actual: string; } export interface DocumentVerificationStepConfig extends BaseStepConfig { displayType: 'document-verification'; documentScreenshot?: string; extractedFields: ExtractedField[]; verificationChecks: VerificationCheck[]; } export interface LiveSubStep { id: string; text: string; isRunning: boolean; duration?: number; status: 'passed' | 'failed' | 'pending' | 'success' | 'failure' | 'skipped'; remainingSeconds?: number | null; } export interface LiveExecutionStepConfig extends BaseStepConfig { displayType: 'live-execution'; subSteps: LiveSubStep[]; } export interface DbQueryResult { data: any[]; query: string; executedAt?: string; duration?: number; [key: string]: any; } export interface DbAssertionResult { variableName: string; jsonPath: string; expectedValue: any; actualValue: any; verificationType: string; expectedType: string; passed: boolean; } export interface DbTestResult { success: boolean; results: { [key: string]: DbQueryResult; }; assertionResults: DbAssertionResult[]; allAssertionsPassed: boolean; } export interface DbVerificationStepConfig extends BaseStepConfig { displayType: 'db-verification'; dbTestResult: DbTestResult; subSteps?: SubStep[]; dbConfig?: { name: string; dbType: string; }; } export interface PrerequisiteItem { id: string; title: string; status: StepStatus; duration: number; stepConfig?: ExecutionStepConfig; /** Optional URL for "View steps" redirect. When viewStepsAsRedirect is true, each item can have its own URL. */ viewStepsUrl?: string; } export declare type ExecutionStepConfig = BasicStepConfig | StepGroupConfig | LoopStepConfig | ConditionStepConfig | FailedStepConfig | AIAgentStepConfig | AIActionStepConfig | ApiStepConfig | FileDownloadStepConfig | DocumentVerificationStepConfig | LiveExecutionStepConfig | DbVerificationStepConfig; /** Option for the Add-step menu shown when the Plus icon is clicked (e.g. "Add before", "Add after"). */ export interface AddStepMenuOption { id: string; label: string; position?: string; branchType?: string; branchStepId?: string | number; } /** Default options for the Add-step dropdown when isDebug is true. */ export declare const DEFAULT_ADD_STEP_MENU_OPTIONS: AddStepMenuOption[]; /** Option for the step "More options" (three-dot) menu (e.g. Skip, Duplicate, Delete, Add breakpoint, Run to here). */ export interface StepMoreMenuOption { id: string; label: string; } /** Default options for the More options (three-dot) menu when isDebug is true. */ export declare const DEFAULT_STEP_MORE_MENU_OPTIONS: StepMoreMenuOption[];