@lambdatest/smartui-cli 4.1.37-beta.0 → 4.1.37
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 +224 -49
- 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,9 @@ 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"
|
|
2384
2532
|
} = process.env;
|
|
2385
2533
|
return {
|
|
2386
2534
|
PROJECT_TOKEN,
|
|
@@ -2403,7 +2551,9 @@ var env_default = () => {
|
|
|
2403
2551
|
SMARTUI_API_PROXY,
|
|
2404
2552
|
SMARTUI_API_SKIP_CERTIFICATES: SMARTUI_API_SKIP_CERTIFICATES === "true",
|
|
2405
2553
|
USE_REMOTE_DISCOVERY: USE_REMOTE_DISCOVERY === "true",
|
|
2406
|
-
SMART_GIT: SMART_GIT === "true"
|
|
2554
|
+
SMART_GIT: SMART_GIT === "true",
|
|
2555
|
+
SHOW_RENDER_ERRORS: SHOW_RENDER_ERRORS === "true",
|
|
2556
|
+
SMARTUI_SSE_URL
|
|
2407
2557
|
};
|
|
2408
2558
|
};
|
|
2409
2559
|
var logContext = {};
|
|
@@ -2498,7 +2648,7 @@ var authExec_default = (ctx) => {
|
|
|
2498
2648
|
};
|
|
2499
2649
|
|
|
2500
2650
|
// package.json
|
|
2501
|
-
var version = "4.1.37
|
|
2651
|
+
var version = "4.1.37";
|
|
2502
2652
|
var package_default = {
|
|
2503
2653
|
name: "@lambdatest/smartui-cli",
|
|
2504
2654
|
version,
|
|
@@ -2895,7 +3045,26 @@ var httpClient = class {
|
|
|
2895
3045
|
data: requestData
|
|
2896
3046
|
}, ctx.log);
|
|
2897
3047
|
}
|
|
2898
|
-
processSnapshotCaps(ctx, snapshot, snapshotUuid, capsBuildId, capsProjectToken, discoveryErrors, variantCount, sync = false) {
|
|
3048
|
+
processSnapshotCaps(ctx, snapshot, snapshotUuid, capsBuildId, capsProjectToken, discoveryErrors, variantCount, sync = false, approvalThreshold, rejectionThreshold) {
|
|
3049
|
+
const requestData = {
|
|
3050
|
+
name: snapshot.name,
|
|
3051
|
+
url: snapshot.url,
|
|
3052
|
+
snapshotUuid,
|
|
3053
|
+
variantCount,
|
|
3054
|
+
test: {
|
|
3055
|
+
type: ctx.testType,
|
|
3056
|
+
source: "cli"
|
|
3057
|
+
},
|
|
3058
|
+
doRemoteDiscovery: snapshot.options.doRemoteDiscovery,
|
|
3059
|
+
discoveryErrors,
|
|
3060
|
+
sync
|
|
3061
|
+
};
|
|
3062
|
+
if (approvalThreshold !== void 0) {
|
|
3063
|
+
requestData.approvalThreshold = approvalThreshold;
|
|
3064
|
+
}
|
|
3065
|
+
if (rejectionThreshold !== void 0) {
|
|
3066
|
+
requestData.rejectionThreshold = rejectionThreshold;
|
|
3067
|
+
}
|
|
2899
3068
|
return this.request({
|
|
2900
3069
|
url: `/build/${capsBuildId}/snapshot`,
|
|
2901
3070
|
method: "POST",
|
|
@@ -2903,23 +3072,27 @@ var httpClient = class {
|
|
|
2903
3072
|
"Content-Type": "application/json",
|
|
2904
3073
|
projectToken: capsProjectToken !== "" ? capsProjectToken : this.projectToken
|
|
2905
3074
|
},
|
|
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
|
-
}
|
|
3075
|
+
data: requestData
|
|
2919
3076
|
}, ctx.log);
|
|
2920
3077
|
}
|
|
2921
|
-
uploadSnapshotForCaps(ctx, snapshot, capsBuildId, capsProjectToken, discoveryErrors, variantCount, sync = false) {
|
|
3078
|
+
uploadSnapshotForCaps(ctx, snapshot, capsBuildId, capsProjectToken, discoveryErrors, variantCount, sync = false, approvalThreshold, rejectionThreshold) {
|
|
2922
3079
|
const buildId = capsBuildId !== "" ? capsBuildId : ctx.build.id;
|
|
3080
|
+
const requestData = {
|
|
3081
|
+
snapshot,
|
|
3082
|
+
test: {
|
|
3083
|
+
type: ctx.testType,
|
|
3084
|
+
source: "cli"
|
|
3085
|
+
},
|
|
3086
|
+
discoveryErrors,
|
|
3087
|
+
variantCount,
|
|
3088
|
+
sync
|
|
3089
|
+
};
|
|
3090
|
+
if (approvalThreshold !== void 0) {
|
|
3091
|
+
requestData.approvalThreshold = approvalThreshold;
|
|
3092
|
+
}
|
|
3093
|
+
if (rejectionThreshold !== void 0) {
|
|
3094
|
+
requestData.rejectionThreshold = rejectionThreshold;
|
|
3095
|
+
}
|
|
2923
3096
|
return this.request({
|
|
2924
3097
|
url: `/builds/${buildId}/snapshot`,
|
|
2925
3098
|
method: "POST",
|
|
@@ -2928,16 +3101,7 @@ var httpClient = class {
|
|
|
2928
3101
|
projectToken: capsProjectToken !== "" ? capsProjectToken : this.projectToken
|
|
2929
3102
|
// Use capsProjectToken dynamically
|
|
2930
3103
|
},
|
|
2931
|
-
data:
|
|
2932
|
-
snapshot,
|
|
2933
|
-
test: {
|
|
2934
|
-
type: ctx.testType,
|
|
2935
|
-
source: "cli"
|
|
2936
|
-
},
|
|
2937
|
-
discoveryErrors,
|
|
2938
|
-
variantCount,
|
|
2939
|
-
sync
|
|
2940
|
-
}
|
|
3104
|
+
data: requestData
|
|
2941
3105
|
}, ctx.log);
|
|
2942
3106
|
}
|
|
2943
3107
|
uploadScreenshot({ id: buildId, name: buildName, baseline }, ssPath, ssName, browserName, viewport, url = "", log2) {
|
|
@@ -3229,7 +3393,7 @@ var httpClient = class {
|
|
|
3229
3393
|
}
|
|
3230
3394
|
};
|
|
3231
3395
|
var ctx_default = (options) => {
|
|
3232
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
3396
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
3233
3397
|
let env = env_default();
|
|
3234
3398
|
let webConfig;
|
|
3235
3399
|
let mobileConfig;
|
|
@@ -3364,7 +3528,8 @@ var ctx_default = (options) => {
|
|
|
3364
3528
|
useExtendedViewport,
|
|
3365
3529
|
loadDomContent,
|
|
3366
3530
|
approvalThreshold: config.approvalThreshold,
|
|
3367
|
-
rejectionThreshold: config.rejectionThreshold
|
|
3531
|
+
rejectionThreshold: config.rejectionThreshold,
|
|
3532
|
+
showRenderErrors: (_k = config.showRenderErrors) != null ? _k : false
|
|
3368
3533
|
},
|
|
3369
3534
|
uploadFilePath: "",
|
|
3370
3535
|
webStaticConfig: [],
|
|
@@ -3402,7 +3567,8 @@ var ctx_default = (options) => {
|
|
|
3402
3567
|
fetchResultsFileName: fetchResultsFileObj,
|
|
3403
3568
|
baselineBranch: options.baselineBranch || "",
|
|
3404
3569
|
baselineBuild: options.baselineBuild || "",
|
|
3405
|
-
githubURL: options.githubURL || ""
|
|
3570
|
+
githubURL: options.githubURL || "",
|
|
3571
|
+
showRenderErrors: options.showRenderErrors ? true : false
|
|
3406
3572
|
},
|
|
3407
3573
|
cliVersion: version,
|
|
3408
3574
|
totalSnapshots: -1,
|
|
@@ -3630,6 +3796,13 @@ var exec_default = (ctx) => {
|
|
|
3630
3796
|
startPolling(ctx2, "", false, "");
|
|
3631
3797
|
}
|
|
3632
3798
|
}
|
|
3799
|
+
if ((ctx2.env.SHOW_RENDER_ERRORS || ctx2.options.showRenderErrors || ctx2.config.showRenderErrors) && ctx2.build && ctx2.build.id) {
|
|
3800
|
+
if (ctx2.env.LT_USERNAME && ctx2.env.LT_ACCESS_KEY) {
|
|
3801
|
+
startSSEListener(ctx2);
|
|
3802
|
+
} else {
|
|
3803
|
+
ctx2.log.info("LT_USERNAME and LT_ACCESS_KEY are not set, set them to display render errors");
|
|
3804
|
+
}
|
|
3805
|
+
}
|
|
3633
3806
|
updateLogContext({ task: "exec" });
|
|
3634
3807
|
return new Promise((resolve, reject) => {
|
|
3635
3808
|
var _a2, _b, _c;
|
|
@@ -4802,7 +4975,7 @@ var Queue = class {
|
|
|
4802
4975
|
}
|
|
4803
4976
|
processNext() {
|
|
4804
4977
|
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;
|
|
4978
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
4806
4979
|
if (!this.isEmpty()) {
|
|
4807
4980
|
let snapshot;
|
|
4808
4981
|
if (this.ctx.config.delayedUpload) {
|
|
@@ -4875,9 +5048,11 @@ var Queue = class {
|
|
|
4875
5048
|
}
|
|
4876
5049
|
if (useCapsBuildId) {
|
|
4877
5050
|
this.ctx.log.info(`Using cached buildId: ${capsBuildId}`);
|
|
5051
|
+
let approvalThreshold = ((_c = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _c.approvalThreshold) || this.ctx.config.approvalThreshold;
|
|
5052
|
+
let rejectionThreshold = ((_d = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _d.rejectionThreshold) || this.ctx.config.rejectionThreshold;
|
|
4878
5053
|
if (useKafkaFlowCaps) {
|
|
4879
5054
|
let snapshotUuid = uuid.v4();
|
|
4880
|
-
if (((
|
|
5055
|
+
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
5056
|
snapshotUuid = snapshot.options.contextId;
|
|
4882
5057
|
}
|
|
4883
5058
|
let uploadDomToS3 = this.ctx.config.useLambdaInternal || uploadDomToS3ViaEnv3;
|
|
@@ -4890,19 +5065,19 @@ var Queue = class {
|
|
|
4890
5065
|
this.ctx.log.debug(`Uploading dom to S3 for snapshot using LSRS`);
|
|
4891
5066
|
yield this.ctx.client.sendDomToLSRSForCaps(this.ctx, processedSnapshot, snapshotUuid, capsBuildId, capsProjectToken);
|
|
4892
5067
|
}
|
|
4893
|
-
yield this.ctx.client.processSnapshotCaps(this.ctx, processedSnapshot, snapshotUuid, capsBuildId, capsProjectToken, discoveryErrors, calculateVariantCountFromSnapshot(processedSnapshot, this.ctx.config), (
|
|
5068
|
+
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
5069
|
} else {
|
|
4895
|
-
yield this.ctx.client.uploadSnapshotForCaps(this.ctx, processedSnapshot, capsBuildId, capsProjectToken, discoveryErrors, calculateVariantCountFromSnapshot(processedSnapshot, this.ctx.config), (
|
|
5070
|
+
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
5071
|
}
|
|
4897
5072
|
const cachedCapabilities = this.ctx.sessionCapabilitiesMap.get(sessionId);
|
|
4898
5073
|
const currentCount = (cachedCapabilities == null ? void 0 : cachedCapabilities.snapshotCount) || 0;
|
|
4899
5074
|
cachedCapabilities.snapshotCount = currentCount + 1;
|
|
4900
5075
|
this.ctx.sessionCapabilitiesMap.set(sessionId, cachedCapabilities);
|
|
4901
|
-
if (((
|
|
5076
|
+
if (((_i = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _i.contextId) && this.ctx.contextToSnapshotMap) {
|
|
4902
5077
|
this.ctx.contextToSnapshotMap.set(snapshot.options.contextId, capsBuildId);
|
|
4903
5078
|
}
|
|
4904
5079
|
} else {
|
|
4905
|
-
if (!((
|
|
5080
|
+
if (!((_j = this.ctx.build) == null ? void 0 : _j.id)) {
|
|
4906
5081
|
if (this.ctx.authenticatedInitially) {
|
|
4907
5082
|
let resp = yield this.ctx.client.createBuild(this.ctx.git, this.ctx.config, this.ctx.log, this.ctx.build.name, false, false, false, "");
|
|
4908
5083
|
this.ctx.build = {
|
|
@@ -4927,7 +5102,7 @@ var Queue = class {
|
|
|
4927
5102
|
if (this.ctx.build && this.ctx.build.useKafkaFlow) {
|
|
4928
5103
|
let snapshotUuid = uuid.v4();
|
|
4929
5104
|
let snapshotUploadResponse;
|
|
4930
|
-
if (((
|
|
5105
|
+
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
5106
|
snapshotUuid = snapshot.options.contextId;
|
|
4932
5107
|
}
|
|
4933
5108
|
let uploadDomToS3 = this.ctx.config.useLambdaInternal || uploadDomToS3ViaEnv3;
|
|
@@ -4953,18 +5128,18 @@ var Queue = class {
|
|
|
4953
5128
|
this.ctx.log.debug(`Closed browser context for snapshot ${snapshot.name}`);
|
|
4954
5129
|
}
|
|
4955
5130
|
}
|
|
4956
|
-
if ((
|
|
4957
|
-
(
|
|
5131
|
+
if ((_m = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _m.contextId) {
|
|
5132
|
+
(_o = this.ctx.contextToSnapshotMap) == null ? void 0 : _o.set((_n = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _n.contextId, "2");
|
|
4958
5133
|
}
|
|
4959
5134
|
this.processNext();
|
|
4960
5135
|
} else {
|
|
4961
|
-
let approvalThreshold = ((
|
|
4962
|
-
let rejectionThreshold = ((
|
|
4963
|
-
yield this.ctx.client.processSnapshot(this.ctx, processedSnapshot, snapshotUuid, discoveryErrors, calculateVariantCountFromSnapshot(processedSnapshot, this.ctx.config), (
|
|
4964
|
-
if (((
|
|
5136
|
+
let approvalThreshold = ((_p = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _p.approvalThreshold) || this.ctx.config.approvalThreshold;
|
|
5137
|
+
let rejectionThreshold = ((_q = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _q.rejectionThreshold) || this.ctx.config.rejectionThreshold;
|
|
5138
|
+
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);
|
|
5139
|
+
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
5140
|
this.ctx.contextToSnapshotMap.set(snapshot.options.contextId, this.ctx.build.id);
|
|
4966
5141
|
}
|
|
4967
|
-
this.ctx.log.debug(`ContextId: ${(
|
|
5142
|
+
this.ctx.log.debug(`ContextId: ${(_u = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _u.contextId} status set to uploaded`);
|
|
4968
5143
|
}
|
|
4969
5144
|
} else {
|
|
4970
5145
|
this.ctx.log.info(`Uploading snapshot to S3`);
|
|
@@ -4977,7 +5152,7 @@ var Queue = class {
|
|
|
4977
5152
|
} catch (error) {
|
|
4978
5153
|
this.ctx.log.debug(`snapshot failed; ${error}`);
|
|
4979
5154
|
this.processedSnapshots.push({ name: snapshot == null ? void 0 : snapshot.name, error: error.message });
|
|
4980
|
-
if (((
|
|
5155
|
+
if (((_v = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _v.contextId) && this.ctx.contextToSnapshotMap) {
|
|
4981
5156
|
this.ctx.contextToSnapshotMap.set(snapshot.options.contextId, "2");
|
|
4982
5157
|
}
|
|
4983
5158
|
}
|
|
@@ -5033,7 +5208,7 @@ var startTunnel_default = (ctx) => {
|
|
|
5033
5208
|
|
|
5034
5209
|
// src/commander/exec.ts
|
|
5035
5210
|
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) {
|
|
5211
|
+
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
5212
|
return __async(this, null, function* () {
|
|
5038
5213
|
var _a;
|
|
5039
5214
|
const options = command11.optsWithGlobals();
|