testdriverai 7.3.38 → 7.3.40
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 +8 -0
- package/interfaces/logger.js +11 -49
- package/package.json +1 -1
- package/sdk.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [7.3.40](https://github.com/testdriverai/testdriverai/compare/v7.3.39...v7.3.40) (2026-02-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## [7.3.39](https://github.com/testdriverai/testdriverai/compare/v7.3.38...v7.3.39) (2026-02-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
1
9
|
## [7.3.38](https://github.com/testdriverai/testdriverai/compare/v7.3.37...v7.3.38) (2026-02-25)
|
|
2
10
|
|
|
3
11
|
|
package/interfaces/logger.js
CHANGED
|
@@ -11,43 +11,6 @@ class CustomTransport extends Transport {
|
|
|
11
11
|
this.level = opts.level || "info";
|
|
12
12
|
this.logStore = opts.logStore || []; // You could connect to a DB or API here
|
|
13
13
|
this.sandbox = null;
|
|
14
|
-
|
|
15
|
-
// Batching configuration to reduce websocket traffic
|
|
16
|
-
this.batchQueue = [];
|
|
17
|
-
this.batchTimeout = null;
|
|
18
|
-
this.BATCH_INTERVAL_MS = 100; // Flush every 100ms
|
|
19
|
-
this.MAX_BATCH_SIZE = 20; // Or when batch reaches 20 messages
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
_flushBatch() {
|
|
23
|
-
if (this.batchQueue.length === 0) return;
|
|
24
|
-
|
|
25
|
-
// Capture and clear the batch atomically to prevent duplicate sends
|
|
26
|
-
const batch = this.batchQueue;
|
|
27
|
-
this.batchQueue = [];
|
|
28
|
-
this.batchTimeout = null;
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
if (!this.sandbox) {
|
|
32
|
-
this.sandbox = require("../agent/lib/sandbox");
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (this.sandbox && this.sandbox.instanceSocketConnected) {
|
|
36
|
-
// Send all batched messages as a single combined output
|
|
37
|
-
const combinedOutput = batch.join('\n');
|
|
38
|
-
this.sandbox.send({
|
|
39
|
-
type: "output",
|
|
40
|
-
output: Buffer.from(combinedOutput).toString("base64"),
|
|
41
|
-
}).catch((e) => {
|
|
42
|
-
// Re-queue failed messages for retry on next flush
|
|
43
|
-
console.error("Error sending log batch:", e);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
} catch (e) {
|
|
47
|
-
// Re-queue on synchronous error as well
|
|
48
|
-
this.batchQueue = batch.concat(this.batchQueue);
|
|
49
|
-
console.error("Error flushing log batch:", e);
|
|
50
|
-
}
|
|
51
14
|
}
|
|
52
15
|
|
|
53
16
|
log(info, callback) {
|
|
@@ -61,18 +24,17 @@ class CustomTransport extends Transport {
|
|
|
61
24
|
return;
|
|
62
25
|
}
|
|
63
26
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (this.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.batchTimeout = setTimeout(() => this._flushBatch(), this.BATCH_INTERVAL_MS);
|
|
27
|
+
if (!this.sandbox) {
|
|
28
|
+
this.sandbox = require("../agent/lib/sandbox");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (this.sandbox && this.sandbox.instanceSocketConnected) {
|
|
32
|
+
this.sandbox.send({
|
|
33
|
+
type: "output",
|
|
34
|
+
output: Buffer.from(message).toString("base64"),
|
|
35
|
+
}).catch((e) => {
|
|
36
|
+
console.error("Error sending log:", e);
|
|
37
|
+
});
|
|
76
38
|
}
|
|
77
39
|
} catch (e) {
|
|
78
40
|
console.error("Error in CustomTransport log method:", e);
|
package/package.json
CHANGED
package/sdk.js
CHANGED
|
@@ -1617,7 +1617,7 @@ class TestDriverSDK {
|
|
|
1617
1617
|
// Auto-screenshots configuration
|
|
1618
1618
|
// When enabled, automatically captures screenshots before/after each command
|
|
1619
1619
|
// Screenshots are saved to .testdriver/screenshots/<test>/ with descriptive names
|
|
1620
|
-
this.autoScreenshots = options.autoScreenshots
|
|
1620
|
+
this.autoScreenshots = options.autoScreenshots === true;
|
|
1621
1621
|
this._screenshotSequence = 0; // Counter for sequential screenshot naming
|
|
1622
1622
|
|
|
1623
1623
|
// Set up command methods that lazy-await connection
|