UNPKG

@craftapit/tester

Version:

A focused, LLM-powered testing framework for natural language test scenarios

60 lines (59 loc) 1.83 kB
import { Scenario } from '../types/scenario'; import { TestResult, TestResults } from '../types/results'; import { BaseAdapter } from '../adapters/BaseAdapter'; import { Addon, CapabilityFeedback } from '../types/addon'; import { CapabilityRegistry } from './CapabilityRegistry'; export interface TestExecutorConfig { browser?: { headless?: boolean; slowMo?: number; [key: string]: any; }; logging?: { level?: string; screenshots?: boolean; [key: string]: any; }; [key: string]: any; } export declare class TestExecutor { private config; private scenarioParser; private adapters; private logger; private capabilityRegistry; private addons; constructor(config?: TestExecutorConfig, registry?: CapabilityRegistry); /** * Register an adapter with the test executor */ registerAdapter(name: string, adapter: BaseAdapter): void; /** * Register an addon with the test executor */ registerAddon(addon: Addon): void; /** * Get a list of all registered addons */ getAddons(): Addon[]; /** * Provide feedback on a capability resolution */ provideFeedback(feedback: CapabilityFeedback): Promise<void>; runScenario(scenarioPath: string): Promise<TestResult>; runScenarios(scenarioPaths: string[]): Promise<TestResults>; private initializeAdapters; private cleanupAdapters; private getPrimaryAdapterForTestType; /** * Execute a scenario * @param scenario The scenario to execute * @returns The test result */ executeScenario(scenario: Scenario): Promise<TestResult>; private parseUIAction; private parseAPIRequest; private parseAPIExpectations; private parseDatabaseQuery; private parseDatabaseExpectations; }