testdriverai 7.2.3 → 7.2.10
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/.github/workflows/publish.yaml +15 -7
- package/.github/workflows/testdriver.yml +163 -0
- package/.testdriver/last-sandbox +7 -0
- package/agent/events.js +1 -0
- package/agent/index.js +99 -163
- package/agent/lib/sandbox.js +11 -1
- package/agents.md +393 -0
- package/bin/testdriverai.js +8 -0
- package/debug/01-table-initial.png +0 -0
- package/debug/02-after-ai-explore.png +0 -0
- package/debug/02-after-scroll.png +0 -0
- package/debugger/index.html +37 -0
- package/docs/docs.json +93 -125
- package/docs/v7/_drafts/architecture.mdx +1 -26
- package/docs/v7/_drafts/caching.mdx +2 -2
- package/docs/v7/{getting-started → _drafts}/installation.mdx +0 -66
- package/docs/v7/{features/coverage.mdx → _drafts/powerful.mdx} +1 -90
- package/docs/v7/_drafts/quick-start-test-recording.mdx +0 -1
- package/docs/v7/{features → _drafts}/scalable.mdx +126 -4
- package/docs/v7/_drafts/screenshot.mdx +155 -0
- package/docs/v7/_drafts/test-recording.mdx +0 -6
- package/docs/v7/_drafts/writing-tests.mdx +25 -0
- package/docs/v7/{api/act.mdx → ai.mdx} +28 -27
- package/docs/v7/{api/assert.mdx → assert.mdx} +3 -3
- package/docs/v7/aws-setup.mdx +338 -0
- package/docs/v7/caching.mdx +128 -0
- package/docs/v7/ci-cd.mdx +605 -0
- package/docs/v7/{api/click.mdx → click.mdx} +4 -4
- package/docs/v7/cloud.mdx +120 -0
- package/docs/v7/customizing-devices.mdx +129 -0
- package/docs/v7/{api/doubleClick.mdx → double-click.mdx} +5 -5
- package/docs/v7/enterprise.mdx +135 -0
- package/docs/v7/examples.mdx +5 -0
- package/docs/v7/{api/exec.mdx → exec.mdx} +3 -3
- package/docs/v7/{api/find.mdx → find.mdx} +17 -21
- package/docs/v7/{api/focusApplication.mdx → focus-application.mdx} +3 -3
- package/docs/v7/generating-tests.mdx +32 -0
- package/docs/v7/{api/hover.mdx → hover.mdx} +3 -3
- package/docs/v7/locating-elements.mdx +71 -0
- package/docs/v7/making-assertions.mdx +32 -0
- package/docs/v7/{api/mouseDown.mdx → mouse-down.mdx} +7 -7
- package/docs/v7/{api/mouseUp.mdx → mouse-up.mdx} +8 -8
- package/docs/v7/performing-actions.mdx +51 -0
- package/docs/v7/{api/pressKeys.mdx → press-keys.mdx} +3 -3
- package/docs/v7/quickstart.mdx +162 -0
- package/docs/v7/reusable-code.mdx +240 -0
- package/docs/v7/{api/rightClick.mdx → right-click.mdx} +5 -5
- package/docs/v7/running-tests.mdx +181 -0
- package/docs/v7/{api/scroll.mdx → scroll.mdx} +3 -3
- package/docs/v7/secrets.mdx +115 -0
- package/docs/v7/self-hosted.mdx +66 -0
- package/docs/v7/{api/type.mdx → type.mdx} +3 -3
- package/docs/v7/variables.mdx +111 -0
- package/docs/v7/waiting-for-elements.mdx +66 -0
- package/docs/v7/what-is-testdriver.mdx +54 -0
- package/interfaces/cli/commands/init.js +33 -19
- package/interfaces/cli/lib/base.js +24 -0
- package/interfaces/cli.js +8 -1
- package/interfaces/logger.js +8 -3
- package/interfaces/vitest-plugin.mjs +16 -71
- package/lib/sentry.js +343 -0
- package/lib/vitest/hooks.mjs +81 -81
- package/package.json +4 -3
- package/sdk-log-formatter.js +41 -0
- package/sdk.d.ts +22 -9
- package/sdk.js +344 -100
- package/test/manual/reconnect-provision.test.mjs +49 -0
- package/test/manual/reconnect-signin.test.mjs +41 -0
- package/test/testdriver/act.test.mjs +30 -0
- package/test/testdriver/ai.test.mjs +30 -0
- package/test/testdriver/assert.test.mjs +1 -1
- package/test/testdriver/hover-text.test.mjs +1 -1
- package/test/testdriver/setup/testHelpers.mjs +8 -119
- package/test/testdriver/windows-installer.test.mjs +61 -0
- package/tests/example.test.js +33 -0
- package/tests/login.js +28 -0
- package/tests/table-sort-enrollments.test.mjs +72 -0
- package/tests/table-sort-experiment.test.mjs +42 -0
- package/tests/table-sort-setup.test.mjs +59 -0
- package/vitest.config.mjs +3 -1
- package/agent/lib/cache.js +0 -142
- package/docs/v7/api/assertions.mdx +0 -403
- package/docs/v7/features/ai-native.mdx +0 -413
- package/docs/v7/features/application-logs.mdx +0 -353
- package/docs/v7/features/browser-logs.mdx +0 -414
- package/docs/v7/features/cache-management.mdx +0 -402
- package/docs/v7/features/continuous-testing.mdx +0 -346
- package/docs/v7/features/data-driven-testing.mdx +0 -441
- package/docs/v7/features/easy-to-write.mdx +0 -280
- package/docs/v7/features/enterprise.mdx +0 -656
- package/docs/v7/features/fast.mdx +0 -406
- package/docs/v7/features/managed-sandboxes.mdx +0 -384
- package/docs/v7/features/network-monitoring.mdx +0 -568
- package/docs/v7/features/parallel-execution.mdx +0 -381
- package/docs/v7/features/powerful.mdx +0 -531
- package/docs/v7/features/sandbox-customization.mdx +0 -229
- package/docs/v7/features/stable.mdx +0 -473
- package/docs/v7/features/system-performance.mdx +0 -616
- package/docs/v7/features/test-analytics.mdx +0 -373
- package/docs/v7/features/test-cases.mdx +0 -393
- package/docs/v7/features/test-replays.mdx +0 -408
- package/docs/v7/features/test-reports.mdx +0 -308
- package/docs/v7/getting-started/debugging-tests.mdx +0 -382
- package/docs/v7/getting-started/quickstart.mdx +0 -90
- package/docs/v7/getting-started/running-tests.mdx +0 -173
- package/docs/v7/getting-started/setting-up-in-ci.mdx +0 -612
- package/docs/v7/getting-started/writing-tests.mdx +0 -534
- package/docs/v7/overview/what-is-testdriver.mdx +0 -386
- package/docs/v7/presets/chrome-extension.mdx +0 -248
- package/docs/v7/presets/chrome.mdx +0 -300
- package/docs/v7/presets/electron.mdx +0 -460
- package/docs/v7/presets/vscode.mdx +0 -417
- package/docs/v7/presets/webapp.mdx +0 -393
- /package/docs/v7/{commands → _drafts/commands}/assert.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/exec.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/focus-application.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/hover-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/hover-text.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/if.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/match-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/press-keys.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/remember.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/run.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/scroll-until-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/scroll-until-text.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/scroll.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/type.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/wait-for-image.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/wait-for-text.mdx +0 -0
- /package/docs/v7/{commands → _drafts/commands}/wait.mdx +0 -0
- /package/docs/v7/{getting-started → _drafts}/configuration.mdx +0 -0
- /package/docs/v7/{features → _drafts}/observable.mdx +0 -0
- /package/docs/v7/{platforms → _drafts/platforms}/linux.mdx +0 -0
- /package/docs/v7/{platforms → _drafts/platforms}/macos.mdx +0 -0
- /package/docs/v7/{platforms → _drafts/platforms}/windows.mdx +0 -0
- /package/docs/v7/{playwright.mdx → _drafts/playwright.mdx} +0 -0
- /package/docs/v7/{overview → _drafts}/readme.mdx +0 -0
- /package/docs/v7/{features → _drafts}/reports.mdx +0 -0
- /package/docs/v7/{api/client.mdx → client.mdx} +0 -0
- /package/docs/v7/{api/dashcam.mdx → dashcam.mdx} +0 -0
- /package/docs/v7/{api/elements.mdx → elements.mdx} +0 -0
- /package/docs/v7/{api/sandbox.mdx → sandbox.mdx} +0 -0
package/sdk-log-formatter.js
CHANGED
|
@@ -878,6 +878,47 @@ class SDKLogFormatter {
|
|
|
878
878
|
|
|
879
879
|
return `\n${parts.join(" ")}\n`;
|
|
880
880
|
}
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* Format act() start message - provides visual scope boundary
|
|
884
|
+
* @param {string} task - The task being executed
|
|
885
|
+
* @returns {string} Formatted act start message
|
|
886
|
+
*/
|
|
887
|
+
formatActStart(task) {
|
|
888
|
+
const parts = [];
|
|
889
|
+
this.addTimestamp(parts);
|
|
890
|
+
parts.push(this.getPrefix("action"));
|
|
891
|
+
parts.push(chalk.bold.cyan("Act"));
|
|
892
|
+
parts.push(chalk.cyan(`"${task}"`));
|
|
893
|
+
return parts.join(" ");
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* Format act() completion message - provides visual scope boundary
|
|
898
|
+
* @param {number} durationMs - Duration in milliseconds
|
|
899
|
+
* @param {boolean} success - Whether the act completed successfully
|
|
900
|
+
* @param {string} [error] - Error message if failed
|
|
901
|
+
* @returns {string} Formatted act complete message
|
|
902
|
+
*/
|
|
903
|
+
formatActComplete(durationMs, success, error = null) {
|
|
904
|
+
const parts = [];
|
|
905
|
+
this.addTimestamp(parts);
|
|
906
|
+
parts.push(this.getResultPrefix());
|
|
907
|
+
|
|
908
|
+
if (success) {
|
|
909
|
+
parts.push(chalk.green("complete"));
|
|
910
|
+
} else {
|
|
911
|
+
parts.push(chalk.red("failed"));
|
|
912
|
+
if (error) {
|
|
913
|
+
parts.push(chalk.dim("·"));
|
|
914
|
+
parts.push(chalk.red(error));
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
parts.push(this.formatDurationColored(durationMs, "default"));
|
|
919
|
+
|
|
920
|
+
return parts.join(" ");
|
|
921
|
+
}
|
|
881
922
|
}
|
|
882
923
|
|
|
883
924
|
// Export singleton instance
|
package/sdk.d.ts
CHANGED
|
@@ -242,6 +242,8 @@ export interface TestDriverOptions {
|
|
|
242
242
|
sandboxInstance?: string;
|
|
243
243
|
/** Cache key for element finding operations. If provided, enables caching tied to this key */
|
|
244
244
|
cacheKey?: string;
|
|
245
|
+
/** Reconnect to the last used sandbox (throws error if no last sandbox exists) */
|
|
246
|
+
reconnect?: boolean;
|
|
245
247
|
/** Redraw configuration for screen change detection */
|
|
246
248
|
redraw?: boolean | {
|
|
247
249
|
/** Enable redraw detection (default: true) */
|
|
@@ -264,6 +266,8 @@ export interface ConnectOptions {
|
|
|
264
266
|
sandboxId?: string;
|
|
265
267
|
/** Force creation of a new sandbox */
|
|
266
268
|
newSandbox?: boolean;
|
|
269
|
+
/** Reconnect to the last used sandbox (throws error if no last sandbox exists) */
|
|
270
|
+
reconnect?: boolean;
|
|
267
271
|
/** Direct IP address to connect to a running sandbox instance */
|
|
268
272
|
ip?: string;
|
|
269
273
|
/** Custom AMI ID for sandbox instance (e.g., 'ami-1234') */
|
|
@@ -276,6 +280,8 @@ export interface ConnectOptions {
|
|
|
276
280
|
headless?: boolean;
|
|
277
281
|
/** Reuse recent connection if available (default: true) */
|
|
278
282
|
reuseConnection?: boolean;
|
|
283
|
+
/** Keep sandbox alive for specified milliseconds after disconnect (default: 60000). Set to 0 to terminate immediately on disconnect. */
|
|
284
|
+
keepAlive?: number;
|
|
279
285
|
}
|
|
280
286
|
|
|
281
287
|
export interface SandboxInstance {
|
|
@@ -695,6 +701,18 @@ export default class TestDriverSDK {
|
|
|
695
701
|
*/
|
|
696
702
|
disconnect(): Promise<void>;
|
|
697
703
|
|
|
704
|
+
/**
|
|
705
|
+
* Get the last sandbox info from the stored file
|
|
706
|
+
* @returns Last sandbox info or null if not found
|
|
707
|
+
*/
|
|
708
|
+
getLastSandboxId(): {
|
|
709
|
+
sandboxId: string | null;
|
|
710
|
+
os: 'windows' | 'linux';
|
|
711
|
+
ami: string | null;
|
|
712
|
+
instanceType: string | null;
|
|
713
|
+
timestamp: string | null;
|
|
714
|
+
} | null;
|
|
715
|
+
|
|
698
716
|
// Element Finding API
|
|
699
717
|
|
|
700
718
|
/**
|
|
@@ -702,7 +720,7 @@ export default class TestDriverSDK {
|
|
|
702
720
|
* Automatically locates the element and returns it
|
|
703
721
|
*
|
|
704
722
|
* @param description - Description of the element to find
|
|
705
|
-
* @param
|
|
723
|
+
* @param options - Cache threshold (number) or options object
|
|
706
724
|
* @returns Chainable promise that resolves to Element instance
|
|
707
725
|
*
|
|
708
726
|
* @example
|
|
@@ -719,17 +737,12 @@ export default class TestDriverSDK {
|
|
|
719
737
|
* const element = await client.find('login button', 0.01);
|
|
720
738
|
*
|
|
721
739
|
* @example
|
|
722
|
-
* // Poll
|
|
723
|
-
*
|
|
724
|
-
* while (!element?.found()) {
|
|
725
|
-
* element = await client.find('login button');
|
|
726
|
-
* if (!element.found()) {
|
|
727
|
-
* await new Promise(resolve => setTimeout(resolve, 1000));
|
|
728
|
-
* }
|
|
729
|
-
* }
|
|
740
|
+
* // Poll for element with timeout (retries every 5 seconds)
|
|
741
|
+
* const element = await client.find('loading complete indicator', { timeout: 30000 });
|
|
730
742
|
* await element.click();
|
|
731
743
|
*/
|
|
732
744
|
find(description: string, cacheThreshold?: number): ChainableElementPromise;
|
|
745
|
+
find(description: string, options?: { cacheThreshold?: number; cacheKey?: string; timeout?: number }): ChainableElementPromise;
|
|
733
746
|
|
|
734
747
|
/**
|
|
735
748
|
* Find all elements matching a description
|