/**
 * Execution Context for a single test case or combination.
 */
export class ExecutionContext {
    scenario;
    browser;
    browserContext;
    page;
    inputs = {};
    expected;
    runId = '';
    batchId = '';
    organizationId = '';
    metadata = {};
    settings = {};
    aiConfig;
    results = [];
    extractedItems = [];
    onItemExtracted;
    onProgress;
    errors = [];
    isStopped = false;
    targetCollection;
    extractionBuffer = {};
    isBuffering = false;
    /**
     * Internal store for sharing data between DSL steps (e.g., file paths)
     */
    store = new Map();
    constructor(scenario) {
        this.scenario = scenario;
        this.targetCollection = scenario.database?.collection;
    }
    async cleanup() {
        try {
            if (this.page && !this.page.isClosed()) {
                await this.page.close();
            }
            if (this.browserContext) {
                await this.browserContext.close();
            }
        }
        catch (err) {
            // Ignore cleanup errors
        }
    }
}
