testdriverai 7.2.0 → 7.2.2
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/agent/interface.js +4 -0
- package/interfaces/vitest-plugin.mjs +1 -8
- package/lib/core/Dashcam.js +0 -24
- package/package.json +1 -1
- package/sdk.d.ts +36 -3
package/agent/interface.js
CHANGED
|
@@ -243,6 +243,10 @@ function createCommandDefinitions(agent) {
|
|
|
243
243
|
"sandbox-instance": Flags.string({
|
|
244
244
|
description: "Specify EC2 instance type for sandbox (e.g., i3.metal)",
|
|
245
245
|
}),
|
|
246
|
+
ip: Flags.string({
|
|
247
|
+
description:
|
|
248
|
+
"Connect directly to a sandbox at the specified IP address",
|
|
249
|
+
}),
|
|
246
250
|
os: Flags.string({
|
|
247
251
|
description: "Operating system for the sandbox (windows or linux)",
|
|
248
252
|
options: ["windows", "linux"],
|
|
@@ -403,14 +403,7 @@ function registerExitHandlers() {
|
|
|
403
403
|
await handleProcessExit();
|
|
404
404
|
process.exit(143); // Standard exit code for SIGTERM
|
|
405
405
|
});
|
|
406
|
-
|
|
407
|
-
// Handle unexpected exits
|
|
408
|
-
process.on("beforeExit", async () => {
|
|
409
|
-
// Only handle if test run is still running (hasn't been completed normally)
|
|
410
|
-
if (pluginState.testRun && !pluginState.testRunCompleted) {
|
|
411
|
-
await handleProcessExit();
|
|
412
|
-
}
|
|
413
|
-
});
|
|
406
|
+
|
|
414
407
|
}
|
|
415
408
|
|
|
416
409
|
/**
|
package/lib/core/Dashcam.js
CHANGED
|
@@ -356,30 +356,6 @@ class Dashcam {
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
this.recording = true;
|
|
359
|
-
|
|
360
|
-
// Update the session with dashcam start time for interaction timestamp synchronization
|
|
361
|
-
const sessionId = this.client?.agent?.session?.get?.();
|
|
362
|
-
if (sessionId) {
|
|
363
|
-
try {
|
|
364
|
-
const apiRoot = this.apiRoot || process.env.TD_API_ROOT || this._getApiRoot();
|
|
365
|
-
const response = await fetch(`${apiRoot}/api/v7.0.0/testdriver/session/${sessionId}/update-dashcam-time`, {
|
|
366
|
-
method: 'POST',
|
|
367
|
-
headers: {
|
|
368
|
-
'Content-Type': 'application/json',
|
|
369
|
-
'Authorization': `Bearer ${this.apiKey}`
|
|
370
|
-
},
|
|
371
|
-
body: JSON.stringify({ dashcamStartTime: this.startTime })
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
if (response.ok) {
|
|
375
|
-
this._log('debug', `Updated session ${sessionId} with dashcam start time: ${this.startTime}`);
|
|
376
|
-
} else {
|
|
377
|
-
this._log('warn', 'Failed to update session with dashcam start time:', response.statusText);
|
|
378
|
-
}
|
|
379
|
-
} catch (err) {
|
|
380
|
-
this._log('warn', 'Error updating session with dashcam start time:', err.message);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
359
|
}
|
|
384
360
|
|
|
385
361
|
/**
|
package/package.json
CHANGED
package/sdk.d.ts
CHANGED
|
@@ -215,6 +215,8 @@ export interface TestDriverOptions {
|
|
|
215
215
|
apiRoot?: string;
|
|
216
216
|
/** Sandbox resolution (default: '1366x768') */
|
|
217
217
|
resolution?: string;
|
|
218
|
+
/** Operating system for the sandbox (default: 'linux') */
|
|
219
|
+
os?: 'windows' | 'linux';
|
|
218
220
|
/** Enable analytics tracking (default: true) */
|
|
219
221
|
analytics?: boolean;
|
|
220
222
|
/** Enable console logging output (default: true) */
|
|
@@ -228,6 +230,31 @@ export interface TestDriverOptions {
|
|
|
228
230
|
/** Threshold for findAll operations (default: 0.05 = 5% difference, 95% similarity) */
|
|
229
231
|
findAll?: number;
|
|
230
232
|
};
|
|
233
|
+
/** Force creation of a new sandbox (default: true) */
|
|
234
|
+
newSandbox?: boolean;
|
|
235
|
+
/** Run in headless mode (default: false) */
|
|
236
|
+
headless?: boolean;
|
|
237
|
+
/** Direct IP address to connect to a running sandbox instance */
|
|
238
|
+
ip?: string;
|
|
239
|
+
/** Custom AMI ID for sandbox instance (e.g., 'ami-1234') */
|
|
240
|
+
sandboxAmi?: string;
|
|
241
|
+
/** EC2 instance type for sandbox (e.g., 'i3.metal') */
|
|
242
|
+
sandboxInstance?: string;
|
|
243
|
+
/** Cache key for element finding operations. If provided, enables caching tied to this key */
|
|
244
|
+
cacheKey?: string;
|
|
245
|
+
/** Redraw configuration for screen change detection */
|
|
246
|
+
redraw?: boolean | {
|
|
247
|
+
/** Enable redraw detection (default: true) */
|
|
248
|
+
enabled?: boolean;
|
|
249
|
+
/** Pixel difference threshold for redraw detection */
|
|
250
|
+
diffThreshold?: number;
|
|
251
|
+
/** Enable screen redraw detection */
|
|
252
|
+
screenRedraw?: boolean;
|
|
253
|
+
/** Enable network activity monitoring */
|
|
254
|
+
networkMonitor?: boolean;
|
|
255
|
+
};
|
|
256
|
+
/** @deprecated Use redraw.diffThreshold instead */
|
|
257
|
+
redrawThreshold?: number | object;
|
|
231
258
|
/** Additional environment variables */
|
|
232
259
|
environment?: Record<string, any>;
|
|
233
260
|
}
|
|
@@ -237,12 +264,18 @@ export interface ConnectOptions {
|
|
|
237
264
|
sandboxId?: string;
|
|
238
265
|
/** Force creation of a new sandbox */
|
|
239
266
|
newSandbox?: boolean;
|
|
240
|
-
/** Direct IP address to connect to */
|
|
267
|
+
/** Direct IP address to connect to a running sandbox instance */
|
|
241
268
|
ip?: string;
|
|
242
|
-
/** Custom AMI for sandbox */
|
|
269
|
+
/** Custom AMI ID for sandbox instance (e.g., 'ami-1234') */
|
|
243
270
|
sandboxAmi?: string;
|
|
244
|
-
/**
|
|
271
|
+
/** EC2 instance type for sandbox (e.g., 'i3.metal') */
|
|
245
272
|
sandboxInstance?: string;
|
|
273
|
+
/** Operating system for the sandbox (default: 'linux') */
|
|
274
|
+
os?: 'windows' | 'linux';
|
|
275
|
+
/** Run in headless mode (default: false) */
|
|
276
|
+
headless?: boolean;
|
|
277
|
+
/** Reuse recent connection if available (default: true) */
|
|
278
|
+
reuseConnection?: boolean;
|
|
246
279
|
}
|
|
247
280
|
|
|
248
281
|
export interface SandboxInstance {
|