@lambdatest/smartui-cli 4.1.37-beta.0 → 4.1.38-beta.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.
Files changed (2) hide show
  1. package/dist/index.cjs +234 -55
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -203,7 +203,8 @@ var constants_default = {
203
203
  waitForTimeout: 1e3,
204
204
  enableJavaScript: false,
205
205
  allowedHostnames: [],
206
- smartIgnore: false
206
+ smartIgnore: false,
207
+ showRenderErrors: false
207
208
  },
208
209
  DEFAULT_WEB_STATIC_CONFIG: [
209
210
  {
@@ -521,7 +522,23 @@ var constants_default = {
521
522
  "Redmi Note 13 Pro": { os: "android", viewport: { width: 412, height: 869 } },
522
523
  "Aquos Sense 5G": { os: "android", viewport: { width: 393, height: 731 } },
523
524
  "Xperia 10 IV": { os: "android", viewport: { width: 412, height: 832 } },
524
- "Honeywell CT40": { os: "android", viewport: { width: 360, height: 512 } }
525
+ "Honeywell CT40": { os: "android", viewport: { width: 360, height: 512 } },
526
+ "Galaxy S25": { os: "android", viewport: { width: 370, height: 802 } },
527
+ "Galaxy S25 Plus": { os: "android", viewport: { width: 393, height: 888 } },
528
+ "Galaxy S25 Ultra": { os: "android", viewport: { width: 432, height: 941 } },
529
+ "iPhone 17": { os: "ios", viewport: { width: 393, height: 852 } },
530
+ "iPhone 17 Pro": { os: "ios", viewport: { width: 393, height: 852 } },
531
+ "iPhone 17 Pro Max": { os: "ios", viewport: { width: 430, height: 932 } },
532
+ "Galaxy Z Fold7": { os: "android", viewport: { width: 373, height: 873 } },
533
+ "Galaxy Z Flip7": { os: "android", viewport: { width: 299, height: 723 } },
534
+ "Galaxy Z Fold6": { os: "android", viewport: { width: 373, height: 873 } },
535
+ "Galaxy Z Flip6": { os: "android", viewport: { width: 298, height: 713 } },
536
+ "Pixel 10 Pro": { os: "android", viewport: { width: 393, height: 852 } },
537
+ "Pixel 10 Pro XL": { os: "android", viewport: { width: 412, height: 915 } },
538
+ "Motorola Edge 50 Pro": { os: "android", viewport: { width: 384, height: 864 } },
539
+ "OnePlus 12": { os: "android", viewport: { width: 384, height: 884 } },
540
+ "Nothing Phone 1": { os: "android", viewport: { width: 393, height: 853 } },
541
+ "Nothing Phone 2": { os: "android", viewport: { width: 393, height: 878 } }
525
542
  },
526
543
  FIGMA_API: "https://api.figma.com/v1/",
527
544
  DEFAULT_FIGMA_CONFIG: {
@@ -881,6 +898,10 @@ var ConfigSchema = {
881
898
  minimum: 0,
882
899
  maximum: 100,
883
900
  errorMessage: "Invalid config; rejectionThreshold must be a number"
901
+ },
902
+ showRenderErrors: {
903
+ type: "boolean",
904
+ errorMessage: "Invalid config; showRenderErrors must be true/false"
884
905
  }
885
906
  },
886
907
  anyOf: [
@@ -2055,6 +2076,131 @@ function validateCoordinates(coordString, pageHeight, pageWidth, snapshotName) {
2055
2076
  coords: { top, bottom, left, right }
2056
2077
  };
2057
2078
  }
2079
+ function createBasicAuthToken(username, accessKey) {
2080
+ const credentials = `${username}:${accessKey}`;
2081
+ return Buffer.from(credentials).toString("base64");
2082
+ }
2083
+ function listenToSmartUISSE(baseURL, accessToken, ctx, onEvent) {
2084
+ return __async(this, null, function* () {
2085
+ var _a;
2086
+ const url = `${baseURL}/api/v1/sse/smartui`;
2087
+ const abortController = new AbortController();
2088
+ try {
2089
+ const response = yield fetch(url, {
2090
+ method: "GET",
2091
+ headers: {
2092
+ "Accept": "text/event-stream",
2093
+ "Cache-Control": "no-cache",
2094
+ "Cookie": `stageAccessToken=Basic ${accessToken}`
2095
+ },
2096
+ signal: abortController.signal
2097
+ });
2098
+ if (!response.ok) {
2099
+ throw new Error(`HTTP error! status: ${response.status}`);
2100
+ }
2101
+ onEvent == null ? void 0 : onEvent("open", { status: "connected" });
2102
+ const reader = (_a = response.body) == null ? void 0 : _a.getReader();
2103
+ if (!reader) {
2104
+ throw new Error("No response body reader available");
2105
+ }
2106
+ const decoder = new TextDecoder();
2107
+ let buffer = "";
2108
+ let currentEvent = "";
2109
+ try {
2110
+ while (true) {
2111
+ const { done, value } = yield reader.read();
2112
+ if (done)
2113
+ break;
2114
+ const chunk = decoder.decode(value, { stream: true });
2115
+ buffer += chunk;
2116
+ const lines = buffer.split("\n");
2117
+ buffer = lines.pop() || "";
2118
+ for (const line of lines) {
2119
+ if (line.startsWith("event:")) {
2120
+ currentEvent = line.substring(6).trim();
2121
+ } else if (line.startsWith("data:")) {
2122
+ const data = line.substring(5).trim();
2123
+ if (data) {
2124
+ try {
2125
+ const parsedData = JSON.parse(data);
2126
+ onEvent == null ? void 0 : onEvent(currentEvent, parsedData);
2127
+ } catch (parseError) {
2128
+ if (currentEvent === "connection" && data === "connected") {
2129
+ onEvent == null ? void 0 : onEvent(currentEvent, { status: "connected", message: data });
2130
+ } else {
2131
+ onEvent == null ? void 0 : onEvent(currentEvent, data);
2132
+ }
2133
+ }
2134
+ }
2135
+ } else if (line.trim() === "") {
2136
+ currentEvent = "";
2137
+ }
2138
+ }
2139
+ }
2140
+ } catch (streamError) {
2141
+ ctx.log.debug("SSE Streaming error:", streamError);
2142
+ onEvent == null ? void 0 : onEvent("error", streamError);
2143
+ } finally {
2144
+ reader.releaseLock();
2145
+ }
2146
+ } catch (error) {
2147
+ ctx.log.debug("SSE Connection error:", error);
2148
+ onEvent == null ? void 0 : onEvent("error", error);
2149
+ }
2150
+ return {
2151
+ abort: () => abortController.abort()
2152
+ };
2153
+ });
2154
+ }
2155
+ function startSSEListener(ctx) {
2156
+ return __async(this, null, function* () {
2157
+ let currentConnection = null;
2158
+ let errorCount = 0;
2159
+ try {
2160
+ ctx.log.debug("Attempting SSE connection");
2161
+ const accessKey = ctx.env.LT_ACCESS_KEY;
2162
+ const username = ctx.env.LT_USERNAME;
2163
+ const basicAuthToken = createBasicAuthToken(username, accessKey);
2164
+ ctx.log.debug(`Basic auth token: ${basicAuthToken}`);
2165
+ currentConnection = yield listenToSmartUISSE(
2166
+ ctx.env.SMARTUI_SSE_URL,
2167
+ basicAuthToken,
2168
+ ctx,
2169
+ (eventType, data) => {
2170
+ switch (eventType) {
2171
+ case "open":
2172
+ ctx.log.debug("Connected to SSE server");
2173
+ break;
2174
+ case "connection":
2175
+ ctx.log.debug("Connection confirmed:", data);
2176
+ break;
2177
+ case "Dot_buildCompleted":
2178
+ ctx.log.debug("Build completed");
2179
+ ctx.log.info(chalk__default.default.green.bold("Build completed"));
2180
+ process.exit(0);
2181
+ case "DOTUIError":
2182
+ if (data.buildId == ctx.build.id) {
2183
+ errorCount++;
2184
+ ctx.log.info(chalk__default.default.red.bold(`Error: ${data.message}`));
2185
+ }
2186
+ break;
2187
+ case "DOTUIWarning":
2188
+ if (data.buildId == ctx.build.id) {
2189
+ ctx.log.info(chalk__default.default.yellow.bold(`Warning: ${data.message}`));
2190
+ }
2191
+ break;
2192
+ case "error":
2193
+ ctx.log.debug("SSE Error occurred:", data);
2194
+ currentConnection == null ? void 0 : currentConnection.abort();
2195
+ return;
2196
+ }
2197
+ }
2198
+ );
2199
+ } catch (error) {
2200
+ ctx.log.debug("Failed to start SSE listener:", error);
2201
+ }
2202
+ });
2203
+ }
2058
2204
 
2059
2205
  // src/lib/server.ts
2060
2206
  var fp = require_find_free_port();
@@ -2380,7 +2526,10 @@ var env_default = () => {
2380
2526
  SMARTUI_API_PROXY,
2381
2527
  SMARTUI_API_SKIP_CERTIFICATES,
2382
2528
  USE_REMOTE_DISCOVERY,
2383
- SMART_GIT
2529
+ SMART_GIT,
2530
+ SHOW_RENDER_ERRORS,
2531
+ SMARTUI_SSE_URL = "https://server-events.lambdatest.com",
2532
+ LT_SDK_SKIP_EXECUTION_LOGS
2384
2533
  } = process.env;
2385
2534
  return {
2386
2535
  PROJECT_TOKEN,
@@ -2403,7 +2552,10 @@ var env_default = () => {
2403
2552
  SMARTUI_API_PROXY,
2404
2553
  SMARTUI_API_SKIP_CERTIFICATES: SMARTUI_API_SKIP_CERTIFICATES === "true",
2405
2554
  USE_REMOTE_DISCOVERY: USE_REMOTE_DISCOVERY === "true",
2406
- SMART_GIT: SMART_GIT === "true"
2555
+ SMART_GIT: SMART_GIT === "true",
2556
+ SHOW_RENDER_ERRORS: SHOW_RENDER_ERRORS === "true",
2557
+ SMARTUI_SSE_URL,
2558
+ LT_SDK_SKIP_EXECUTION_LOGS: LT_SDK_SKIP_EXECUTION_LOGS === "true"
2407
2559
  };
2408
2560
  };
2409
2561
  var logContext = {};
@@ -2498,7 +2650,7 @@ var authExec_default = (ctx) => {
2498
2650
  };
2499
2651
 
2500
2652
  // package.json
2501
- var version = "4.1.37-beta.0";
2653
+ var version = "4.1.38-beta.0";
2502
2654
  var package_default = {
2503
2655
  name: "@lambdatest/smartui-cli",
2504
2656
  version,
@@ -2895,7 +3047,26 @@ var httpClient = class {
2895
3047
  data: requestData
2896
3048
  }, ctx.log);
2897
3049
  }
2898
- processSnapshotCaps(ctx, snapshot, snapshotUuid, capsBuildId, capsProjectToken, discoveryErrors, variantCount, sync = false) {
3050
+ processSnapshotCaps(ctx, snapshot, snapshotUuid, capsBuildId, capsProjectToken, discoveryErrors, variantCount, sync = false, approvalThreshold, rejectionThreshold) {
3051
+ const requestData = {
3052
+ name: snapshot.name,
3053
+ url: snapshot.url,
3054
+ snapshotUuid,
3055
+ variantCount,
3056
+ test: {
3057
+ type: ctx.testType,
3058
+ source: "cli"
3059
+ },
3060
+ doRemoteDiscovery: snapshot.options.doRemoteDiscovery,
3061
+ discoveryErrors,
3062
+ sync
3063
+ };
3064
+ if (approvalThreshold !== void 0) {
3065
+ requestData.approvalThreshold = approvalThreshold;
3066
+ }
3067
+ if (rejectionThreshold !== void 0) {
3068
+ requestData.rejectionThreshold = rejectionThreshold;
3069
+ }
2899
3070
  return this.request({
2900
3071
  url: `/build/${capsBuildId}/snapshot`,
2901
3072
  method: "POST",
@@ -2903,23 +3074,27 @@ var httpClient = class {
2903
3074
  "Content-Type": "application/json",
2904
3075
  projectToken: capsProjectToken !== "" ? capsProjectToken : this.projectToken
2905
3076
  },
2906
- data: {
2907
- name: snapshot.name,
2908
- url: snapshot.url,
2909
- snapshotUuid,
2910
- variantCount,
2911
- test: {
2912
- type: ctx.testType,
2913
- source: "cli"
2914
- },
2915
- doRemoteDiscovery: snapshot.options.doRemoteDiscovery,
2916
- discoveryErrors,
2917
- sync
2918
- }
3077
+ data: requestData
2919
3078
  }, ctx.log);
2920
3079
  }
2921
- uploadSnapshotForCaps(ctx, snapshot, capsBuildId, capsProjectToken, discoveryErrors, variantCount, sync = false) {
3080
+ uploadSnapshotForCaps(ctx, snapshot, capsBuildId, capsProjectToken, discoveryErrors, variantCount, sync = false, approvalThreshold, rejectionThreshold) {
2922
3081
  const buildId = capsBuildId !== "" ? capsBuildId : ctx.build.id;
3082
+ const requestData = {
3083
+ snapshot,
3084
+ test: {
3085
+ type: ctx.testType,
3086
+ source: "cli"
3087
+ },
3088
+ discoveryErrors,
3089
+ variantCount,
3090
+ sync
3091
+ };
3092
+ if (approvalThreshold !== void 0) {
3093
+ requestData.approvalThreshold = approvalThreshold;
3094
+ }
3095
+ if (rejectionThreshold !== void 0) {
3096
+ requestData.rejectionThreshold = rejectionThreshold;
3097
+ }
2923
3098
  return this.request({
2924
3099
  url: `/builds/${buildId}/snapshot`,
2925
3100
  method: "POST",
@@ -2928,16 +3103,7 @@ var httpClient = class {
2928
3103
  projectToken: capsProjectToken !== "" ? capsProjectToken : this.projectToken
2929
3104
  // Use capsProjectToken dynamically
2930
3105
  },
2931
- data: {
2932
- snapshot,
2933
- test: {
2934
- type: ctx.testType,
2935
- source: "cli"
2936
- },
2937
- discoveryErrors,
2938
- variantCount,
2939
- sync
2940
- }
3106
+ data: requestData
2941
3107
  }, ctx.log);
2942
3108
  }
2943
3109
  uploadScreenshot({ id: buildId, name: buildName, baseline }, ssPath, ssName, browserName, viewport, url = "", log2) {
@@ -3229,7 +3395,7 @@ var httpClient = class {
3229
3395
  }
3230
3396
  };
3231
3397
  var ctx_default = (options) => {
3232
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
3398
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3233
3399
  let env = env_default();
3234
3400
  let webConfig;
3235
3401
  let mobileConfig;
@@ -3364,7 +3530,8 @@ var ctx_default = (options) => {
3364
3530
  useExtendedViewport,
3365
3531
  loadDomContent,
3366
3532
  approvalThreshold: config.approvalThreshold,
3367
- rejectionThreshold: config.rejectionThreshold
3533
+ rejectionThreshold: config.rejectionThreshold,
3534
+ showRenderErrors: (_k = config.showRenderErrors) != null ? _k : false
3368
3535
  },
3369
3536
  uploadFilePath: "",
3370
3537
  webStaticConfig: [],
@@ -3402,7 +3569,8 @@ var ctx_default = (options) => {
3402
3569
  fetchResultsFileName: fetchResultsFileObj,
3403
3570
  baselineBranch: options.baselineBranch || "",
3404
3571
  baselineBuild: options.baselineBuild || "",
3405
- githubURL: options.githubURL || ""
3572
+ githubURL: options.githubURL || "",
3573
+ showRenderErrors: options.showRenderErrors ? true : false
3406
3574
  },
3407
3575
  cliVersion: version,
3408
3576
  totalSnapshots: -1,
@@ -3630,17 +3798,26 @@ var exec_default = (ctx) => {
3630
3798
  startPolling(ctx2, "", false, "");
3631
3799
  }
3632
3800
  }
3801
+ if ((ctx2.env.SHOW_RENDER_ERRORS || ctx2.options.showRenderErrors || ctx2.config.showRenderErrors) && ctx2.build && ctx2.build.id) {
3802
+ if (ctx2.env.LT_USERNAME && ctx2.env.LT_ACCESS_KEY) {
3803
+ startSSEListener(ctx2);
3804
+ } else {
3805
+ ctx2.log.info("LT_USERNAME and LT_ACCESS_KEY are not set, set them to display render errors");
3806
+ }
3807
+ }
3633
3808
  updateLogContext({ task: "exec" });
3634
3809
  return new Promise((resolve, reject) => {
3635
3810
  var _a2, _b, _c;
3636
3811
  const childProcess = spawn__default.default(ctx2.args.execCommand[0], (_a2 = ctx2.args.execCommand) == null ? void 0 : _a2.slice(1));
3637
3812
  let totalOutput = "";
3638
- const output = listr2.createWritable((chunk) => {
3639
- totalOutput += chunk;
3640
- task.output = chalk__default.default.gray(totalOutput);
3641
- });
3642
- (_b = childProcess.stdout) == null ? void 0 : _b.pipe(output);
3643
- (_c = childProcess.stderr) == null ? void 0 : _c.pipe(output);
3813
+ if (!ctx2.env.LT_SDK_SKIP_EXECUTION_LOGS) {
3814
+ const output = listr2.createWritable((chunk) => {
3815
+ totalOutput += chunk;
3816
+ task.output = chalk__default.default.gray(totalOutput);
3817
+ });
3818
+ (_b = childProcess.stdout) == null ? void 0 : _b.pipe(output);
3819
+ (_c = childProcess.stderr) == null ? void 0 : _c.pipe(output);
3820
+ }
3644
3821
  childProcess.on("error", (error) => {
3645
3822
  var _a3;
3646
3823
  task.output = chalk__default.default.gray(`error: ${error.message}`);
@@ -4802,7 +4979,7 @@ var Queue = class {
4802
4979
  }
4803
4980
  processNext() {
4804
4981
  return __async(this, null, function* () {
4805
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
4982
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
4806
4983
  if (!this.isEmpty()) {
4807
4984
  let snapshot;
4808
4985
  if (this.ctx.config.delayedUpload) {
@@ -4875,9 +5052,11 @@ var Queue = class {
4875
5052
  }
4876
5053
  if (useCapsBuildId) {
4877
5054
  this.ctx.log.info(`Using cached buildId: ${capsBuildId}`);
5055
+ let approvalThreshold = ((_c = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _c.approvalThreshold) || this.ctx.config.approvalThreshold;
5056
+ let rejectionThreshold = ((_d = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _d.rejectionThreshold) || this.ctx.config.rejectionThreshold;
4878
5057
  if (useKafkaFlowCaps) {
4879
5058
  let snapshotUuid = uuid.v4();
4880
- if (((_c = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _c.contextId) && ((_d = this.ctx.contextToSnapshotMap) == null ? void 0 : _d.has(snapshot.options.contextId))) {
5059
+ if (((_e = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _e.contextId) && ((_f = this.ctx.contextToSnapshotMap) == null ? void 0 : _f.has(snapshot.options.contextId))) {
4881
5060
  snapshotUuid = snapshot.options.contextId;
4882
5061
  }
4883
5062
  let uploadDomToS3 = this.ctx.config.useLambdaInternal || uploadDomToS3ViaEnv3;
@@ -4890,19 +5069,19 @@ var Queue = class {
4890
5069
  this.ctx.log.debug(`Uploading dom to S3 for snapshot using LSRS`);
4891
5070
  yield this.ctx.client.sendDomToLSRSForCaps(this.ctx, processedSnapshot, snapshotUuid, capsBuildId, capsProjectToken);
4892
5071
  }
4893
- yield this.ctx.client.processSnapshotCaps(this.ctx, processedSnapshot, snapshotUuid, capsBuildId, capsProjectToken, discoveryErrors, calculateVariantCountFromSnapshot(processedSnapshot, this.ctx.config), (_e = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _e.sync);
5072
+ yield this.ctx.client.processSnapshotCaps(this.ctx, processedSnapshot, snapshotUuid, capsBuildId, capsProjectToken, discoveryErrors, calculateVariantCountFromSnapshot(processedSnapshot, this.ctx.config), (_g = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _g.sync, approvalThreshold, rejectionThreshold);
4894
5073
  } else {
4895
- yield this.ctx.client.uploadSnapshotForCaps(this.ctx, processedSnapshot, capsBuildId, capsProjectToken, discoveryErrors, calculateVariantCountFromSnapshot(processedSnapshot, this.ctx.config), (_f = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _f.sync);
5074
+ yield this.ctx.client.uploadSnapshotForCaps(this.ctx, processedSnapshot, capsBuildId, capsProjectToken, discoveryErrors, calculateVariantCountFromSnapshot(processedSnapshot, this.ctx.config), (_h = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _h.sync, approvalThreshold, rejectionThreshold);
4896
5075
  }
4897
5076
  const cachedCapabilities = this.ctx.sessionCapabilitiesMap.get(sessionId);
4898
5077
  const currentCount = (cachedCapabilities == null ? void 0 : cachedCapabilities.snapshotCount) || 0;
4899
5078
  cachedCapabilities.snapshotCount = currentCount + 1;
4900
5079
  this.ctx.sessionCapabilitiesMap.set(sessionId, cachedCapabilities);
4901
- if (((_g = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _g.contextId) && this.ctx.contextToSnapshotMap) {
5080
+ if (((_i = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _i.contextId) && this.ctx.contextToSnapshotMap) {
4902
5081
  this.ctx.contextToSnapshotMap.set(snapshot.options.contextId, capsBuildId);
4903
5082
  }
4904
5083
  } else {
4905
- if (!((_h = this.ctx.build) == null ? void 0 : _h.id)) {
5084
+ if (!((_j = this.ctx.build) == null ? void 0 : _j.id)) {
4906
5085
  if (this.ctx.authenticatedInitially) {
4907
5086
  let resp = yield this.ctx.client.createBuild(this.ctx.git, this.ctx.config, this.ctx.log, this.ctx.build.name, false, false, false, "");
4908
5087
  this.ctx.build = {
@@ -4927,7 +5106,7 @@ var Queue = class {
4927
5106
  if (this.ctx.build && this.ctx.build.useKafkaFlow) {
4928
5107
  let snapshotUuid = uuid.v4();
4929
5108
  let snapshotUploadResponse;
4930
- if (((_i = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _i.contextId) && ((_j = this.ctx.contextToSnapshotMap) == null ? void 0 : _j.has(snapshot.options.contextId))) {
5109
+ if (((_k = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _k.contextId) && ((_l = this.ctx.contextToSnapshotMap) == null ? void 0 : _l.has(snapshot.options.contextId))) {
4931
5110
  snapshotUuid = snapshot.options.contextId;
4932
5111
  }
4933
5112
  let uploadDomToS3 = this.ctx.config.useLambdaInternal || uploadDomToS3ViaEnv3;
@@ -4953,18 +5132,18 @@ var Queue = class {
4953
5132
  this.ctx.log.debug(`Closed browser context for snapshot ${snapshot.name}`);
4954
5133
  }
4955
5134
  }
4956
- if ((_k = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _k.contextId) {
4957
- (_m = this.ctx.contextToSnapshotMap) == null ? void 0 : _m.set((_l = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _l.contextId, "2");
5135
+ if ((_m = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _m.contextId) {
5136
+ (_o = this.ctx.contextToSnapshotMap) == null ? void 0 : _o.set((_n = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _n.contextId, "2");
4958
5137
  }
4959
5138
  this.processNext();
4960
5139
  } else {
4961
- let approvalThreshold = ((_n = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _n.approvalThreshold) || this.ctx.config.approvalThreshold;
4962
- let rejectionThreshold = ((_o = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _o.rejectionThreshold) || this.ctx.config.rejectionThreshold;
4963
- yield this.ctx.client.processSnapshot(this.ctx, processedSnapshot, snapshotUuid, discoveryErrors, calculateVariantCountFromSnapshot(processedSnapshot, this.ctx.config), (_p = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _p.sync, approvalThreshold, rejectionThreshold);
4964
- if (((_q = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _q.contextId) && ((_r = this.ctx.contextToSnapshotMap) == null ? void 0 : _r.has(snapshot.options.contextId))) {
5140
+ let approvalThreshold = ((_p = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _p.approvalThreshold) || this.ctx.config.approvalThreshold;
5141
+ let rejectionThreshold = ((_q = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _q.rejectionThreshold) || this.ctx.config.rejectionThreshold;
5142
+ yield this.ctx.client.processSnapshot(this.ctx, processedSnapshot, snapshotUuid, discoveryErrors, calculateVariantCountFromSnapshot(processedSnapshot, this.ctx.config), (_r = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _r.sync, approvalThreshold, rejectionThreshold);
5143
+ if (((_s = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _s.contextId) && ((_t = this.ctx.contextToSnapshotMap) == null ? void 0 : _t.has(snapshot.options.contextId))) {
4965
5144
  this.ctx.contextToSnapshotMap.set(snapshot.options.contextId, this.ctx.build.id);
4966
5145
  }
4967
- this.ctx.log.debug(`ContextId: ${(_s = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _s.contextId} status set to uploaded`);
5146
+ this.ctx.log.debug(`ContextId: ${(_u = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _u.contextId} status set to uploaded`);
4968
5147
  }
4969
5148
  } else {
4970
5149
  this.ctx.log.info(`Uploading snapshot to S3`);
@@ -4977,7 +5156,7 @@ var Queue = class {
4977
5156
  } catch (error) {
4978
5157
  this.ctx.log.debug(`snapshot failed; ${error}`);
4979
5158
  this.processedSnapshots.push({ name: snapshot == null ? void 0 : snapshot.name, error: error.message });
4980
- if (((_t = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _t.contextId) && this.ctx.contextToSnapshotMap) {
5159
+ if (((_v = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _v.contextId) && this.ctx.contextToSnapshotMap) {
4981
5160
  this.ctx.contextToSnapshotMap.set(snapshot.options.contextId, "2");
4982
5161
  }
4983
5162
  }
@@ -5033,7 +5212,7 @@ var startTunnel_default = (ctx) => {
5033
5212
 
5034
5213
  // src/commander/exec.ts
5035
5214
  var command = new commander.Command();
5036
- command.name("exec").description("Run test commands around SmartUI").argument("<command...>", "Command supplied for running tests").option("-P, --port <number>", "Port number for the server").option("--fetch-results [filename]", "Fetch results and optionally specify an output file, e.g., <filename>.json").option("--buildName <string>", "Specify the build name").option("--scheduled <string>", "Specify the schedule ID").option("--userName <string>", "Specify the LT username").option("--accessKey <string>", "Specify the LT accesskey").action(function(execCommand, _, command11) {
5215
+ command.name("exec").description("Run test commands around SmartUI").argument("<command...>", "Command supplied for running tests").option("-P, --port <number>", "Port number for the server").option("--fetch-results [filename]", "Fetch results and optionally specify an output file, e.g., <filename>.json").option("--buildName <string>", "Specify the build name").option("--scheduled <string>", "Specify the schedule ID").option("--userName <string>", "Specify the LT username").option("--accessKey <string>", "Specify the LT accesskey").option("--show-render-errors", "Show render errors from SmartUI build").action(function(execCommand, _, command11) {
5037
5216
  return __async(this, null, function* () {
5038
5217
  var _a;
5039
5218
  const options = command11.optsWithGlobals();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdatest/smartui-cli",
3
- "version": "4.1.37-beta.0",
3
+ "version": "4.1.38-beta.0",
4
4
  "description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
5
5
  "files": [
6
6
  "dist/**/*"