testdriverai 7.0.0 → 7.1.0
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/AGENTS.md +550 -0
- package/CODEOWNERS +0 -1
- package/README.md +126 -0
- package/agent/index.js +43 -18
- package/agent/lib/commands.js +794 -135
- package/agent/lib/redraw.js +124 -39
- package/agent/lib/sandbox.js +10 -1
- package/agent/lib/sdk.js +21 -0
- package/docs/MIGRATION.md +425 -0
- package/docs/PRESETS.md +210 -0
- package/docs/docs.json +91 -37
- package/docs/guide/best-practices-polling.mdx +154 -0
- package/docs/v7/api/dashcam.mdx +497 -0
- package/docs/v7/api/doubleClick.mdx +102 -0
- package/docs/v7/api/mouseDown.mdx +161 -0
- package/docs/v7/api/mouseUp.mdx +164 -0
- package/docs/v7/api/rightClick.mdx +123 -0
- package/docs/v7/getting-started/configuration.mdx +380 -0
- package/docs/v7/getting-started/quickstart.mdx +273 -140
- package/docs/v7/guides/best-practices.mdx +486 -0
- package/docs/v7/guides/caching-ai.mdx +215 -0
- package/docs/v7/guides/caching-selectors.mdx +292 -0
- package/docs/v7/guides/caching.mdx +366 -0
- package/docs/v7/guides/ci-cd/azure.mdx +587 -0
- package/docs/v7/guides/ci-cd/circleci.mdx +523 -0
- package/docs/v7/guides/ci-cd/github-actions.mdx +457 -0
- package/docs/v7/guides/ci-cd/gitlab.mdx +498 -0
- package/docs/v7/guides/ci-cd/jenkins.mdx +664 -0
- package/docs/v7/guides/ci-cd/travis.mdx +438 -0
- package/docs/v7/guides/debugging.mdx +349 -0
- package/docs/v7/guides/faq.mdx +393 -0
- package/docs/v7/guides/performance.mdx +517 -0
- package/docs/v7/guides/troubleshooting.mdx +526 -0
- package/docs/v7/guides/vitest-plugin.mdx +477 -0
- package/docs/v7/guides/vitest.mdx +535 -0
- package/docs/v7/platforms/linux.mdx +308 -0
- package/docs/v7/platforms/macos.mdx +433 -0
- package/docs/v7/platforms/windows.mdx +430 -0
- package/docs/v7/presets/chrome-extension.mdx +223 -0
- package/docs/v7/presets/chrome.mdx +287 -0
- package/docs/v7/presets/electron.mdx +435 -0
- package/docs/v7/presets/vscode.mdx +398 -0
- package/docs/v7/presets/webapp.mdx +396 -0
- package/docs/v7/progressive-apis/CORE.md +459 -0
- package/docs/v7/progressive-apis/HOOKS.md +360 -0
- package/docs/v7/progressive-apis/PROGRESSIVE_DISCLOSURE.md +230 -0
- package/docs/v7/progressive-apis/PROVISION.md +266 -0
- package/interfaces/vitest-plugin.mjs +186 -100
- package/package.json +12 -1
- package/sdk.d.ts +335 -42
- package/sdk.js +756 -95
- package/src/core/Dashcam.js +469 -0
- package/src/core/index.d.ts +150 -0
- package/src/core/index.js +12 -0
- package/src/presets/index.mjs +331 -0
- package/src/vitest/extended.mjs +108 -0
- package/src/vitest/hooks.d.ts +119 -0
- package/src/vitest/hooks.mjs +298 -0
- package/src/vitest/index.mjs +64 -0
- package/src/vitest/lifecycle.mjs +277 -0
- package/src/vitest/utils.mjs +150 -0
- package/test/dashcam.test.js +137 -0
- package/testdriver/acceptance-sdk/assert.test.mjs +13 -31
- package/testdriver/acceptance-sdk/auto-cache-key-demo.test.mjs +56 -0
- package/testdriver/acceptance-sdk/chrome-extension.test.mjs +89 -0
- package/testdriver/acceptance-sdk/drag-and-drop.test.mjs +7 -19
- package/testdriver/acceptance-sdk/element-not-found.test.mjs +6 -19
- package/testdriver/acceptance-sdk/exec-js.test.mjs +6 -18
- package/testdriver/acceptance-sdk/exec-output.test.mjs +8 -20
- package/testdriver/acceptance-sdk/exec-pwsh.test.mjs +13 -25
- package/testdriver/acceptance-sdk/focus-window.test.mjs +8 -20
- package/testdriver/acceptance-sdk/formatted-logging.test.mjs +5 -20
- package/testdriver/acceptance-sdk/hooks-example.test.mjs +38 -0
- package/testdriver/acceptance-sdk/hover-image.test.mjs +10 -19
- package/testdriver/acceptance-sdk/hover-text-with-description.test.mjs +7 -19
- package/testdriver/acceptance-sdk/hover-text.test.mjs +5 -19
- package/testdriver/acceptance-sdk/match-image.test.mjs +7 -19
- package/testdriver/acceptance-sdk/presets-example.test.mjs +87 -0
- package/testdriver/acceptance-sdk/press-keys.test.mjs +5 -19
- package/testdriver/acceptance-sdk/prompt.test.mjs +6 -18
- package/testdriver/acceptance-sdk/scroll-keyboard.test.mjs +6 -20
- package/testdriver/acceptance-sdk/scroll-until-image.test.mjs +6 -18
- package/testdriver/acceptance-sdk/scroll-until-text.test.mjs +9 -23
- package/testdriver/acceptance-sdk/scroll.test.mjs +12 -21
- package/testdriver/acceptance-sdk/setup/testHelpers.mjs +124 -352
- package/testdriver/acceptance-sdk/sully-ai.test.mjs +234 -0
- package/testdriver/acceptance-sdk/test-console-logs.test.mjs +42 -0
- package/testdriver/acceptance-sdk/type.test.mjs +19 -58
- package/vitest.config.mjs +1 -0
- package/.vscode/mcp.json +0 -9
- package/MIGRATION.md +0 -389
- package/PLUGIN_MIGRATION.md +0 -222
- package/PROMPT_CACHE.md +0 -200
- package/SDK_LOGGING.md +0 -222
- package/SDK_MIGRATION.md +0 -474
- package/SDK_README.md +0 -1122
- package/debug-screenshot-1763401388589.png +0 -0
- package/examples/run-tests-with-recording.sh +0 -70
- package/examples/screenshot-example.js +0 -63
- package/examples/sdk-awesome-logs-demo.js +0 -177
- package/examples/sdk-cache-thresholds.js +0 -96
- package/examples/sdk-element-properties.js +0 -155
- package/examples/sdk-simple-example.js +0 -65
- package/examples/test-recording-example.test.js +0 -166
- package/mcp-server/AI_GUIDELINES.md +0 -57
- package/test-find-api.js +0 -73
- package/test-prompt-cache.js +0 -96
- package/test-sandbox-render.js +0 -28
- package/test-sdk-methods.js +0 -15
- package/test-sdk-refactor.js +0 -53
- package/test-stack-trace.mjs +0 -57
- package/testdriver/acceptance-sdk/setup/lifecycleHelpers.mjs +0 -239
package/sdk.d.ts
CHANGED
|
@@ -287,6 +287,248 @@ export interface HoverResult {
|
|
|
287
287
|
[key: string]: any;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
+
// ====================================
|
|
291
|
+
// Command Options Interfaces
|
|
292
|
+
// ====================================
|
|
293
|
+
|
|
294
|
+
/** Options for scroll command */
|
|
295
|
+
export interface ScrollOptions {
|
|
296
|
+
/** Direction to scroll */
|
|
297
|
+
direction?: ScrollDirection;
|
|
298
|
+
/** Amount to scroll in pixels */
|
|
299
|
+
amount?: number;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** Options for click command */
|
|
303
|
+
export interface ClickOptions {
|
|
304
|
+
/** X coordinate */
|
|
305
|
+
x: number;
|
|
306
|
+
/** Y coordinate */
|
|
307
|
+
y: number;
|
|
308
|
+
/** Type of click action */
|
|
309
|
+
action?: ClickAction;
|
|
310
|
+
/** Prompt for tracking */
|
|
311
|
+
prompt?: string;
|
|
312
|
+
/** Whether cache was hit */
|
|
313
|
+
cacheHit?: boolean;
|
|
314
|
+
/** Selector used */
|
|
315
|
+
selector?: string;
|
|
316
|
+
/** Whether selector was used */
|
|
317
|
+
selectorUsed?: boolean;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/** Options for hover command */
|
|
321
|
+
export interface HoverOptions {
|
|
322
|
+
/** X coordinate */
|
|
323
|
+
x: number;
|
|
324
|
+
/** Y coordinate */
|
|
325
|
+
y: number;
|
|
326
|
+
/** Prompt for tracking */
|
|
327
|
+
prompt?: string;
|
|
328
|
+
/** Whether cache was hit */
|
|
329
|
+
cacheHit?: boolean;
|
|
330
|
+
/** Selector used */
|
|
331
|
+
selector?: string;
|
|
332
|
+
/** Whether selector was used */
|
|
333
|
+
selectorUsed?: boolean;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/** Options for hoverText command */
|
|
337
|
+
export interface HoverTextOptions {
|
|
338
|
+
/** Text to find and hover over */
|
|
339
|
+
text: string;
|
|
340
|
+
/** Optional description of the element */
|
|
341
|
+
description?: string | null;
|
|
342
|
+
/** Action to perform */
|
|
343
|
+
action?: ClickAction;
|
|
344
|
+
/** Timeout in milliseconds */
|
|
345
|
+
timeout?: number;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** Options for hoverImage command */
|
|
349
|
+
export interface HoverImageOptions {
|
|
350
|
+
/** Description of the image to find */
|
|
351
|
+
description: string;
|
|
352
|
+
/** Action to perform */
|
|
353
|
+
action?: ClickAction;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/** Options for matchImage command */
|
|
357
|
+
export interface MatchImageOptions {
|
|
358
|
+
/** Path to the image template */
|
|
359
|
+
path: string;
|
|
360
|
+
/** Action to perform */
|
|
361
|
+
action?: ClickAction;
|
|
362
|
+
/** Invert the match */
|
|
363
|
+
invert?: boolean;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/** Options for type command */
|
|
367
|
+
export interface TypeOptions {
|
|
368
|
+
/** Text to type */
|
|
369
|
+
text: string | number;
|
|
370
|
+
/** Delay between keystrokes in milliseconds */
|
|
371
|
+
delay?: number;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/** Options for pressKeys command */
|
|
375
|
+
export interface PressKeysOptions {
|
|
376
|
+
/** Array of keys to press */
|
|
377
|
+
keys: KeyboardKey[];
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** Options for wait command */
|
|
381
|
+
export interface WaitOptions {
|
|
382
|
+
/** Time to wait in milliseconds */
|
|
383
|
+
timeout?: number;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** Options for waitForText command */
|
|
387
|
+
export interface WaitForTextOptions {
|
|
388
|
+
/** Text to wait for */
|
|
389
|
+
text: string;
|
|
390
|
+
/** Timeout in milliseconds */
|
|
391
|
+
timeout?: number;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/** Options for waitForImage command */
|
|
395
|
+
export interface WaitForImageOptions {
|
|
396
|
+
/** Description of the image */
|
|
397
|
+
description: string;
|
|
398
|
+
/** Timeout in milliseconds */
|
|
399
|
+
timeout?: number;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/** Options for scrollUntilText command */
|
|
403
|
+
export interface ScrollUntilTextOptions {
|
|
404
|
+
/** Text to find */
|
|
405
|
+
text: string;
|
|
406
|
+
/** Scroll direction */
|
|
407
|
+
direction?: ScrollDirection;
|
|
408
|
+
/** Maximum distance to scroll in pixels */
|
|
409
|
+
maxDistance?: number;
|
|
410
|
+
/** Invert the match */
|
|
411
|
+
invert?: boolean;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/** Options for scrollUntilImage command */
|
|
415
|
+
export interface ScrollUntilImageOptions {
|
|
416
|
+
/** Description of the image */
|
|
417
|
+
description?: string;
|
|
418
|
+
/** Scroll direction */
|
|
419
|
+
direction?: ScrollDirection;
|
|
420
|
+
/** Maximum distance to scroll in pixels */
|
|
421
|
+
maxDistance?: number;
|
|
422
|
+
/** Scroll method */
|
|
423
|
+
method?: ScrollMethod;
|
|
424
|
+
/** Path to image template */
|
|
425
|
+
path?: string;
|
|
426
|
+
/** Invert the match */
|
|
427
|
+
invert?: boolean;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/** Options for focusApplication command */
|
|
431
|
+
export interface FocusApplicationOptions {
|
|
432
|
+
/** Application name */
|
|
433
|
+
name: string;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/** Options for remember command */
|
|
437
|
+
export interface RememberOptions {
|
|
438
|
+
/** What to remember */
|
|
439
|
+
description: string;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/** Options for assert command */
|
|
443
|
+
export interface AssertOptions {
|
|
444
|
+
/** Assertion to check */
|
|
445
|
+
assertion: string;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/** Options for exec command */
|
|
449
|
+
export interface ExecOptions {
|
|
450
|
+
/** Language ('js', 'pwsh', or 'sh') */
|
|
451
|
+
language?: ExecLanguage;
|
|
452
|
+
/** Code to execute */
|
|
453
|
+
code: string;
|
|
454
|
+
/** Timeout in milliseconds */
|
|
455
|
+
timeout?: number;
|
|
456
|
+
/** Suppress output */
|
|
457
|
+
silent?: boolean;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* A Promise that resolves to an Element but also has chainable element methods.
|
|
462
|
+
* This enables syntax like: await testdriver.find("button").click()
|
|
463
|
+
*/
|
|
464
|
+
export interface ChainableElementPromise extends Promise<Element> {
|
|
465
|
+
/**
|
|
466
|
+
* Click on the element (chainable)
|
|
467
|
+
* @param action - Type of click action (default: 'click')
|
|
468
|
+
*/
|
|
469
|
+
click(action?: ClickAction): Promise<void>;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Hover over the element (chainable)
|
|
473
|
+
*/
|
|
474
|
+
hover(): Promise<void>;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Double-click on the element (chainable)
|
|
478
|
+
*/
|
|
479
|
+
doubleClick(): Promise<void>;
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Right-click on the element (chainable)
|
|
483
|
+
*/
|
|
484
|
+
rightClick(): Promise<void>;
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Press mouse button down on this element (chainable)
|
|
488
|
+
*/
|
|
489
|
+
mouseDown(): Promise<void>;
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Release mouse button on this element (chainable)
|
|
493
|
+
*/
|
|
494
|
+
mouseUp(): Promise<void>;
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Check if element was found (chainable)
|
|
498
|
+
*/
|
|
499
|
+
found(): Promise<boolean>;
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Get the coordinates of the element (chainable)
|
|
503
|
+
*/
|
|
504
|
+
getCoordinates(): Promise<ElementCoordinates | null>;
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Get the full API response data (chainable)
|
|
508
|
+
*/
|
|
509
|
+
getResponse(): Promise<ElementResponse | null>;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Get the x coordinate (chainable)
|
|
513
|
+
*/
|
|
514
|
+
readonly x: Promise<number | null>;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Get the y coordinate (chainable)
|
|
518
|
+
*/
|
|
519
|
+
readonly y: Promise<number | null>;
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Get the center x coordinate (chainable)
|
|
523
|
+
*/
|
|
524
|
+
readonly centerX: Promise<number | null>;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Get the center y coordinate (chainable)
|
|
528
|
+
*/
|
|
529
|
+
readonly centerY: Promise<number | null>;
|
|
530
|
+
}
|
|
531
|
+
|
|
290
532
|
/**
|
|
291
533
|
* Element class representing a located or to-be-located element on screen
|
|
292
534
|
*/
|
|
@@ -428,10 +670,14 @@ export default class TestDriverSDK {
|
|
|
428
670
|
*
|
|
429
671
|
* @param description - Description of the element to find
|
|
430
672
|
* @param cacheThreshold - Cache threshold for this specific find (overrides global setting)
|
|
431
|
-
* @returns
|
|
673
|
+
* @returns Chainable promise that resolves to Element instance
|
|
674
|
+
*
|
|
675
|
+
* @example
|
|
676
|
+
* // Find and click immediately (chainable)
|
|
677
|
+
* await client.find('the sign in button').click();
|
|
432
678
|
*
|
|
433
679
|
* @example
|
|
434
|
-
* // Find and click
|
|
680
|
+
* // Find and click (traditional)
|
|
435
681
|
* const element = await client.find('the sign in button');
|
|
436
682
|
* await element.click();
|
|
437
683
|
*
|
|
@@ -450,7 +696,7 @@ export default class TestDriverSDK {
|
|
|
450
696
|
* }
|
|
451
697
|
* await element.click();
|
|
452
698
|
*/
|
|
453
|
-
find(description: string, cacheThreshold?: number):
|
|
699
|
+
find(description: string, cacheThreshold?: number): ChainableElementPromise;
|
|
454
700
|
|
|
455
701
|
/**
|
|
456
702
|
* Find all elements matching a description
|
|
@@ -473,57 +719,73 @@ export default class TestDriverSDK {
|
|
|
473
719
|
/**
|
|
474
720
|
* Hover over text on screen
|
|
475
721
|
* @deprecated Use find() and element.click() instead
|
|
722
|
+
* @param options - Options object with text, description, action, and timeout
|
|
723
|
+
*/
|
|
724
|
+
hoverText(options: HoverTextOptions): Promise<HoverResult>;
|
|
725
|
+
/**
|
|
726
|
+
* Hover over text on screen (positional arguments - legacy)
|
|
727
|
+
* @deprecated Use find() and element.click() instead
|
|
476
728
|
* @param text - Text to find and hover over
|
|
477
729
|
* @param description - Optional description of the element
|
|
478
730
|
* @param action - Action to perform (default: 'click')
|
|
479
|
-
* @param method - Text matching method (default: 'turbo')
|
|
480
731
|
* @param timeout - Timeout in milliseconds (default: 5000)
|
|
481
732
|
*/
|
|
482
733
|
hoverText(
|
|
483
734
|
text: string,
|
|
484
735
|
description?: string | null,
|
|
485
736
|
action?: ClickAction,
|
|
486
|
-
method?: TextMatchMethod,
|
|
487
737
|
timeout?: number,
|
|
488
738
|
): Promise<HoverResult>;
|
|
489
739
|
|
|
490
740
|
/**
|
|
491
741
|
* Type text
|
|
492
742
|
* @param text - Text to type
|
|
493
|
-
* @param
|
|
743
|
+
* @param options - Options object with delay and secret
|
|
744
|
+
*
|
|
745
|
+
* @example
|
|
746
|
+
* // Type regular text
|
|
747
|
+
* await client.type('hello world');
|
|
748
|
+
*
|
|
749
|
+
* @example
|
|
750
|
+
* // Type a password securely (not logged or stored)
|
|
751
|
+
* await client.type(process.env.TD_PASSWORD, { secret: true });
|
|
752
|
+
*
|
|
753
|
+
* @example
|
|
754
|
+
* // Type with custom delay
|
|
755
|
+
* await client.type('slow typing', { delay: 100 });
|
|
494
756
|
*/
|
|
495
|
-
type(text: string | number, delay?: number): Promise<void>;
|
|
757
|
+
type(text: string | number, options?: { delay?: number; secret?: boolean }): Promise<void>;
|
|
496
758
|
|
|
497
759
|
/**
|
|
498
760
|
* Wait for text to appear on screen
|
|
499
761
|
* @deprecated Use find() in a polling loop instead
|
|
762
|
+
* @param options - Options object with text and timeout
|
|
763
|
+
*/
|
|
764
|
+
waitForText(options: WaitForTextOptions): Promise<void>;
|
|
765
|
+
/**
|
|
766
|
+
* Wait for text to appear on screen (positional arguments - legacy)
|
|
767
|
+
* @deprecated Use find() in a polling loop instead
|
|
500
768
|
* @param text - Text to wait for
|
|
501
769
|
* @param timeout - Timeout in milliseconds (default: 5000)
|
|
502
|
-
* @param method - Text matching method (default: 'turbo')
|
|
503
|
-
* @param invert - Invert the match (wait for text to disappear) (default: false)
|
|
504
770
|
*/
|
|
505
|
-
waitForText(
|
|
506
|
-
text: string,
|
|
507
|
-
timeout?: number,
|
|
508
|
-
method?: TextMatchMethod,
|
|
509
|
-
invert?: boolean,
|
|
510
|
-
): Promise<void>;
|
|
771
|
+
waitForText(text: string, timeout?: number): Promise<void>;
|
|
511
772
|
|
|
512
773
|
/**
|
|
513
774
|
* Scroll until text is found
|
|
775
|
+
* @param options - Options object with text, direction, maxDistance, and invert
|
|
776
|
+
*/
|
|
777
|
+
scrollUntilText(options: ScrollUntilTextOptions): Promise<void>;
|
|
778
|
+
/**
|
|
779
|
+
* Scroll until text is found (positional arguments - legacy)
|
|
514
780
|
* @param text - Text to find
|
|
515
781
|
* @param direction - Scroll direction (default: 'down')
|
|
516
782
|
* @param maxDistance - Maximum distance to scroll in pixels (default: 10000)
|
|
517
|
-
* @param textMatchMethod - Text matching method (default: 'turbo')
|
|
518
|
-
* @param method - Scroll method (default: 'keyboard')
|
|
519
783
|
* @param invert - Invert the match (default: false)
|
|
520
784
|
*/
|
|
521
785
|
scrollUntilText(
|
|
522
786
|
text: string,
|
|
523
787
|
direction?: ScrollDirection,
|
|
524
788
|
maxDistance?: number,
|
|
525
|
-
textMatchMethod?: TextMatchMethod,
|
|
526
|
-
method?: ScrollMethod,
|
|
527
789
|
invert?: boolean,
|
|
528
790
|
): Promise<void>;
|
|
529
791
|
|
|
@@ -532,6 +794,12 @@ export default class TestDriverSDK {
|
|
|
532
794
|
/**
|
|
533
795
|
* Hover over an image on screen
|
|
534
796
|
* @deprecated Use find() and element.click() instead
|
|
797
|
+
* @param options - Options object with description and action
|
|
798
|
+
*/
|
|
799
|
+
hoverImage(options: HoverImageOptions): Promise<HoverResult>;
|
|
800
|
+
/**
|
|
801
|
+
* Hover over an image on screen (positional arguments - legacy)
|
|
802
|
+
* @deprecated Use find() and element.click() instead
|
|
535
803
|
* @param description - Description of the image to find
|
|
536
804
|
* @param action - Action to perform (default: 'click')
|
|
537
805
|
*/
|
|
@@ -539,6 +807,11 @@ export default class TestDriverSDK {
|
|
|
539
807
|
|
|
540
808
|
/**
|
|
541
809
|
* Match and interact with an image template
|
|
810
|
+
* @param options - Options object with path, action, and invert
|
|
811
|
+
*/
|
|
812
|
+
matchImage(options: MatchImageOptions): Promise<boolean>;
|
|
813
|
+
/**
|
|
814
|
+
* Match and interact with an image template (positional arguments - legacy)
|
|
542
815
|
* @param imagePath - Path to the image template
|
|
543
816
|
* @param action - Action to perform (default: 'click')
|
|
544
817
|
* @param invert - Invert the match (default: false)
|
|
@@ -552,18 +825,24 @@ export default class TestDriverSDK {
|
|
|
552
825
|
/**
|
|
553
826
|
* Wait for image to appear on screen
|
|
554
827
|
* @deprecated Use find() in a polling loop instead
|
|
828
|
+
* @param options - Options object with description and timeout
|
|
829
|
+
*/
|
|
830
|
+
waitForImage(options: WaitForImageOptions): Promise<void>;
|
|
831
|
+
/**
|
|
832
|
+
* Wait for image to appear on screen (positional arguments - legacy)
|
|
833
|
+
* @deprecated Use find() in a polling loop instead
|
|
555
834
|
* @param description - Description of the image
|
|
556
835
|
* @param timeout - Timeout in milliseconds (default: 10000)
|
|
557
|
-
* @param invert - Invert the match (wait for image to disappear) (default: false)
|
|
558
836
|
*/
|
|
559
|
-
waitForImage(
|
|
560
|
-
description: string,
|
|
561
|
-
timeout?: number,
|
|
562
|
-
invert?: boolean,
|
|
563
|
-
): Promise<void>;
|
|
837
|
+
waitForImage(description: string, timeout?: number): Promise<void>;
|
|
564
838
|
|
|
565
839
|
/**
|
|
566
840
|
* Scroll until image is found
|
|
841
|
+
* @param options - Options object with description, direction, maxDistance, method, path, and invert
|
|
842
|
+
*/
|
|
843
|
+
scrollUntilImage(options: ScrollUntilImageOptions): Promise<void>;
|
|
844
|
+
/**
|
|
845
|
+
* Scroll until image is found (positional arguments - legacy)
|
|
567
846
|
* @param description - Description of the image (or use path parameter)
|
|
568
847
|
* @param direction - Scroll direction (default: 'down')
|
|
569
848
|
* @param maxDistance - Maximum distance to scroll in pixels (default: 10000)
|
|
@@ -584,6 +863,11 @@ export default class TestDriverSDK {
|
|
|
584
863
|
|
|
585
864
|
/**
|
|
586
865
|
* Click at coordinates
|
|
866
|
+
* @param options - Options object with x, y, and action
|
|
867
|
+
*/
|
|
868
|
+
click(options: ClickOptions): Promise<void>;
|
|
869
|
+
/**
|
|
870
|
+
* Click at coordinates (positional arguments - legacy)
|
|
587
871
|
* @param x - X coordinate
|
|
588
872
|
* @param y - Y coordinate
|
|
589
873
|
* @param action - Type of click action (default: 'click')
|
|
@@ -592,6 +876,11 @@ export default class TestDriverSDK {
|
|
|
592
876
|
|
|
593
877
|
/**
|
|
594
878
|
* Hover at coordinates
|
|
879
|
+
* @param options - Options object with x and y
|
|
880
|
+
*/
|
|
881
|
+
hover(options: HoverOptions): Promise<void>;
|
|
882
|
+
/**
|
|
883
|
+
* Hover at coordinates (positional arguments - legacy)
|
|
595
884
|
* @param x - X coordinate
|
|
596
885
|
* @param y - Y coordinate
|
|
597
886
|
*/
|
|
@@ -600,45 +889,42 @@ export default class TestDriverSDK {
|
|
|
600
889
|
/**
|
|
601
890
|
* Press keyboard keys
|
|
602
891
|
* @param keys - Array of keys to press
|
|
892
|
+
* @param options - Additional options (reserved for future use)
|
|
603
893
|
*/
|
|
604
|
-
pressKeys(keys: KeyboardKey[]): Promise<void>;
|
|
894
|
+
pressKeys(keys: KeyboardKey[], options?: object): Promise<void>;
|
|
605
895
|
|
|
606
896
|
/**
|
|
607
897
|
* Scroll the page
|
|
608
898
|
* @param direction - Direction to scroll (default: 'down')
|
|
609
|
-
* @param
|
|
610
|
-
* @param method - Scroll method (default: 'mouse')
|
|
899
|
+
* @param options - Options object with amount
|
|
611
900
|
*/
|
|
612
|
-
scroll(
|
|
613
|
-
direction?: ScrollDirection,
|
|
614
|
-
amount?: number,
|
|
615
|
-
method?: ScrollMethod,
|
|
616
|
-
): Promise<void>;
|
|
901
|
+
scroll(direction?: ScrollDirection, options?: { amount?: number }): Promise<void>;
|
|
617
902
|
|
|
618
903
|
// Application Control
|
|
619
904
|
|
|
620
905
|
/**
|
|
621
906
|
* Focus an application by name
|
|
622
907
|
* @param name - Application name
|
|
908
|
+
* @param options - Additional options (reserved for future use)
|
|
623
909
|
*/
|
|
624
|
-
focusApplication(name: string): Promise<string>;
|
|
910
|
+
focusApplication(name: string, options?: object): Promise<string>;
|
|
625
911
|
|
|
626
912
|
// AI-Powered Methods
|
|
627
913
|
|
|
628
914
|
/**
|
|
629
915
|
* Make an AI-powered assertion
|
|
630
916
|
* @param assertion - Assertion to check
|
|
631
|
-
* @param
|
|
632
|
-
* @param invert - Invert the assertion (default: false)
|
|
917
|
+
* @param options - Additional options (reserved for future use)
|
|
633
918
|
*/
|
|
634
|
-
assert(
|
|
635
|
-
assertion: string,
|
|
636
|
-
async?: boolean,
|
|
637
|
-
invert?: boolean,
|
|
638
|
-
): Promise<boolean>;
|
|
919
|
+
assert(assertion: string, options?: object): Promise<boolean>;
|
|
639
920
|
|
|
640
921
|
/**
|
|
641
922
|
* Extract and remember information from the screen using AI
|
|
923
|
+
* @param options - Options object with description
|
|
924
|
+
*/
|
|
925
|
+
remember(options: RememberOptions): Promise<string>;
|
|
926
|
+
/**
|
|
927
|
+
* Extract and remember information from the screen using AI (positional arguments - legacy)
|
|
642
928
|
* @param description - What to remember
|
|
643
929
|
*/
|
|
644
930
|
remember(description: string): Promise<string>;
|
|
@@ -647,6 +933,11 @@ export default class TestDriverSDK {
|
|
|
647
933
|
|
|
648
934
|
/**
|
|
649
935
|
* Execute code in the sandbox
|
|
936
|
+
* @param options - Options object with language, code, timeout, and silent
|
|
937
|
+
*/
|
|
938
|
+
exec(options: ExecOptions): Promise<string>;
|
|
939
|
+
/**
|
|
940
|
+
* Execute code in the sandbox (positional arguments - legacy)
|
|
650
941
|
* @param language - Language ('js' or 'pwsh')
|
|
651
942
|
* @param code - Code to execute
|
|
652
943
|
* @param timeout - Timeout in milliseconds
|
|
@@ -686,8 +977,10 @@ export default class TestDriverSDK {
|
|
|
686
977
|
/**
|
|
687
978
|
* Wait for specified time
|
|
688
979
|
* @deprecated Consider using element polling with find() instead of arbitrary waits
|
|
980
|
+
* @param timeout - Time to wait in milliseconds (default: 3000)
|
|
981
|
+
* @param options - Additional options (reserved for future use)
|
|
689
982
|
*/
|
|
690
|
-
wait(timeout?: number): Promise<void>;
|
|
983
|
+
wait(timeout?: number, options?: object): Promise<void>;
|
|
691
984
|
|
|
692
985
|
/**
|
|
693
986
|
* Get the current sandbox instance details
|