/** * executor.ts * * Drives a saved TestIntent through a headless or headed Chromium browser, * step by step, and produces an ExecutionReport at the end. * * The Executor is the core of the test-running pipeline. It: * 1. Loads stored ElementContext metadata from the Page Object Model on disk. * 2. Parses each natural-language intent step into a concrete browser action. * 3. Executes each action and, on failure, delegates to the FailureHandler * for self-healing before marking the step as failed. * 4. Continues through all remaining steps regardless of failures * (non-aborting "collect all failures" strategy). * 5. Writes per-step StepContext files to disk before and after each step * so the heal_test tool can pick up from any failed step later. * * Role in the overall flow: * execute_test MCP tool → Executor.run(intent) → ExecutionReport */ import { ExecutionReport, FrameworkConfig, TestIntent } from '../types'; /** * Runs a complete TestIntent through Playwright and produces a structured report. */ export declare class Executor { private config; private failureHandler; private contextManager; private actionEngine; /** * @param config - Framework configuration containing the artifacts directory path. */ constructor(config: FrameworkConfig); /** * Execute all steps in a TestIntent and return a full ExecutionReport. * * Launches a new Chromium browser, runs every step, attempts healing on * failures, collects all results, and closes the browser. Steps that cannot * be healed are recorded as failed but execution continues to the next step. * * @param intent - The TestIntent to execute (name, URL, and ordered steps). * @returns A report with overall status (passed/healed/failed), per-step * contexts, healing attempt count, and timing. */ run(intent: TestIntent): Promise; /** * Attempt to read the ELEMENT_CONTEXTS map from the Page Object Model file * that corresponds to this intent. Returns an empty map if the file does not * exist or if parsing fails. * * @param intent - The test intent whose slug is used to find the POM file. * @returns A map from element key strings to their stored ElementContext objects. */ private loadElementContexts; /** * Convert each natural-language intent step string into a StepInstruction * object with a concrete Playwright action and locator. * * Recognises verb prefixes to determine action type: * - "open / navigate / go to" → goto * - "click / press / tap / submit / select / choose / pick" → click * - "enter / type / fill / input / search" → fill * - everything else → expect (assertion) * * @param intent - The test intent whose steps should be parsed. * @returns An array of StepInstruction objects ready for execution. */ private parseSteps; /** * Execute a single parsed StepInstruction against the given Playwright page. * * @param page - The active Playwright page. * @param step - The parsed instruction to execute. * @throws Playwright errors if the action fails (caller handles healing). */ private executeStep; } //# sourceMappingURL=executor.d.ts.map