playwright-advanced-ml-healer
Version:
Advanced AI-powered self-healing selectors for Playwright with 19+ healing types, neural networks, machine learning models, and Global DOM Learning ML Model
198 lines • 5.61 kB
TypeScript
/**
* HealingPage for Advanced ML Self-Healing
*
* A simplified interface for using Advanced ML Healing functionality
* similar to the original HealingPage but with advanced ML capabilities.
*/
import { Page } from 'playwright';
import { AdvancedMLHealing } from './advanced-ml-healing';
import { HealingAction, HealingOptions } from './types';
export declare class AdvancedHealingPage {
private advancedML;
private page;
private options;
constructor(page: Page, options?: HealingOptions);
/**
* Heal and click an element using Advanced ML
*/
click(selector: string, options?: HealingAction['options']): Promise<void>;
/**
* Heal and fill an element using Advanced ML
*/
fill(selector: string, value: string, options?: HealingAction['options']): Promise<void>;
/**
* Heal and type into an element using Advanced ML
*/
type(selector: string, value: string, options?: HealingAction['options']): Promise<void>;
/**
* Heal and select an option using Advanced ML
*/
selectOption(selector: string, value: string | string[], options?: HealingAction['options']): Promise<void>;
/**
* Heal and hover over an element using Advanced ML
*/
hover(selector: string, options?: HealingAction['options']): Promise<void>;
/**
* Heal and focus an element using Advanced ML
*/
focus(selector: string, options?: HealingAction['options']): Promise<void>;
/**
* Heal and scroll to an element using Advanced ML
*/
scrollTo(selector: string, options?: HealingAction['options']): Promise<void>;
/**
* Get healed selector without executing action
*/
getHealedSelector(selector: string): Promise<string | null>;
/**
* Check if element exists using Advanced ML healing
*/
isVisible(selector: string): Promise<boolean>;
/**
* Wait for element using Advanced ML healing
*/
waitForSelector(selector: string, options?: {
timeout?: number;
state?: 'attached' | 'detached' | 'visible' | 'hidden';
}): Promise<void>;
/**
* Get element text using Advanced ML healing
*/
getText(selector: string): Promise<string>;
/**
* Get element attribute using Advanced ML healing
*/
getAttribute(selector: string, attribute: string): Promise<string | null>;
/**
* Get multiple elements using Advanced ML healing
*/
getElements(selector: string): Promise<any[]>;
/**
* Get element count using Advanced ML healing
*/
getElementCount(selector: string): Promise<number>;
/**
* Execute custom action with healed selector
*/
executeAction(selector: string, action: (healedSelector: string) => Promise<any>): Promise<any>;
/**
* Get healing statistics
*/
getHealingStats(): {
total: number;
successful: number;
successRate: number;
averageResponseTime: number;
};
/**
* Get advanced analytics
*/
getAdvancedAnalytics(): any;
/**
* Generate analytics report
*/
generateAnalyticsReport(): string;
/**
* Get caching statistics
*/
getCachingStats(): {
size: number;
hitRate: number;
avgAccessCount: number;
};
/**
* Clear cache
*/
clearCache(): void;
/**
* Get adaptive learning statistics
*/
getAdaptiveLearningStats(): {
successPatterns: number;
failurePatterns: number;
performanceMetrics: {
averageResponseTime: number;
successRate: number;
confidenceThreshold: number;
learningRate: number;
};
optimizationStrategies: {
name: string;
description: string;
successRate: number;
implementation: string;
}[];
};
/**
* Get comprehensive statistics
*/
getComprehensiveStats(): any;
/**
* Generate comprehensive report
*/
generateComprehensiveReport(): string;
/**
* Optimize performance
*/
optimizePerformance(): void;
/**
* Debug healing process
*/
debugHealingProcess(selector: string, context?: any): any;
/**
* Export learning data
*/
exportLearningData(): any;
/**
* Import learning data
*/
importLearningData(data: any): void;
/**
* Train all models
*/
trainAllModels(trainingData: Array<{
features: number[];
label: number;
}>): void;
/**
* Predict with ensemble
*/
predictWithEnsemble(features: number[]): {
prediction: number;
confidence: number;
method: string;
};
/**
* Analyze element comprehensively
*/
analyzeElementComprehensive(element: any, selector: string): any;
/**
* Update real-time learning
*/
updateRealTimeLearning(features: number[], prediction: number, actual: number): void;
/**
* Optimize performance comprehensively
*/
optimizePerformanceComprehensive(): void;
/**
* Core healing and execution method
*/
private healAndExecute;
/**
* Get the underlying AdvancedMLHealing instance
*/
getAdvancedML(): AdvancedMLHealing;
/**
* Get the underlying Playwright Page instance
*/
getPage(): Page;
/**
* Get current options
*/
getOptions(): HealingOptions;
/**
* Update options
*/
updateOptions(newOptions: Partial<HealingOptions>): void;
}
//# sourceMappingURL=healing-page.d.ts.map