/** * Models and interfaces for test case details step components */ export declare type TestCaseEventType = 'navigate' | 'custom' | 'ai-agent' | 'type' | 'click' | 'doubleClick' | 'pressEnter' | 'enter' | 'verify' | 'wait'; export declare enum StepTypes { NORMAL = "NORMAL", API = "API", DATABASE = "DATABASE", AI_AGENT = "AI_AGENT", AI_VERIFY = "AI_VERIFY", UPLOAD = "UPLOAD", SCREENSHOT = "SCREENSHOT", VERIFY_URL = "VERIFY_URL", RESTORE_SESSION = "RESTORE_SESSION", CUSTOM_CODE = "CUSTOM_CODE", FOR_LOOP = "FOR_LOOP", WHILE_LOOP = "WHILE_LOOP", BREAK_LOOP = "BREAK_LOOP", CONTINUE_LOOP = "CONTINUE_LOOP", CONDITION_IF = "CONDITION_IF", STEP_GROUP = "STEP_GROUP", SCROLL = "SCROLL" } export interface EventTypeConfig { type: TestCaseEventType; label: string; icon?: string; color: string; backgroundColor: string; } export interface StepParameter { name: string; value: string; displayValue?: string; } /** Base interface containing common properties for all step configurations */ export interface BaseStepConfig { id: string; action?: string; stepNumber: number | string; stepType: StepTypes; description?: string; selected?: boolean; disabled?: boolean; expanded?: boolean; event?: Record; /** Creation timestamp from API (milliseconds since epoch) */ createdDate?: number; /** When true, this step is marked to be skipped during execution */ shouldSkip?: boolean; } export interface NormalStepConfig extends BaseStepConfig { stepType: StepTypes.NORMAL; eventType: TestCaseEventType; parameters: StepParameter[]; elementData?: { label?: string; selector?: string; pwLocator?: string[]; labels?: string[]; }; } /** API Step Configuration */ export interface ApiStepConfig extends BaseStepConfig { stepType: StepTypes.API; method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'; endpoint: string; baseUrl?: string; requestBody?: string; headers?: Record; headersCount?: number; hasBody?: boolean; saveTo?: string; expectedStatus?: number; } /** Database Step Configuration */ export interface DatabaseStepConfig extends BaseStepConfig { stepType: StepTypes.DATABASE; query: string; databaseType?: 'mysql' | 'postgresql' | 'mongodb' | 'mssql' | 'oracle'; connectionName?: string; saveTo?: string; } /** AI Agent Step Configuration */ export interface AiAgentStepConfig extends BaseStepConfig { stepType: StepTypes.AI_AGENT; instructions: string; } /** AI Verify Step Configuration */ export interface AiVerifyStepConfig extends BaseStepConfig { stepType: StepTypes.AI_VERIFY; instructions: string; } /** Upload Step Configuration */ export interface UploadStepConfig extends BaseStepConfig { stepType: StepTypes.UPLOAD; selector: string; fileName: string; source: 'Data Library' | 'Local' | 'URL'; sourcePath: string; } /** Screenshot Step Configuration */ export interface ScreenshotStepConfig extends BaseStepConfig { stepType: StepTypes.SCREENSHOT; name?: string; fullPage?: boolean; selector?: string; } /** Scroll Step Configuration */ export interface ScrollStepConfig extends BaseStepConfig { stepType: StepTypes.SCROLL; selector: string; direction?: 'top' | 'bottom' | 'up' | 'down' | 'left' | 'right'; description?: string; } /** Verify URL Step Configuration */ export interface VerifyUrlStepConfig extends BaseStepConfig { stepType: StepTypes.VERIFY_URL; action?: string; url?: string; } /** Restore Session Step Configuration */ export interface RestoreSessionStepConfig extends BaseStepConfig { stepType: StepTypes.RESTORE_SESSION; action?: string; } /** Custom Code Step Configuration */ export interface CustomCodeStepConfig extends BaseStepConfig { stepType: StepTypes.CUSTOM_CODE; language: 'javascript' | 'python' | 'typescript'; code: string; } export interface LoopStepConfig extends BaseStepConfig { loopType: 'for' | 'while'; stepType: StepTypes.FOR_LOOP | StepTypes.WHILE_LOOP; condition?: string; maxIterations?: number; testDataProfile?: string; startStep?: number; endStep?: number; /** FOR loop: API values for display (Start/End labels and Test Data profile id) */ forLoopStartIndex?: number; forLoopEndIndex?: number; forLoopTestDataId?: number; /** FOR loop: optional HTML string for display (e.g. with test_data badges). When set, used instead of building from values. */ forLoopDisplayHtml?: string; nestedSteps: TestCaseStepConfig[]; childId?: string; } export interface ConditionBranch { id?: number; type: 'if' | 'else' | 'else-if'; stepType: StepTypes.CONDITION_IF; label: string; action?: string; /** Event key-value pairs for display badges (e.g. selector, element) - same as config.event */ event?: Record; /** Creation timestamp from API (milliseconds since epoch) - for branch header date display */ createdDate?: number; nestedSteps: TestCaseStepConfig[]; /** * The next branch in the condition chain (ELSE IF or ELSE whose parentId points to this branch, * rather than to the root IF step). Used for chained conditions where ELSE IF / ELSE steps * are nested under a previous ELSE IF instead of directly under the root IF. */ nextBranch?: ConditionBranch; } export interface ConditionStepConfig extends BaseStepConfig { condition: string; branches: ConditionBranch[]; nestedSteps: TestCaseStepConfig[]; } export interface StepGroupConfig extends BaseStepConfig { stepGroupId: number; groupName: string; reusable?: boolean; stepType: StepTypes.STEP_GROUP; nestedSteps: TestCaseStepConfig[]; loading?: boolean; } export declare type TestCaseStepConfig = NormalStepConfig | LoopStepConfig | ConditionStepConfig | StepGroupConfig | ApiStepConfig | DatabaseStepConfig | AiAgentStepConfig | AiVerifyStepConfig | UploadStepConfig | ScreenshotStepConfig | ScrollStepConfig | VerifyUrlStepConfig | RestoreSessionStepConfig | CustomCodeStepConfig; /** Type guards for dispatching step type (e.g. in test-case-details-renderer) */ export declare function isNormalStepConfig(step: TestCaseStepConfig): step is NormalStepConfig; export declare function isLoopStepConfig(step: TestCaseStepConfig): step is LoopStepConfig; export declare function isConditionStepConfig(step: TestCaseStepConfig): step is ConditionStepConfig; export declare function isStepGroupConfig(step: TestCaseStepConfig): step is StepGroupConfig; export declare function isApiStepConfig(step: TestCaseStepConfig): step is ApiStepConfig; export declare function isDatabaseStepConfig(step: TestCaseStepConfig): step is DatabaseStepConfig; export declare function isAiAgentStepConfig(step: TestCaseStepConfig): step is AiAgentStepConfig; export declare function isAiVerifyStepConfig(step: TestCaseStepConfig): step is AiVerifyStepConfig; export declare function isUploadStepConfig(step: TestCaseStepConfig): step is UploadStepConfig; export declare function isScreenshotStepConfig(step: TestCaseStepConfig): step is ScreenshotStepConfig; export declare function isScrollStepConfig(step: TestCaseStepConfig): step is ScrollStepConfig; export declare function isVerifyUrlStepConfig(step: TestCaseStepConfig): step is VerifyUrlStepConfig; export declare function isRestoreSessionStepConfig(step: TestCaseStepConfig): step is RestoreSessionStepConfig; export declare function isCustomCodeStepConfig(step: TestCaseStepConfig): step is CustomCodeStepConfig;