@probolabs/playwright 1.0.11 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -98,9 +98,9 @@ interface RunStepParams extends Partial<PlaywrightTimeoutConfig> {
98
98
  timeout?: number;
99
99
  }
100
100
  declare class ProboPlaywright {
101
- private readonly config;
101
+ private readonly timeoutConfig;
102
102
  private page;
103
- constructor(config?: PlaywrightTimeoutConfig, page?: Page$1 | null);
103
+ constructor(timeoutConfig?: Partial<PlaywrightTimeoutConfig>, page?: Page$1 | null);
104
104
  /**
105
105
  * Sets the Playwright page instance for this ProboPlaywright instance.
106
106
  * Also applies the configured default navigation and action timeouts to the page.
@@ -140,6 +140,7 @@ declare class ProboPlaywright {
140
140
  * @param value - The text value to fill into the input field
141
141
  */
142
142
  private robustFill;
143
+ private robustTypeKeys;
143
144
  /**
144
145
  * Performs a robust click operation using multiple fallback strategies.
145
146
  * Attempts standard click first, then mouse click at center coordinates, and finally native DOM events.
@@ -296,13 +297,19 @@ declare class OTP {
296
297
  static fetchAllInboxMessages(limit?: number, sort?: 'ascending' | 'descending', full?: boolean): Promise<MailinatorMessage[]>;
297
298
  /**
298
299
  * Waits for an OTP to arrive in the inbox and extracts it
299
- * @param inbox - The inbox name to monitor (optional - if not provided, searches all inboxes)
300
- * @param timeout - Maximum time to wait in milliseconds (default: 30000)
301
- * @param checkInterval - How often to check in milliseconds (default: 1000)
302
- * @param checkRecentMessagesSinceMs - When > 0, check messages from the last X milliseconds and return the most recent OTP (default: 0)
300
+ * @param options - Configuration options for waiting for OTP
301
+ * @param options.inbox - The inbox name to monitor (optional - if not provided, searches all inboxes)
302
+ * @param options.timeout - Maximum time to wait in milliseconds (default: 30000)
303
+ * @param options.checkInterval - How often to check in milliseconds (default: 1000)
304
+ * @param options.checkRecentMessagesSinceMs - When > 0, check messages from the last X milliseconds and return the most recent OTP (default: 0)
303
305
  * @returns Promise<string | null> - The extracted OTP code or null if timeout/no OTP found
304
306
  */
305
- static waitForOTP(inbox?: string, timeout?: number, checkInterval?: number, checkRecentMessagesSinceMs?: number): Promise<string | null>;
307
+ static waitForOTP(options?: {
308
+ inbox?: string;
309
+ timeout?: number;
310
+ checkInterval?: number;
311
+ checkRecentMessagesSinceMs?: number;
312
+ }): Promise<string | null>;
306
313
  }
307
314
 
308
315
  /**
@@ -320,10 +327,13 @@ interface ProboConfig {
320
327
  timeoutConfig?: Partial<PlaywrightTimeoutConfig>;
321
328
  }
322
329
  interface RunStepOptions {
323
- useCache: boolean;
324
- stepIdFromServer?: number | null;
325
330
  aiModel?: AIModel;
326
331
  timeoutConfig?: PlaywrightTimeoutConfig;
332
+ stepId?: number;
333
+ }
334
+ interface AskAIOptions {
335
+ stepId?: number;
336
+ createStep?: boolean;
327
337
  }
328
338
  declare class Probo {
329
339
  private highlighter;
@@ -333,10 +343,9 @@ declare class Probo {
333
343
  private readonly aiModel;
334
344
  private readonly timeoutConfig;
335
345
  constructor({ scenarioName, token, apiUrl, enableConsoleLogs, logToConsole, logToFile, debugLevel, aiModel, timeoutConfig }: ProboConfig);
336
- askAI(page: Page, question: string): Promise<any>;
337
- runStep(page: Page, stepPrompt: string, argument?: string | boolean | null, options?: RunStepOptions): Promise<boolean | string | null>;
346
+ askAI(page: Page, question: string, options: AskAIOptions): Promise<any>;
347
+ runStep(page: Page, stepPrompt: string, argument?: string | boolean | null, options?: RunStepOptions): Promise<string | void>;
338
348
  private _handleCachedStep;
339
- private _handleStepCreation;
340
349
  private setupConsoleLogs;
341
350
  getInitialPageState(page: Page): Promise<InitialPageState>;
342
351
  findAndHighlightCandidateElements(page: Page, elementTags: string[]): Promise<FindCandidateInput>;
@@ -346,8 +355,8 @@ declare class Probo {
346
355
  waitForMutationsToSettle(page: Page, timeout?: number, initTimeout?: number): Promise<boolean>;
347
356
  screenshot(page: Page): Promise<string>;
348
357
  private _handlePerformAction;
349
- askAIHelper(page: Page, question: string): Promise<ServerResponse>;
358
+ askAIHelper(page: Page, question: string, options: AskAIOptions): Promise<ServerResponse>;
350
359
  }
351
360
 
352
361
  export { Highlighter, NavTracker, OTP, Probo, ProboPlaywright, findClosestVisibleElement };
353
- export type { ElementTagType, MailinatorMessage, RunStepOptions };
362
+ export type { AskAIOptions, ElementTagType, MailinatorMessage, RunStepOptions };