testdriverai 7.4.5 → 7.5.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/CHANGELOG.md +4 -0
- package/agent/events.js +7 -0
- package/agent/index.js +24 -17
- package/agent/lib/sandbox.js +727 -244
- package/agent/lib/system.js +70 -1
- package/docs/_data/examples-manifest.json +68 -68
- package/docs/v7/examples/ai.mdx +1 -1
- package/docs/v7/examples/assert.mdx +1 -1
- package/docs/v7/examples/chrome-extension.mdx +1 -1
- package/docs/v7/examples/drag-and-drop.mdx +1 -1
- package/docs/v7/examples/element-not-found.mdx +1 -1
- package/docs/v7/examples/hover-image.mdx +1 -1
- package/docs/v7/examples/hover-text.mdx +1 -1
- package/docs/v7/examples/installer.mdx +1 -1
- package/docs/v7/examples/launch-vscode-linux.mdx +1 -1
- package/docs/v7/examples/match-image.mdx +1 -1
- package/docs/v7/examples/press-keys.mdx +1 -1
- package/docs/v7/examples/scroll-keyboard.mdx +1 -1
- package/docs/v7/examples/scroll-until-image.mdx +1 -1
- package/docs/v7/examples/scroll-until-text.mdx +1 -1
- package/docs/v7/examples/scroll.mdx +1 -1
- package/docs/v7/examples/type.mdx +1 -1
- package/docs/v7/examples/windows-installer.mdx +1 -1
- package/lib/vitest/hooks.mjs +9 -0
- package/lib/vitest/setup-aws.mjs +1 -0
- package/manual/packer-hover-image.test.mjs +176 -0
- package/package.json +2 -1
- package/sdk.js +10 -0
- package/setup/aws/cloudformation.yaml +1 -8
- package/setup/aws/spawn-runner.sh +2 -37
- package/vitest.config.mjs +1 -1
package/CHANGELOG.md
CHANGED
package/agent/events.js
CHANGED
|
@@ -101,11 +101,18 @@ const events = {
|
|
|
101
101
|
sent: "sandbox:sent",
|
|
102
102
|
received: "sandbox:received",
|
|
103
103
|
progress: "sandbox:progress",
|
|
104
|
+
file: "sandbox:file",
|
|
104
105
|
},
|
|
105
106
|
redraw: {
|
|
106
107
|
status: "redraw:status",
|
|
107
108
|
complete: "redraw:complete",
|
|
108
109
|
},
|
|
110
|
+
exec: {
|
|
111
|
+
output: "exec:output",
|
|
112
|
+
},
|
|
113
|
+
runner: {
|
|
114
|
+
log: "runner:log",
|
|
115
|
+
},
|
|
109
116
|
exit: "exit",
|
|
110
117
|
};
|
|
111
118
|
|
package/agent/index.js
CHANGED
|
@@ -1686,6 +1686,7 @@ ${regression}
|
|
|
1686
1686
|
resolution: this.config.TD_RESOLUTION,
|
|
1687
1687
|
ci: this.config.CI,
|
|
1688
1688
|
ip: this.ip,
|
|
1689
|
+
instanceId: this.instanceId || undefined,
|
|
1689
1690
|
});
|
|
1690
1691
|
|
|
1691
1692
|
// Store connection params for reconnection
|
|
@@ -1748,28 +1749,34 @@ ${regression}
|
|
|
1748
1749
|
" " +
|
|
1749
1750
|
theme.cyan(`new sandbox...`),
|
|
1750
1751
|
);
|
|
1751
|
-
|
|
1752
|
-
// to see if that fixes the issue.
|
|
1753
|
-
let newSandbox = await this.createNewSandbox().catch(() => {
|
|
1754
|
-
this.emitter.emit(
|
|
1755
|
-
events.log.narration,
|
|
1756
|
-
theme.dim(`double-checking sandbox availability`),
|
|
1757
|
-
);
|
|
1758
|
-
return this.createNewSandbox();
|
|
1759
|
-
});
|
|
1752
|
+
let newSandbox = await this.createNewSandbox();
|
|
1760
1753
|
|
|
1761
1754
|
// Extract the sandbox ID from the newly created sandbox
|
|
1762
1755
|
this.sandboxId =
|
|
1763
1756
|
newSandbox?.sandbox?.sandboxId || newSandbox?.sandbox?.instanceId;
|
|
1764
1757
|
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
this.
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1758
|
+
// E2B sandboxes return a url directly from create — no separate
|
|
1759
|
+
// connect step needed (the API proxies commands via Ably).
|
|
1760
|
+
if (newSandbox?.sandbox?.url) {
|
|
1761
|
+
this.sandbox.setConnectionParams({
|
|
1762
|
+
sandboxId: this.sandboxId,
|
|
1763
|
+
persist: true,
|
|
1764
|
+
keepAlive: this.keepAlive,
|
|
1765
|
+
});
|
|
1766
|
+
this.emitter.emit(events.sandbox.connected);
|
|
1767
|
+
this.instance = newSandbox.sandbox;
|
|
1768
|
+
await this.renderSandbox(this.instance, headless);
|
|
1769
|
+
await this.runLifecycle("provision");
|
|
1770
|
+
} else {
|
|
1771
|
+
let instance = await this.connectToSandboxDirect(
|
|
1772
|
+
this.sandboxId,
|
|
1773
|
+
true, // always persist by default
|
|
1774
|
+
this.keepAlive, // pass keepAlive TTL
|
|
1775
|
+
);
|
|
1776
|
+
this.instance = instance;
|
|
1777
|
+
await this.renderSandbox(instance, headless);
|
|
1778
|
+
await this.runLifecycle("provision");
|
|
1779
|
+
}
|
|
1773
1780
|
}
|
|
1774
1781
|
}
|
|
1775
1782
|
|