testgenius-ai
Version:
๐ TestGenius AI - The Ultimate E2E Testing Framework for Everyone | No Coding Required โข AI-Powered Automation โข Beautiful Reports โข Zero Complexity
157 lines โข 4.47 kB
TypeScript
import { Browser } from 'webdriverio';
import { TestDefinition, TestRunOptions, AIExecutionResult, TokenUsage, FrameworkConfig, ExecutionStats } from '../../types';
export declare class AITestExecutor {
private llm;
private browser;
private costTracker;
private smartDetector;
private smartAgent;
private steps;
private screenshots;
private tokenUsage;
private aiContext;
private retryCount;
private maxRetries;
private adaptiveStrategies;
private useFastMode;
private useSmartAgent;
constructor(config?: FrameworkConfig);
setBrowser(browser: Browser): void;
/**
* Track token usage from OpenAI response
*/
private trackTokenUsage;
/**
* Get total token usage for this test execution
*/
getTotalTokenUsage(): TokenUsage;
/**
* Track cost for a test execution
*/
trackTestCost(testId: string, sessionId: string, executionTime: number, success: boolean): Promise<void>;
/**
* ๐ ENHANCED: Execute test with maximum AI automation
*/
executeTest(test: TestDefinition, options?: TestRunOptions): Promise<AIExecutionResult>;
private navigateToSite;
/**
* ๐งญ Enhanced navigation with path support
*/
private navigateToPath;
/**
* ๐ง ENHANCED: Create intelligent execution plan with context awareness
*/
private createIntelligentExecutionPlan;
private createFallbackPlan;
/**
* ๐ ENHANCED: Execute plan with intelligent adaptation
*/
private executeIntelligentPlan;
/**
* ๐ ENHANCED: Execute step with Endorphin AI-inspired smart tools
*/
private executeIntelligentStep;
/**
* โก FAST: Execute step using smart detector (no AI)
*/
private executeFastStep;
/**
* โก FAST: Perform action without AI
*/
private performFastAction;
/**
* โก FAST: Verify element without AI
*/
private verifyFastElement;
/**
* ๐ฏ Generate multiple element detection strategies
*/
private generateElementDetectionStrategies;
/**
* ๐ง Generate selectors from natural language description (WebdriverIO Best Practices)
*/
private generateSelectorsFromDescription;
/**
* ๐ Generate text-based selectors (WebdriverIO Best Practices)
*/
private generateTextSelectors;
/**
* ๐ง Generate semantic selectors based on context
*/
private generateSemanticSelectors;
/**
* ๐๏ธ Generate visual pattern selectors
*/
private generateVisualSelectors;
/**
* ๐ Execute a specific strategy
*/
private executeStrategy;
/**
* ๐ Enhanced element finding with multiple approaches
*/
private findElementWithSelector;
/**
* ๐ Alternative element finding approaches (WebdriverIO Best Practices)
*/
private findElementWithAlternativeApproaches;
/**
* ๐ฏ Perform action on element
*/
private performAction;
/**
* โ
Verify element state
*/
private verifyElement;
/**
* ๐ง Intelligent error recovery
*/
private attemptIntelligentRecovery;
/**
* ๐ฏ Check if step is critical
*/
private isCriticalStep;
private takeScreenshot;
private addStep;
private executeRecordedSteps;
private executeRecordedStep;
private findElement;
private findFormField;
private findButton;
private checkFieldError;
private smartElementDetection;
private analyzePageState;
private shouldElementExistOnPage;
private generateMultipleSelectors;
private smartWaitForElement;
private recoverBrowserContext;
/**
* โก Enable/disable fast mode
*/
setFastMode(enabled: boolean): void;
/**
* Enable or disable Smart AI Agent
*/
setSmartAgentMode(enabled: boolean): void;
/**
* Get Smart AI Agent session statistics
*/
getSmartAgentStats(): import("./SmartAIAgent").TestSession | null;
/**
* ๐ Get execution statistics
*/
getExecutionStats(): Promise<ExecutionStats>;
/**
* ๐งน Clear smart detector cache
*/
clearCache(): void;
/**
* Get the current test site URL from context
*/
private getCurrentTestSite;
/**
* Convert test step to natural language task for Smart AI Agent
*/
private convertStepToTask;
}
//# sourceMappingURL=AITestExecutor.d.ts.map