@dev-blinq/bvt-playwright-js 1.0.0-dev.4.latest.172.1 → 1.0.0-dev.4.latest.177.1
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/index.d.mts +13 -0
- package/index.mjs +11 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -9308,6 +9308,19 @@ type TesterSession = {
|
|
|
9308
9308
|
*/
|
|
9309
9309
|
screenshots?: {
|
|
9310
9310
|
enabled: boolean;
|
|
9311
|
+
/**
|
|
9312
|
+
* "upload" (default): Tester requests presigned URLs and uploads the
|
|
9313
|
+
* captured JPEGs to S3 itself at the end of the testcase.
|
|
9314
|
+
* "local": Tester captures JPEGs to `outputDir` and leaves them on disk
|
|
9315
|
+
* for an out-of-band uploader (mirrors the local-trace mode used by the
|
|
9316
|
+
* execution worker, which has no presigned-URL API client).
|
|
9317
|
+
*/
|
|
9318
|
+
mode?: "upload" | "local";
|
|
9319
|
+
/**
|
|
9320
|
+
* Local-mode capture directory. When omitted a per-testcase /tmp dir is
|
|
9321
|
+
* used. Ignored in "upload" mode.
|
|
9322
|
+
*/
|
|
9323
|
+
outputDir?: string;
|
|
9311
9324
|
};
|
|
9312
9325
|
deterministicRecoveryMode?: "new-tour-maintenance";
|
|
9313
9326
|
};
|
package/index.mjs
CHANGED
|
@@ -26460,7 +26460,7 @@ var Tester = class {
|
|
|
26460
26460
|
return `${this.dataContext?.projectId ?? ""}/${session.reportId}/testcases/${session.testCaseId}/resources/screenshots/${stepId}-${commandId}-${phase}.jpg`;
|
|
26461
26461
|
}
|
|
26462
26462
|
getScreenshotTempDir(session) {
|
|
26463
|
-
if (!this.tempPathForAssets) this.tempPathForAssets = join("/tmp", `blinq-screenshots-${session.reportId}-${session.testCaseId}`);
|
|
26463
|
+
if (!this.tempPathForAssets) this.tempPathForAssets = session.screenshots?.outputDir ?? join("/tmp", `blinq-screenshots-${session.reportId}-${session.testCaseId}`);
|
|
26464
26464
|
return this.tempPathForAssets;
|
|
26465
26465
|
}
|
|
26466
26466
|
/**
|
|
@@ -27050,6 +27050,16 @@ var Tester = class {
|
|
|
27050
27050
|
});
|
|
27051
27051
|
return false;
|
|
27052
27052
|
}
|
|
27053
|
+
if (session.screenshots?.mode === "local") {
|
|
27054
|
+
this.obs.logger.log("Screenshots captured in local mode; leaving files for out-of-band upload", {
|
|
27055
|
+
reportId: session.reportId,
|
|
27056
|
+
testCaseId: session.testCaseId,
|
|
27057
|
+
capturedCount,
|
|
27058
|
+
dir: this.tempPathForAssets
|
|
27059
|
+
});
|
|
27060
|
+
this.capturedScreenshots = [];
|
|
27061
|
+
return capturedCount > 0;
|
|
27062
|
+
}
|
|
27053
27063
|
if (!session.token) {
|
|
27054
27064
|
this.obs.metrics.count("bvt_agent.screenshots.upload.skipped.total", 1, { reason: "no-session-token" });
|
|
27055
27065
|
this.obs.logger.warn(`Screenshot upload skipped because no session token was provided for reportId: ${session.reportId}, testCaseId: ${session.testCaseId}.`);
|