@lambdatest/smartui-cli 4.1.53 → 4.1.54
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/dist/index.cjs +38 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2895,7 +2895,7 @@ var authExec_default = (ctx) => {
|
|
|
2895
2895
|
};
|
|
2896
2896
|
|
|
2897
2897
|
// package.json
|
|
2898
|
-
var version = "4.1.
|
|
2898
|
+
var version = "4.1.54";
|
|
2899
2899
|
var package_default = {
|
|
2900
2900
|
name: "@lambdatest/smartui-cli",
|
|
2901
2901
|
version,
|
|
@@ -4335,13 +4335,18 @@ var finalizeBuild_default = (ctx) => {
|
|
|
4335
4335
|
let uploadCLILogsToS3 = ctx2.config.useLambdaInternal || uploadDomToS3ViaEnv2;
|
|
4336
4336
|
if (!uploadCLILogsToS3) {
|
|
4337
4337
|
ctx2.log.debug(`Log file to be uploaded`);
|
|
4338
|
-
|
|
4339
|
-
|
|
4338
|
+
try {
|
|
4339
|
+
let resp = yield ctx2.client.getS3PreSignedURLForCaps(ctx2, buildId, projectToken);
|
|
4340
|
+
yield ctx2.client.uploadLogsForCaps(ctx2, resp.data.url);
|
|
4341
|
+
uploadedCliLogsBuildIds.add(buildId);
|
|
4342
|
+
} catch (error) {
|
|
4343
|
+
ctx2.log.debug(`Error uploading CLI logs for build ${buildId}, session ${sessionId}: ${error.message}`);
|
|
4344
|
+
}
|
|
4340
4345
|
} else {
|
|
4341
4346
|
ctx2.log.debug(`Log file to be uploaded via LSRS`);
|
|
4342
4347
|
ctx2.client.sendCliLogsToLSRSForCaps(ctx2, buildId, projectToken);
|
|
4348
|
+
uploadedCliLogsBuildIds.add(buildId);
|
|
4343
4349
|
}
|
|
4344
|
-
uploadedCliLogsBuildIds.add(buildId);
|
|
4345
4350
|
}
|
|
4346
4351
|
yield ctx2.client.finalizeBuildForCapsWithToken(buildId, totalSnapshots, projectToken, ctx2.log);
|
|
4347
4352
|
if (ctx2.autoTunnelStarted) {
|
|
@@ -6027,6 +6032,17 @@ var createBuild_default = (ctx) => {
|
|
|
6027
6032
|
rendererOptions: { persistentOutput: true }
|
|
6028
6033
|
};
|
|
6029
6034
|
};
|
|
6035
|
+
function humanLikeScroll(page) {
|
|
6036
|
+
return __async(this, null, function* () {
|
|
6037
|
+
yield page.waitForTimeout(2e3);
|
|
6038
|
+
yield page.mouse.move(100, 100);
|
|
6039
|
+
yield page.waitForTimeout(300);
|
|
6040
|
+
yield page.mouse.move(300, 200);
|
|
6041
|
+
yield page.waitForTimeout(300);
|
|
6042
|
+
yield page.mouse.move(500, 300);
|
|
6043
|
+
yield page.waitForTimeout(2e3);
|
|
6044
|
+
});
|
|
6045
|
+
}
|
|
6030
6046
|
function captureScreenshotsForConfig(ctx, browsers, urlConfig, browserName, renderViewports) {
|
|
6031
6047
|
return __async(this, null, function* () {
|
|
6032
6048
|
ctx.log.debug(`*** urlConfig ${JSON.stringify(urlConfig)}`);
|
|
@@ -6233,7 +6249,24 @@ function captureScreenshotsForConfig(ctx, browsers, urlConfig, browserName, rend
|
|
|
6233
6249
|
}
|
|
6234
6250
|
let ssPath = `screenshots/${ssId}/${`${browserName}-${viewport.width}x${viewport.height}`}-${ssId}.png`;
|
|
6235
6251
|
yield page == null ? void 0 : page.setViewportSize({ width: viewport.width, height: viewport.height || constants_default.MIN_VIEWPORT_HEIGHT });
|
|
6236
|
-
|
|
6252
|
+
yield page == null ? void 0 : page.goto(url.trim(), pageOptions);
|
|
6253
|
+
ctx.log.debug(`Capturing screenshot for URL: ${url} on ${browserName} with viewport: ${viewportString} (fullPage: ${fullPage})`);
|
|
6254
|
+
if (page && ctx.config.lazyLoadConfiguration) {
|
|
6255
|
+
yield humanLikeScroll(page);
|
|
6256
|
+
}
|
|
6257
|
+
if (fullPage) {
|
|
6258
|
+
if (ctx.config.lazyLoadConfiguration && ctx.config.lazyLoadConfiguration.enabled) {
|
|
6259
|
+
let stepValue = ctx.config.lazyLoadConfiguration.scrollStep || 250;
|
|
6260
|
+
let delayValue = ctx.config.lazyLoadConfiguration.scrollDelay || 300;
|
|
6261
|
+
let maxScrollsValue = ctx.config.lazyLoadConfiguration.maxScrolls || 50;
|
|
6262
|
+
let jumpBackToTopValue = ctx.config.lazyLoadConfiguration.jumpBackToTop !== false;
|
|
6263
|
+
ctx.log.debug("Capture: Starting lazy load scrolling with configuration: " + JSON.stringify({ step: stepValue, delay: delayValue, maxScrolls: maxScrollsValue, jumpBackToTop: jumpBackToTopValue }));
|
|
6264
|
+
yield page == null ? void 0 : page.evaluate(smoothScrollToBottom, { step: stepValue, delay: delayValue, maxScrolls: maxScrollsValue, jumpBackToTop: jumpBackToTopValue });
|
|
6265
|
+
ctx.log.debug("Capture: Completed lazy load scrolling");
|
|
6266
|
+
} else {
|
|
6267
|
+
yield page == null ? void 0 : page.evaluate(scrollToBottomAndBackToTop, { frequency: 100, timing: ctx.config.scrollTime });
|
|
6268
|
+
}
|
|
6269
|
+
}
|
|
6237
6270
|
yield page == null ? void 0 : page.waitForTimeout(waitForTimeout || 0);
|
|
6238
6271
|
yield executeDocumentScripts(ctx, page, "beforeSnapshot", beforeSnapshotScript);
|
|
6239
6272
|
discoveryErrors.name = name;
|