@labnex/cli
Version:
CLI for Labnex, an AI-Powered Testing Automation Platform
30 lines • 1.53 kB
TypeScript
import { Page, Frame, ElementHandle } from 'puppeteer';
import { ApiResponse } from '../api/client';
export type AddLogFunction = (message: string, data?: any) => void;
export type RetryApiCallFunction = <T>(apiCall: () => Promise<ApiResponse<T>>, maxRetries: number, baseDelayMs: number, callDescription: string) => Promise<ApiResponse<T>>;
interface FindElementOptions {
timeout?: number;
waitForVisible?: boolean;
waitForClickable?: boolean;
retryWithAI?: boolean;
scrollIntoView?: boolean;
}
interface ElementContext {
selector: string;
descriptiveTerm: string;
originalStep: string;
previousAttempts?: string[];
index?: number;
}
export declare function findElementWithFallbacks(page: Page, currentFrame: Page | Frame, addLog: AddLogFunction, selectorOrText: string, descriptiveTerm: string, originalStep?: string, disableFallbacks?: boolean, retryApiCallFn?: RetryApiCallFunction, index?: number): Promise<ElementHandle | null>;
export declare function captureFocusedDomSnippet(page: Page, currentFrame: Page | Frame, failedSelector: string, addLog: AddLogFunction): Promise<string>;
export declare class ElementFinder {
private page;
private frame;
private addLog;
private retryApiCallFn?;
constructor(page: Page, frame: Page | Frame, addLog: AddLogFunction, retryApiCallFn?: RetryApiCallFunction);
findElement(context: ElementContext, options?: FindElementOptions): Promise<ElementHandle | null>;
}
export {};
//# sourceMappingURL=elementFinderV2.d.ts.map