import type { BrowserAdapter } from "@sudobility/webgraph_parser"; import type { ApiClient } from "../api/client.js"; import type { NetworkLogEntry, TestInteractionResponse, TestInteractionRunResponse, TestRunResponse, TestSurfaceResponse, TestSurfaceBundleRunResponse, ScanNextResponse, UserData } from "@sudobility/testomniac_types"; import type { ScanEventHandler } from "./types.js"; import type { Expertise, ExpertiseContext } from "../expertise/types.js"; import type { PageAnalyzer } from "../analyzer/index.js"; export declare function setClickWaitMs(ms: number): void; type StoredExpectation = { expectationType: string; elementIdentityId?: number; expectedValue?: string; attributeName?: string; targetPath?: string; secondaryTargetPath?: string; expectedCountDelta?: number; expectedTextTokens?: string[]; forbiddenTextTokens?: string[]; timeoutMs?: number; expectNoChange?: boolean; severity: string; description: string; playwrightCode: string; }; type StoredStep = { action: { actionType: string; path?: string; value?: string; playwrightCode: string; description: string; }; expectations: StoredExpectation[]; description: string; continueOnFailure: boolean; }; type ExecutionSnapshot = { html: string; url: string; uiSnapshot: ExpertiseContext["initialUiSnapshot"]; controlStates: ExpertiseContext["initialControlStates"]; }; type StepExecution = { step: StoredStep; startedAtMs: number; endedAtMs: number; beforeSnapshot: ExecutionSnapshot; afterSnapshot: ExecutionSnapshot; }; type ExpectationEvaluationGroup = { expectations: StoredExpectation[]; networkLogs: NetworkLogEntry[]; snapshot: ExecutionSnapshot; previousSnapshot: ExecutionSnapshot; }; /** * Execute a single test element: run actions, decompose page, evaluate expertises, * set outcomes, create findings, and optionally discover new test elements. */ export declare function executeTestInteraction(adapter: BrowserAdapter, testInteractionRun: TestInteractionRunResponse, testRun: TestRunResponse, expertises: Expertise[], analyzer: PageAnalyzer | null, api: ApiClient, events: ScanEventHandler, discoveryContext?: { navigationSurface: TestSurfaceResponse; bundleRun: TestSurfaceBundleRunResponse; /** * Scan-scoped set of page-state signatures whose body the server already * holds. When a signature is present, the runner sends a hashes-only * /scan/next; when absent (first sight this scan), it attaches the body up * front so the server can create/decompose without a second round-trip. */ sentPageBodies?: Set; }, scanScopePath?: string, loginManager?: import("./login-manager.js").LoginManager, cachedTestInteractions?: TestInteractionResponse[], userData?: UserData, /** * When the loop is driven by /scan/next, the selected interaction and its * full dependency chain are handed in directly, so we skip fetching the * runner's interaction set just to resolve one row. */ prefetched?: { interaction: TestInteractionResponse; chain: TestInteractionResponse[]; }): Promise; export declare function emitLiveScreenshot(adapter: BrowserAdapter, events: ScanEventHandler, pageUrl: string, preCaptured?: Uint8Array): Promise; /** * Exported for a cross-package guard: this is the seam where a step produced by * testomniac_api becomes something the executor can run. It reads `action.path` * and drops every other key, so a producer that emits `selector` yields an * undefined target and the step is skipped in silence. That shipped once. */ export declare function parseStoredSteps(stepsJson: unknown): StoredStep[]; export declare function buildExpectationEvaluationGroups(params: { stepExecutions: StepExecution[]; generatedExpectations: StoredExpectation[]; networkLogs: NetworkLogEntry[]; initialSnapshot: ExecutionSnapshot; finalSnapshot: ExecutionSnapshot; }): ExpectationEvaluationGroup[]; /** * Per-step before/after snapshots are only consumed by step-level expectation * evaluation (buildExpectationEvaluationGroups). When no step carries an * expectation (typical for navigation/render interactions), capturing them is * wasted work — the final decomposition snapshot is captured independently. */ export declare function interactionNeedsStepSnapshots(steps: Array<{ expectations?: unknown[]; }>): boolean; /** Read page HTML via the batched capturePageSnapshot seam when available. */ export declare function readPageHtml(adapter: BrowserAdapter): Promise; export {}; //# sourceMappingURL=test-interaction-executor.d.ts.map