/** * Test Scenario Types * * Type definitions for the test scenario runner system. * * @since v1.41.4 */ /** * A test step that can be executed in a scenario */ export type TestStep = InputStep | WaitStep | AssertStep | ActionStep; /** * Input step - simulates keyboard or text input */ export interface InputStep { type: 'input'; /** Raw key input (e.g., 'return', 'escape', 'tab', 'up', 'down') */ key?: string; /** Text to type (character by character) */ text?: string; /** Description of this step */ description?: string; } /** * Wait step - pause execution */ export interface WaitStep { type: 'wait'; /** Delay in milliseconds */ delay: number; /** Optional: wait for condition instead of fixed delay */ condition?: WaitCondition; /** Description of this step */ description?: string; } /** * Wait condition for dynamic waits */ export interface WaitCondition { /** Wait for a specific UI state */ state?: string; /** Wait for text to appear */ text?: string; /** Maximum wait time in ms (default: 5000) */ timeout?: number; } /** * Assert step - verify conditions */ export interface AssertStep { type: 'assert'; /** Expected conditions */ expect: AssertExpectation; /** Description of this step */ description?: string; } /** * Assertion expectations */ export interface AssertExpectation { /** Expected view/tab name */ view?: string; /** Expected text to be visible */ text?: string; /** Expected state values */ state?: Record; /** Expect no errors */ noErrors?: boolean; /** Expect specific count of items */ count?: { type: string; value: number; }; } /** * Action step - trigger application actions */ export interface ActionStep { type: 'action'; /** Action to execute */ action: string; /** Action parameters */ params?: Record; /** Description of this step */ description?: string; } /** * A complete test scenario */ export interface TestScenario { /** Unique scenario identifier */ id: string; /** Human-readable name */ name: string; /** Detailed description */ description: string; /** Category for grouping (e.g., 'auth', 'navigation', 'workflow') */ category: string; /** Tags for filtering */ tags?: string[]; /** Scenario steps to execute */ steps: TestStep[]; /** Setup actions to run before scenario */ setup?: SetupConfig; /** Teardown actions to run after scenario */ teardown?: TeardownConfig; /** Expected duration in ms (for timeout) */ timeout?: number; } /** * Setup configuration */ export interface SetupConfig { /** Mock tier level */ tier?: 'free' | 'plus' | 'pro' | 'max'; /** Mock authentication state */ authenticated?: boolean; /** Mock servers to add */ servers?: Array<{ name: string; path: string; }>; /** Mock plugins to add */ plugins?: Array<{ name: string; version: string; }>; /** Clear state before running */ clearState?: boolean; } /** * Teardown configuration */ export interface TeardownConfig { /** Clear state after running */ clearState?: boolean; /** Take screenshot on failure */ screenshotOnFailure?: boolean; } /** * Result of running a single step */ export interface StepResult { /** Step index (0-based) */ index: number; /** Step that was executed */ step: TestStep; /** Whether step passed */ passed: boolean; /** Error message if failed */ error?: string; /** Duration in ms */ duration: number; /** Captured state at this step */ capturedState?: Record; } /** * Result of running a complete scenario */ export interface ScenarioResult { /** Scenario that was run */ scenario: TestScenario; /** Whether scenario passed overall */ passed: boolean; /** Results for each step */ stepResults: StepResult[]; /** Total duration in ms */ duration: number; /** Error message if scenario failed */ error?: string; /** Timestamp when scenario started */ startedAt: Date; /** Timestamp when scenario ended */ endedAt: Date; } /** * Options for running scenarios */ export interface ScenarioRunnerOptions { /** Verbose output */ verbose?: boolean; /** Stop on first failure */ stopOnFailure?: boolean; /** Speed multiplier (higher = faster) */ speed?: number; /** Filter scenarios by category */ category?: string; /** Filter scenarios by tag */ tags?: string[]; /** Only run scenarios matching pattern */ pattern?: string; } /** * Summary of running multiple scenarios */ export interface ScenarioSummary { /** Total scenarios run */ total: number; /** Scenarios that passed */ passed: number; /** Scenarios that failed */ failed: number; /** Scenarios that were skipped */ skipped: number; /** Total duration in ms */ duration: number; /** Individual results */ results: ScenarioResult[]; } //# sourceMappingURL=types.d.ts.map