@lambdatest/smartui-cli 4.1.47 → 4.1.49
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 +110 -142
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -82,8 +82,7 @@ var __spreadValues = (a, b) => {
|
|
|
82
82
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
83
83
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
84
84
|
}) : x)(function(x) {
|
|
85
|
-
if (typeof require !== "undefined")
|
|
86
|
-
return require.apply(this, arguments);
|
|
85
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
87
86
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
88
87
|
});
|
|
89
88
|
var __commonJS = (cb, mod) => function __require2() {
|
|
@@ -165,10 +164,8 @@ var require_find_free_port = __commonJS({
|
|
|
165
164
|
} else {
|
|
166
165
|
return new Promise((resolve, reject) => {
|
|
167
166
|
findFreePort(beg, ...rest, (err, ...ports) => {
|
|
168
|
-
if (err)
|
|
169
|
-
|
|
170
|
-
else
|
|
171
|
-
resolve(ports);
|
|
167
|
+
if (err) reject(err);
|
|
168
|
+
else resolve(ports);
|
|
172
169
|
});
|
|
173
170
|
});
|
|
174
171
|
}
|
|
@@ -1568,10 +1565,8 @@ function launchBrowsers(ctx) {
|
|
|
1568
1565
|
}
|
|
1569
1566
|
if (ctx.config.mobile) {
|
|
1570
1567
|
for (const device of ctx.config.mobile.devices) {
|
|
1571
|
-
if (constants_default.SUPPORTED_MOBILE_DEVICES[device].os === "android" && !browsers[constants_default.CHROME])
|
|
1572
|
-
|
|
1573
|
-
else if (constants_default.SUPPORTED_MOBILE_DEVICES[device].os === "ios" && !browsers[constants_default.SAFARI])
|
|
1574
|
-
browsers[constants_default.SAFARI] = yield test.webkit.launch(launchOptions);
|
|
1568
|
+
if (constants_default.SUPPORTED_MOBILE_DEVICES[device].os === "android" && !browsers[constants_default.CHROME]) browsers[constants_default.CHROME] = yield test.chromium.launch(launchOptions);
|
|
1569
|
+
else if (constants_default.SUPPORTED_MOBILE_DEVICES[device].os === "ios" && !browsers[constants_default.SAFARI]) browsers[constants_default.SAFARI] = yield test.webkit.launch(launchOptions);
|
|
1575
1570
|
}
|
|
1576
1571
|
}
|
|
1577
1572
|
return browsers;
|
|
@@ -1580,8 +1575,7 @@ function launchBrowsers(ctx) {
|
|
|
1580
1575
|
function closeBrowsers(browsers) {
|
|
1581
1576
|
return __async(this, null, function* () {
|
|
1582
1577
|
var _a;
|
|
1583
|
-
for (const browserName of Object.keys(browsers))
|
|
1584
|
-
yield (_a = browsers[browserName]) == null ? void 0 : _a.close();
|
|
1578
|
+
for (const browserName of Object.keys(browsers)) yield (_a = browsers[browserName]) == null ? void 0 : _a.close();
|
|
1585
1579
|
});
|
|
1586
1580
|
}
|
|
1587
1581
|
function getWebRenderViewports(ctx) {
|
|
@@ -1694,7 +1688,7 @@ function startPolling(ctx, build_id, baseline, projectToken) {
|
|
|
1694
1688
|
} else if (ctx.build && ctx.build.id) {
|
|
1695
1689
|
ctx.log.info(`Fetching results for buildId ${ctx.build.id} in progress....`);
|
|
1696
1690
|
}
|
|
1697
|
-
const intervalId = setInterval(() => __async(
|
|
1691
|
+
const intervalId = setInterval(() => __async(null, null, function* () {
|
|
1698
1692
|
try {
|
|
1699
1693
|
let resp;
|
|
1700
1694
|
if (build_id) {
|
|
@@ -1773,7 +1767,7 @@ function startPingPolling(ctx) {
|
|
|
1773
1767
|
ctx.log.error(`Error during initial ping: ${error.message}`);
|
|
1774
1768
|
}
|
|
1775
1769
|
let sourceCommand = ctx.sourceCommand ? ctx.sourceCommand : "";
|
|
1776
|
-
pingIntervalId = setInterval(() => __async(
|
|
1770
|
+
pingIntervalId = setInterval(() => __async(null, null, function* () {
|
|
1777
1771
|
try {
|
|
1778
1772
|
ctx.log.debug("Sending ping to server... " + sourceCommand);
|
|
1779
1773
|
yield ctx.client.ping(ctx.build.id, ctx.log);
|
|
@@ -1847,7 +1841,7 @@ function startPollingForTunnel(ctx, build_id, baseline, projectToken, buildName)
|
|
|
1847
1841
|
ctx.log.debug("Tunnel polling is already active. Skipping for build_id: " + build_id);
|
|
1848
1842
|
return;
|
|
1849
1843
|
}
|
|
1850
|
-
const intervalId = setInterval(() => __async(
|
|
1844
|
+
const intervalId = setInterval(() => __async(null, null, function* () {
|
|
1851
1845
|
try {
|
|
1852
1846
|
let resp;
|
|
1853
1847
|
if (build_id) {
|
|
@@ -1939,7 +1933,7 @@ function startPdfPolling(ctx) {
|
|
|
1939
1933
|
let attempts = 0;
|
|
1940
1934
|
const maxAttempts = 60;
|
|
1941
1935
|
console.log(chalk__default.default.yellow("Waiting for results..."));
|
|
1942
|
-
const interval = setInterval(() => __async(
|
|
1936
|
+
const interval = setInterval(() => __async(null, null, function* () {
|
|
1943
1937
|
var _a;
|
|
1944
1938
|
attempts++;
|
|
1945
1939
|
try {
|
|
@@ -2134,8 +2128,7 @@ function listenToSmartUISSE(baseURL, accessToken, ctx, onEvent) {
|
|
|
2134
2128
|
try {
|
|
2135
2129
|
while (true) {
|
|
2136
2130
|
const { done, value } = yield reader.read();
|
|
2137
|
-
if (done)
|
|
2138
|
-
break;
|
|
2131
|
+
if (done) break;
|
|
2139
2132
|
const chunk = decoder.decode(value, { stream: true });
|
|
2140
2133
|
buffer += chunk;
|
|
2141
2134
|
const lines = buffer.split("\n");
|
|
@@ -2377,7 +2370,7 @@ function findAvailablePort(server, startPort, log2) {
|
|
|
2377
2370
|
}
|
|
2378
2371
|
});
|
|
2379
2372
|
}
|
|
2380
|
-
var server_default = (ctx) => __async(
|
|
2373
|
+
var server_default = (ctx) => __async(null, null, function* () {
|
|
2381
2374
|
const server = fastify__default.default({
|
|
2382
2375
|
logger: {
|
|
2383
2376
|
level: "debug",
|
|
@@ -2395,14 +2388,13 @@ var server_default = (ctx) => __async(void 0, null, function* () {
|
|
|
2395
2388
|
server.get("/domserializer", opts, (request, reply) => {
|
|
2396
2389
|
reply.code(200).send({ data: { dom: SMARTUI_DOM } });
|
|
2397
2390
|
});
|
|
2398
|
-
server.post("/snapshot", opts, (request, reply) => __async(
|
|
2391
|
+
server.post("/snapshot", opts, (request, reply) => __async(null, null, function* () {
|
|
2399
2392
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2400
2393
|
let replyCode;
|
|
2401
2394
|
let replyBody;
|
|
2402
2395
|
try {
|
|
2403
2396
|
let { snapshot, testType } = request.body;
|
|
2404
|
-
if (!validateSnapshot(snapshot))
|
|
2405
|
-
throw new Error(validateSnapshot.errors[0].message);
|
|
2397
|
+
if (!validateSnapshot(snapshot)) throw new Error(validateSnapshot.errors[0].message);
|
|
2406
2398
|
if (((_a = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _a.approvalThreshold) !== void 0 && ((_b = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _b.rejectionThreshold) !== void 0) {
|
|
2407
2399
|
if (((_c = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _c.rejectionThreshold) <= ((_d = snapshot == null ? void 0 : snapshot.options) == null ? void 0 : _d.approvalThreshold)) {
|
|
2408
2400
|
throw new Error(`Invalid snapshot options; rejectionThreshold (${snapshot.options.rejectionThreshold}) must be greater than approvalThreshold (${snapshot.options.approvalThreshold})`);
|
|
@@ -2458,7 +2450,7 @@ var server_default = (ctx) => __async(void 0, null, function* () {
|
|
|
2458
2450
|
}
|
|
2459
2451
|
return reply.code(replyCode).send(replyBody);
|
|
2460
2452
|
}));
|
|
2461
|
-
server.post("/stop", opts, (_, reply) => __async(
|
|
2453
|
+
server.post("/stop", opts, (_, reply) => __async(null, null, function* () {
|
|
2462
2454
|
var _a, _b, _c, _d;
|
|
2463
2455
|
let replyCode;
|
|
2464
2456
|
let replyBody;
|
|
@@ -2540,7 +2532,7 @@ var server_default = (ctx) => __async(void 0, null, function* () {
|
|
|
2540
2532
|
server.get("/ping", opts, (_, reply) => {
|
|
2541
2533
|
reply.code(200).send({ status: "Server is running", version: ctx.cliVersion });
|
|
2542
2534
|
});
|
|
2543
|
-
server.get("/snapshot/status", opts, (request, reply) => __async(
|
|
2535
|
+
server.get("/snapshot/status", opts, (request, reply) => __async(null, null, function* () {
|
|
2544
2536
|
var _a;
|
|
2545
2537
|
let replyCode;
|
|
2546
2538
|
let replyBody;
|
|
@@ -2630,7 +2622,7 @@ var server_default = (ctx) => __async(void 0, null, function* () {
|
|
|
2630
2622
|
return reply.code(replyCode).send(replyBody);
|
|
2631
2623
|
}
|
|
2632
2624
|
}));
|
|
2633
|
-
server.get("/build/info", opts, (request, reply) => __async(
|
|
2625
|
+
server.get("/build/info", opts, (request, reply) => __async(null, null, function* () {
|
|
2634
2626
|
let replyCode;
|
|
2635
2627
|
let replyBody;
|
|
2636
2628
|
try {
|
|
@@ -2774,7 +2766,7 @@ var logger_default = logger;
|
|
|
2774
2766
|
var startServer_default = (ctx) => {
|
|
2775
2767
|
return {
|
|
2776
2768
|
title: `Setting up SmartUI server`,
|
|
2777
|
-
task: (ctx2, task) => __async(
|
|
2769
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
2778
2770
|
var _a;
|
|
2779
2771
|
updateLogContext({ task: "startServer" });
|
|
2780
2772
|
try {
|
|
@@ -2793,7 +2785,7 @@ var startServer_default = (ctx) => {
|
|
|
2793
2785
|
var authExec_default = (ctx) => {
|
|
2794
2786
|
return {
|
|
2795
2787
|
title: `Authenticating with SmartUI`,
|
|
2796
|
-
task: (ctx2, task) => __async(
|
|
2788
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
2797
2789
|
updateLogContext({ task: "auth" });
|
|
2798
2790
|
try {
|
|
2799
2791
|
if (!ctx2.env.PROJECT_NAME && !ctx2.env.PROJECT_TOKEN) {
|
|
@@ -2825,7 +2817,7 @@ var authExec_default = (ctx) => {
|
|
|
2825
2817
|
};
|
|
2826
2818
|
|
|
2827
2819
|
// package.json
|
|
2828
|
-
var version = "4.1.
|
|
2820
|
+
var version = "4.1.49";
|
|
2829
2821
|
var package_default = {
|
|
2830
2822
|
name: "@lambdatest/smartui-cli",
|
|
2831
2823
|
version,
|
|
@@ -2873,7 +2865,6 @@ var package_default = {
|
|
|
2873
2865
|
"node-cache": "^5.1.2",
|
|
2874
2866
|
postcss: "^8.5.6",
|
|
2875
2867
|
sharp: "^0.33.4",
|
|
2876
|
-
tsup: "^7.2.0",
|
|
2877
2868
|
uuid: "^11.0.3",
|
|
2878
2869
|
which: "^4.0.0",
|
|
2879
2870
|
winston: "^3.10.0"
|
|
@@ -2883,7 +2874,8 @@ var package_default = {
|
|
|
2883
2874
|
},
|
|
2884
2875
|
devDependencies: {
|
|
2885
2876
|
"find-free-port": "^2.0.0",
|
|
2886
|
-
typescript: "^5.3.2"
|
|
2877
|
+
typescript: "^5.3.2",
|
|
2878
|
+
tsup: "^8.5.1"
|
|
2887
2879
|
}
|
|
2888
2880
|
};
|
|
2889
2881
|
var httpClient = class {
|
|
@@ -2970,10 +2962,10 @@ var httpClient = class {
|
|
|
2970
2962
|
request(config, log2) {
|
|
2971
2963
|
return __async(this, null, function* () {
|
|
2972
2964
|
log2.debug(`http request: ${config.method} ${config.url}`);
|
|
2973
|
-
if (config && config.data && !config.data.skipLogging && !config.data.name && !config.data.snapshot) {
|
|
2965
|
+
if (config && config.data && !config.data.skipLogging && !config.data.name && !config.data.snapshot && config.method !== "PUT") {
|
|
2974
2966
|
log2.debug(config.data);
|
|
2975
2967
|
}
|
|
2976
|
-
if (config && config.data && !config.data.skipLogging && config.data.snapshotUuid) {
|
|
2968
|
+
if (config && config.data && !config.data.skipLogging && config.data.snapshotUuid && config.method !== "PUT") {
|
|
2977
2969
|
log2.debug(config.data);
|
|
2978
2970
|
}
|
|
2979
2971
|
return this.axiosInstance.request(config).then((resp) => {
|
|
@@ -3161,7 +3153,8 @@ var httpClient = class {
|
|
|
3161
3153
|
git,
|
|
3162
3154
|
config,
|
|
3163
3155
|
isStartExec,
|
|
3164
|
-
baselineBuild
|
|
3156
|
+
baselineBuild,
|
|
3157
|
+
packageVersion: package_default.version
|
|
3165
3158
|
},
|
|
3166
3159
|
headers: {
|
|
3167
3160
|
projectToken: "",
|
|
@@ -3173,8 +3166,7 @@ var httpClient = class {
|
|
|
3173
3166
|
}
|
|
3174
3167
|
finalizeBuild(buildId, totalSnapshots, log2) {
|
|
3175
3168
|
let params = { buildId };
|
|
3176
|
-
if (totalSnapshots > -1)
|
|
3177
|
-
params.totalSnapshots = totalSnapshots;
|
|
3169
|
+
if (totalSnapshots > -1) params.totalSnapshots = totalSnapshots;
|
|
3178
3170
|
return this.request({
|
|
3179
3171
|
url: "/build",
|
|
3180
3172
|
method: "DELETE",
|
|
@@ -3183,8 +3175,7 @@ var httpClient = class {
|
|
|
3183
3175
|
}
|
|
3184
3176
|
finalizeBuildForCapsWithToken(buildId, totalSnapshots, projectToken, log2) {
|
|
3185
3177
|
let params = { buildId };
|
|
3186
|
-
if (totalSnapshots > -1)
|
|
3187
|
-
params.totalSnapshots = totalSnapshots;
|
|
3178
|
+
if (totalSnapshots > -1) params.totalSnapshots = totalSnapshots;
|
|
3188
3179
|
return this.request({
|
|
3189
3180
|
url: "/build",
|
|
3190
3181
|
method: "DELETE",
|
|
@@ -3440,6 +3431,23 @@ var httpClient = class {
|
|
|
3440
3431
|
}, ctx.log);
|
|
3441
3432
|
}
|
|
3442
3433
|
uploadLogs(ctx, uploadURL) {
|
|
3434
|
+
const fileStream = fs6__default.default.createReadStream(constants_default.LOG_FILE_PATH);
|
|
3435
|
+
const { size } = fs6__default.default.statSync(constants_default.LOG_FILE_PATH);
|
|
3436
|
+
return this.request({
|
|
3437
|
+
url: uploadURL,
|
|
3438
|
+
method: "PUT",
|
|
3439
|
+
headers: {
|
|
3440
|
+
"Content-Type": "text/plain",
|
|
3441
|
+
"Content-Length": size
|
|
3442
|
+
},
|
|
3443
|
+
data: fileStream,
|
|
3444
|
+
maxBodyLength: Infinity,
|
|
3445
|
+
// prevent axios from limiting the body size
|
|
3446
|
+
maxContentLength: Infinity
|
|
3447
|
+
// prevent axios from limiting the content size
|
|
3448
|
+
}, ctx.log);
|
|
3449
|
+
}
|
|
3450
|
+
uploadLogsForCaps(ctx, uploadURL) {
|
|
3443
3451
|
const logContent = fs6__default.default.readFileSync(constants_default.LOG_FILE_PATH);
|
|
3444
3452
|
const { size } = fs6__default.default.statSync(constants_default.LOG_FILE_PATH);
|
|
3445
3453
|
return this.request({
|
|
@@ -3719,8 +3727,7 @@ var ctx_default = (options) => {
|
|
|
3719
3727
|
}
|
|
3720
3728
|
if (config.web) {
|
|
3721
3729
|
webConfig = { browsers: config.web.browsers, viewports: [] };
|
|
3722
|
-
for (let viewport of (_b = config.web) == null ? void 0 : _b.viewports)
|
|
3723
|
-
webConfig.viewports.push({ width: viewport[0], height: viewport[1] || 0 });
|
|
3730
|
+
for (let viewport of (_b = config.web) == null ? void 0 : _b.viewports) webConfig.viewports.push({ width: viewport[0], height: viewport[1] || 0 });
|
|
3724
3731
|
}
|
|
3725
3732
|
if (config.mobile) {
|
|
3726
3733
|
mobileConfig = {
|
|
@@ -3970,7 +3977,7 @@ var getGitInfo_default = (ctx) => {
|
|
|
3970
3977
|
skip: (ctx2) => {
|
|
3971
3978
|
return !isGitRepo(ctx2) && !ctx2.env.SMARTUI_GIT_INFO_FILEPATH ? "[SKIPPED] Fetching git repo details; not a git repo" : "";
|
|
3972
3979
|
},
|
|
3973
|
-
task: (ctx2, task) => __async(
|
|
3980
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
3974
3981
|
if (ctx2.env.CURRENT_BRANCH && ctx2.env.CURRENT_BRANCH.trim() === "") {
|
|
3975
3982
|
throw new Error("Error: The environment variable CURRENT_BRANCH cannot be empty.");
|
|
3976
3983
|
}
|
|
@@ -3993,7 +4000,7 @@ var getGitInfo_default = (ctx) => {
|
|
|
3993
4000
|
var createBuildExec_default = (ctx) => {
|
|
3994
4001
|
return {
|
|
3995
4002
|
title: `Creating SmartUI build`,
|
|
3996
|
-
task: (ctx2, task) => __async(
|
|
4003
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
3997
4004
|
updateLogContext({ task: "createBuild" });
|
|
3998
4005
|
try {
|
|
3999
4006
|
if (ctx2.authenticatedInitially && !ctx2.config.skipBuildCreation) {
|
|
@@ -4078,7 +4085,7 @@ var exec_default = (ctx) => {
|
|
|
4078
4085
|
var _a;
|
|
4079
4086
|
return {
|
|
4080
4087
|
title: `Executing '${(_a = ctx.args.execCommand) == null ? void 0 : _a.join(" ")}'`,
|
|
4081
|
-
task: (ctx2, task) => __async(
|
|
4088
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
4082
4089
|
if (ctx2.options.fetchResults) {
|
|
4083
4090
|
if (ctx2.build && ctx2.build.id) {
|
|
4084
4091
|
startPolling(ctx2, "", false, "");
|
|
@@ -4123,7 +4130,7 @@ var exec_default = (ctx) => {
|
|
|
4123
4130
|
task.output = chalk__default.default.gray(`error: ${error.message}`);
|
|
4124
4131
|
throw new Error(`Execution of '${(_a3 = ctx2.args.execCommand) == null ? void 0 : _a3.join(" ")}' failed`);
|
|
4125
4132
|
});
|
|
4126
|
-
childProcess.on("close", (code, signal) => __async(
|
|
4133
|
+
childProcess.on("close", (code, signal) => __async(null, null, function* () {
|
|
4127
4134
|
var _a3;
|
|
4128
4135
|
if (code !== null) {
|
|
4129
4136
|
task.title = `Execution of '${(_a3 = ctx2.args.execCommand) == null ? void 0 : _a3.join(" ")}' completed; exited with code ${code}`;
|
|
@@ -4144,7 +4151,7 @@ var exec_default = (ctx) => {
|
|
|
4144
4151
|
var processSnapshot_default = (ctx) => {
|
|
4145
4152
|
return {
|
|
4146
4153
|
title: `Processing snapshots`,
|
|
4147
|
-
task: (ctx2, task) => __async(
|
|
4154
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
4148
4155
|
var _a, _b, _c, _d;
|
|
4149
4156
|
try {
|
|
4150
4157
|
if (ctx2.config.delayedUpload) {
|
|
@@ -4170,8 +4177,7 @@ var processSnapshot_default = (ctx) => {
|
|
|
4170
4177
|
[error] ${snapshot.error}`)}
|
|
4171
4178
|
`;
|
|
4172
4179
|
process.exitCode = 1;
|
|
4173
|
-
} else
|
|
4174
|
-
output += `${chalk__default.default.green("\u2713")} ${chalk__default.default.gray(snapshot.name)}
|
|
4180
|
+
} else output += `${chalk__default.default.green("\u2713")} ${chalk__default.default.gray(snapshot.name)}
|
|
4175
4181
|
${snapshot.warnings.length ? chalk__default.default.gray(`[warning] ${snapshot.warnings.join("\n[warning] ")}
|
|
4176
4182
|
`) : ""}`;
|
|
4177
4183
|
}
|
|
@@ -4194,7 +4200,7 @@ var uploadDomToS3ViaEnv2 = process.env.USE_LAMBDA_INTERNAL || false;
|
|
|
4194
4200
|
var finalizeBuild_default = (ctx) => {
|
|
4195
4201
|
return {
|
|
4196
4202
|
title: `Finalizing build`,
|
|
4197
|
-
task: (ctx2, task) => __async(
|
|
4203
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
4198
4204
|
var _a, _b, _c;
|
|
4199
4205
|
updateLogContext({ task: "finalizeBuild" });
|
|
4200
4206
|
try {
|
|
@@ -4243,7 +4249,7 @@ var finalizeBuild_default = (ctx) => {
|
|
|
4243
4249
|
if (!uploadCLILogsToS3) {
|
|
4244
4250
|
ctx2.log.debug(`Log file to be uploaded`);
|
|
4245
4251
|
let resp = yield ctx2.client.getS3PreSignedURLForCaps(ctx2, buildId, projectToken);
|
|
4246
|
-
yield ctx2.client.
|
|
4252
|
+
yield ctx2.client.uploadLogsForCaps(ctx2, resp.data.url);
|
|
4247
4253
|
} else {
|
|
4248
4254
|
ctx2.log.debug(`Log file to be uploaded via LSRS`);
|
|
4249
4255
|
ctx2.client.sendCliLogsToLSRSForCaps(ctx2, buildId, projectToken);
|
|
@@ -4308,8 +4314,7 @@ var REQUEST_TIMEOUT = 18e4;
|
|
|
4308
4314
|
var MIN_VIEWPORT_HEIGHT = 1080;
|
|
4309
4315
|
var MAX_WAIT_FOR_REQUEST_CALL = 3e4;
|
|
4310
4316
|
var normalizeSameSite = (value) => {
|
|
4311
|
-
if (!value)
|
|
4312
|
-
return "Lax";
|
|
4317
|
+
if (!value) return "Lax";
|
|
4313
4318
|
const normalized = value.trim().toLowerCase();
|
|
4314
4319
|
const mapping = {
|
|
4315
4320
|
"lax": "Lax",
|
|
@@ -4332,10 +4337,8 @@ function prepareSnapshot(snapshot, ctx) {
|
|
|
4332
4337
|
ctx.config.allowedHostnames.push(new URL(snapshot.url).hostname);
|
|
4333
4338
|
processedOptions.allowedHostnames = ctx.config.allowedHostnames;
|
|
4334
4339
|
processedOptions.skipCapturedCookies = ctx.env.SMARTUI_DO_NOT_USE_CAPTURED_COOKIES;
|
|
4335
|
-
if (ctx.env.HTTP_PROXY || ctx.env.HTTPS_PROXY)
|
|
4336
|
-
|
|
4337
|
-
if (ctx.env.SMARTUI_HTTP_PROXY || ctx.env.SMARTUI_HTTPS_PROXY)
|
|
4338
|
-
processedOptions.proxy = { server: ctx.env.SMARTUI_HTTP_PROXY || ctx.env.SMARTUI_HTTPS_PROXY };
|
|
4340
|
+
if (ctx.env.HTTP_PROXY || ctx.env.HTTPS_PROXY) processedOptions.proxy = { server: ctx.env.HTTP_PROXY || ctx.env.HTTPS_PROXY };
|
|
4341
|
+
if (ctx.env.SMARTUI_HTTP_PROXY || ctx.env.SMARTUI_HTTPS_PROXY) processedOptions.proxy = { server: ctx.env.SMARTUI_HTTP_PROXY || ctx.env.SMARTUI_HTTPS_PROXY };
|
|
4339
4342
|
let options = snapshot.options;
|
|
4340
4343
|
let optionWarnings = /* @__PURE__ */ new Set();
|
|
4341
4344
|
let selectors = [];
|
|
@@ -4344,9 +4347,7 @@ function prepareSnapshot(snapshot, ctx) {
|
|
|
4344
4347
|
ctx.log.debug(`Snapshot options: ${JSON.stringify(options)}`);
|
|
4345
4348
|
const isNotAllEmpty = (obj) => {
|
|
4346
4349
|
var _a;
|
|
4347
|
-
for (let key in obj)
|
|
4348
|
-
if ((_a = obj[key]) == null ? void 0 : _a.length)
|
|
4349
|
-
return true;
|
|
4350
|
+
for (let key in obj) if ((_a = obj[key]) == null ? void 0 : _a.length) return true;
|
|
4350
4351
|
return false;
|
|
4351
4352
|
};
|
|
4352
4353
|
if (options.loadDomContent) {
|
|
@@ -4393,14 +4394,10 @@ function prepareSnapshot(snapshot, ctx) {
|
|
|
4393
4394
|
}
|
|
4394
4395
|
}
|
|
4395
4396
|
if (options.element && Object.keys(options.element).length) {
|
|
4396
|
-
if (options.element.id)
|
|
4397
|
-
|
|
4398
|
-
else if (options.element.
|
|
4399
|
-
|
|
4400
|
-
else if (options.element.cssSelector)
|
|
4401
|
-
processedOptions.element = options.element.cssSelector;
|
|
4402
|
-
else if (options.element.xpath)
|
|
4403
|
-
processedOptions.element = "xpath=" + options.element.xpath;
|
|
4397
|
+
if (options.element.id) processedOptions.element = "#" + options.element.id;
|
|
4398
|
+
else if (options.element.class) processedOptions.element = "." + options.element.class;
|
|
4399
|
+
else if (options.element.cssSelector) processedOptions.element = options.element.cssSelector;
|
|
4400
|
+
else if (options.element.xpath) processedOptions.element = "xpath=" + options.element.xpath;
|
|
4404
4401
|
} else if (options.ignoreDOM && Object.keys(options.ignoreDOM).length && isNotAllEmpty(options.ignoreDOM)) {
|
|
4405
4402
|
processedOptions.ignoreBoxes = {};
|
|
4406
4403
|
ignoreOrSelectDOM = "ignoreDOM";
|
|
@@ -4516,10 +4513,8 @@ function processSnapshot(snapshot, ctx) {
|
|
|
4516
4513
|
contextOptions.userAgent = constants_default.CHROME_USER_AGENT;
|
|
4517
4514
|
}
|
|
4518
4515
|
if (!((_b = ctx.browser) == null ? void 0 : _b.isConnected())) {
|
|
4519
|
-
if (ctx.env.HTTP_PROXY || ctx.env.HTTPS_PROXY)
|
|
4520
|
-
|
|
4521
|
-
if (ctx.env.SMARTUI_HTTP_PROXY || ctx.env.SMARTUI_HTTPS_PROXY)
|
|
4522
|
-
launchOptions.proxy = { server: ctx.env.SMARTUI_HTTP_PROXY || ctx.env.SMARTUI_HTTPS_PROXY };
|
|
4516
|
+
if (ctx.env.HTTP_PROXY || ctx.env.HTTPS_PROXY) launchOptions.proxy = { server: ctx.env.HTTP_PROXY || ctx.env.HTTPS_PROXY };
|
|
4517
|
+
if (ctx.env.SMARTUI_HTTP_PROXY || ctx.env.SMARTUI_HTTPS_PROXY) launchOptions.proxy = { server: ctx.env.SMARTUI_HTTP_PROXY || ctx.env.SMARTUI_HTTPS_PROXY };
|
|
4523
4518
|
ctx.browser = yield test.chromium.launch(launchOptions);
|
|
4524
4519
|
ctx.log.debug(`Chromium launched with options ${JSON.stringify(launchOptions)}`);
|
|
4525
4520
|
}
|
|
@@ -4529,11 +4524,9 @@ function processSnapshot(snapshot, ctx) {
|
|
|
4529
4524
|
const domainName = new URL(snapshot.url).hostname;
|
|
4530
4525
|
ctx.log.debug(`Setting cookies for domain: ${domainName}`);
|
|
4531
4526
|
const cookieArray = snapshot.dom.cookies.split("; ").map((cookie) => {
|
|
4532
|
-
if (!cookie)
|
|
4533
|
-
return null;
|
|
4527
|
+
if (!cookie) return null;
|
|
4534
4528
|
const [name, value] = cookie.split("=");
|
|
4535
|
-
if (!name || !value)
|
|
4536
|
-
return null;
|
|
4529
|
+
if (!name || !value) return null;
|
|
4537
4530
|
return {
|
|
4538
4531
|
name: name.trim(),
|
|
4539
4532
|
value: value.trim(),
|
|
@@ -4593,7 +4586,7 @@ function processSnapshot(snapshot, ctx) {
|
|
|
4593
4586
|
}
|
|
4594
4587
|
}
|
|
4595
4588
|
const pendingRequests = /* @__PURE__ */ new Set();
|
|
4596
|
-
yield page.route("**/*", (route, request) => __async(
|
|
4589
|
+
yield page.route("**/*", (route, request) => __async(null, null, function* () {
|
|
4597
4590
|
var _a2;
|
|
4598
4591
|
const requestUrl = request.url();
|
|
4599
4592
|
const requestHostname = new URL(requestUrl).hostname;
|
|
@@ -4606,8 +4599,7 @@ function processSnapshot(snapshot, ctx) {
|
|
|
4606
4599
|
throw new Error("resource type mp3/mp4/wav/ogg/webm");
|
|
4607
4600
|
}
|
|
4608
4601
|
ctx.config.allowedHostnames.push(new URL(snapshot.url).hostname);
|
|
4609
|
-
if (ctx.config.enableJavaScript)
|
|
4610
|
-
ALLOWED_RESOURCES.push("script");
|
|
4602
|
+
if (ctx.config.enableJavaScript) ALLOWED_RESOURCES.push("script");
|
|
4611
4603
|
if (ctx.config.basicAuthorization) {
|
|
4612
4604
|
ctx.log.debug(`Adding basic authorization to the headers for root url`);
|
|
4613
4605
|
let token = Buffer.from(`${ctx.config.basicAuthorization.username}:${ctx.config.basicAuthorization.password}`).toString("base64");
|
|
@@ -4763,9 +4755,7 @@ function processSnapshot(snapshot, ctx) {
|
|
|
4763
4755
|
ctx.log.debug(`Snapshot options: ${JSON.stringify(options)}`);
|
|
4764
4756
|
const isNotAllEmpty = (obj) => {
|
|
4765
4757
|
var _a2;
|
|
4766
|
-
for (let key in obj)
|
|
4767
|
-
if ((_a2 = obj[key]) == null ? void 0 : _a2.length)
|
|
4768
|
-
return true;
|
|
4758
|
+
for (let key in obj) if ((_a2 = obj[key]) == null ? void 0 : _a2.length) return true;
|
|
4769
4759
|
return false;
|
|
4770
4760
|
};
|
|
4771
4761
|
if (options.loadDomContent) {
|
|
@@ -4809,14 +4799,10 @@ function processSnapshot(snapshot, ctx) {
|
|
|
4809
4799
|
}
|
|
4810
4800
|
}
|
|
4811
4801
|
if (options.element && Object.keys(options.element).length) {
|
|
4812
|
-
if (options.element.id)
|
|
4813
|
-
|
|
4814
|
-
else if (options.element.
|
|
4815
|
-
|
|
4816
|
-
else if (options.element.cssSelector)
|
|
4817
|
-
processedOptions.element = options.element.cssSelector;
|
|
4818
|
-
else if (options.element.xpath)
|
|
4819
|
-
processedOptions.element = "xpath=" + options.element.xpath;
|
|
4802
|
+
if (options.element.id) processedOptions.element = "#" + options.element.id;
|
|
4803
|
+
else if (options.element.class) processedOptions.element = "." + options.element.class;
|
|
4804
|
+
else if (options.element.cssSelector) processedOptions.element = options.element.cssSelector;
|
|
4805
|
+
else if (options.element.xpath) processedOptions.element = "xpath=" + options.element.xpath;
|
|
4820
4806
|
} else if (options.ignoreDOM && Object.keys(options.ignoreDOM).length && isNotAllEmpty(options.ignoreDOM)) {
|
|
4821
4807
|
processedOptions.ignoreBoxes = {};
|
|
4822
4808
|
ignoreOrSelectDOM = "ignoreDOM";
|
|
@@ -4903,8 +4889,7 @@ function processSnapshot(snapshot, ctx) {
|
|
|
4903
4889
|
discoveryErrors.name = snapshot.name;
|
|
4904
4890
|
yield page.goto(snapshot.url, { waitUntil: "domcontentloaded", timeout: ctx.config.waitForDiscovery });
|
|
4905
4891
|
yield new Promise((r) => setTimeout(r, 1250));
|
|
4906
|
-
if (ctx.config.waitForTimeout)
|
|
4907
|
-
yield page.waitForTimeout(ctx.config.waitForTimeout);
|
|
4892
|
+
if (ctx.config.waitForTimeout) yield page.waitForTimeout(ctx.config.waitForTimeout);
|
|
4908
4893
|
yield page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {
|
|
4909
4894
|
ctx.log.debug("networkidle event failed to fire within 10s");
|
|
4910
4895
|
});
|
|
@@ -4927,8 +4912,7 @@ function processSnapshot(snapshot, ctx) {
|
|
|
4927
4912
|
}
|
|
4928
4913
|
}
|
|
4929
4914
|
}
|
|
4930
|
-
if (ctx.config.cliEnableJavaScript && fullPage)
|
|
4931
|
-
yield page.evaluate(scrollToBottomAndBackToTop, { frequency: 100, timing: ctx.config.scrollTime });
|
|
4915
|
+
if (ctx.config.cliEnableJavaScript && fullPage) yield page.evaluate(scrollToBottomAndBackToTop, { frequency: 100, timing: ctx.config.scrollTime });
|
|
4932
4916
|
try {
|
|
4933
4917
|
yield page.waitForLoadState("networkidle", { timeout: 15e3 });
|
|
4934
4918
|
ctx.log.debug("Network idle 500ms");
|
|
@@ -4990,8 +4974,7 @@ function processSnapshot(snapshot, ctx) {
|
|
|
4990
4974
|
return Math.max(...measurements);
|
|
4991
4975
|
});
|
|
4992
4976
|
ctx.log.debug(`Calculated content height: ${height}`);
|
|
4993
|
-
if (!Array.isArray(processedOptions[ignoreOrSelectBoxes][viewportString]))
|
|
4994
|
-
processedOptions[ignoreOrSelectBoxes][viewportString] = [];
|
|
4977
|
+
if (!Array.isArray(processedOptions[ignoreOrSelectBoxes][viewportString])) processedOptions[ignoreOrSelectBoxes][viewportString] = [];
|
|
4995
4978
|
for (const selector of selectors) {
|
|
4996
4979
|
if (selector.startsWith("coordinates=")) {
|
|
4997
4980
|
const coordString = selector.replace("coordinates=", "");
|
|
@@ -5089,7 +5072,7 @@ function processSnapshot(snapshot, ctx) {
|
|
|
5089
5072
|
processedOptions.selectDOM = options == null ? void 0 : options.selectDOM;
|
|
5090
5073
|
ctx.log.debug(`Processed options: ${JSON.stringify(processedOptions)}`);
|
|
5091
5074
|
}
|
|
5092
|
-
const checkPending = () => __async(
|
|
5075
|
+
const checkPending = () => __async(null, null, function* () {
|
|
5093
5076
|
let startTime = Date.now();
|
|
5094
5077
|
ctx.log.debug(`${pendingRequests.size} Pending requests before wait for ${snapshot.name}: ${Array.from(pendingRequests)}`);
|
|
5095
5078
|
while (pendingRequests.size > 0) {
|
|
@@ -5260,18 +5243,15 @@ var Queue = class {
|
|
|
5260
5243
|
let drop = true;
|
|
5261
5244
|
if (snapshot.options && snapshot.options.web) {
|
|
5262
5245
|
const webDrop = this.filterWebVariants(snapshot, snapshot.options.web);
|
|
5263
|
-
if (!webDrop)
|
|
5264
|
-
drop = false;
|
|
5246
|
+
if (!webDrop) drop = false;
|
|
5265
5247
|
}
|
|
5266
5248
|
if (snapshot.options && snapshot.options.mobile) {
|
|
5267
5249
|
const mobileDrop = this.filterMobileVariants(snapshot, snapshot.options.mobile);
|
|
5268
|
-
if (!mobileDrop)
|
|
5269
|
-
drop = false;
|
|
5250
|
+
if (!mobileDrop) drop = false;
|
|
5270
5251
|
}
|
|
5271
5252
|
if (!snapshot.options || snapshot.options && !snapshot.options.web && !snapshot.options.mobile) {
|
|
5272
5253
|
const configDrop = this.filterVariants(snapshot, config);
|
|
5273
|
-
if (!configDrop)
|
|
5274
|
-
drop = false;
|
|
5254
|
+
if (!configDrop) drop = false;
|
|
5275
5255
|
}
|
|
5276
5256
|
return drop;
|
|
5277
5257
|
}
|
|
@@ -5288,10 +5268,8 @@ var Queue = class {
|
|
|
5288
5268
|
const variant = `${snapshot.name}_${browser}_viewport[${width}]_viewport[${height}]`;
|
|
5289
5269
|
if (!this.variants.includes(variant)) {
|
|
5290
5270
|
allVariantsDropped = false;
|
|
5291
|
-
if (!snapshot.options)
|
|
5292
|
-
|
|
5293
|
-
if (!snapshot.options.web)
|
|
5294
|
-
snapshot.options.web = { browsers: [], viewports: [] };
|
|
5271
|
+
if (!snapshot.options) snapshot.options = {};
|
|
5272
|
+
if (!snapshot.options.web) snapshot.options.web = { browsers: [], viewports: [] };
|
|
5295
5273
|
if (!snapshot.options.web.browsers.includes(browser)) {
|
|
5296
5274
|
snapshot.options.web.browsers.push(browser);
|
|
5297
5275
|
}
|
|
@@ -5317,10 +5295,8 @@ var Queue = class {
|
|
|
5317
5295
|
const variant = `${snapshot.name}_${device}_${orientation}`;
|
|
5318
5296
|
if (!this.variants.includes(variant)) {
|
|
5319
5297
|
allVariantsDropped = false;
|
|
5320
|
-
if (!snapshot.options)
|
|
5321
|
-
|
|
5322
|
-
if (!snapshot.options.mobile)
|
|
5323
|
-
snapshot.options.mobile = { devices: [], orientation: constants_default.MOBILE_ORIENTATION_PORTRAIT, fullPage };
|
|
5298
|
+
if (!snapshot.options) snapshot.options = {};
|
|
5299
|
+
if (!snapshot.options.mobile) snapshot.options.mobile = { devices: [], orientation: constants_default.MOBILE_ORIENTATION_PORTRAIT, fullPage };
|
|
5324
5300
|
if (!snapshot.options.mobile.devices.includes(device)) {
|
|
5325
5301
|
snapshot.options.mobile.devices.push(device);
|
|
5326
5302
|
}
|
|
@@ -5639,7 +5615,7 @@ var Queue = class {
|
|
|
5639
5615
|
var startTunnel_default = (ctx) => {
|
|
5640
5616
|
return {
|
|
5641
5617
|
title: `Starting Tunnel`,
|
|
5642
|
-
task: (ctx2, task) => __async(
|
|
5618
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
5643
5619
|
updateLogContext({ task: "startTunnel" });
|
|
5644
5620
|
try {
|
|
5645
5621
|
yield startTunnelBinary(ctx2);
|
|
@@ -5865,7 +5841,7 @@ configAppFigma.name("config:create-figma-app").description("Create figma config
|
|
|
5865
5841
|
var auth_default = (ctx) => {
|
|
5866
5842
|
return {
|
|
5867
5843
|
title: `Authenticating with SmartUI`,
|
|
5868
|
-
task: (ctx2, task) => __async(
|
|
5844
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
5869
5845
|
updateLogContext({ task: "auth" });
|
|
5870
5846
|
try {
|
|
5871
5847
|
const { authResult, orgId, userId } = yield ctx2.client.auth(ctx2.log, ctx2.env);
|
|
@@ -5891,7 +5867,7 @@ var auth_default = (ctx) => {
|
|
|
5891
5867
|
var createBuild_default = (ctx) => {
|
|
5892
5868
|
return {
|
|
5893
5869
|
title: `Creating SmartUI build`,
|
|
5894
|
-
task: (ctx2, task) => __async(
|
|
5870
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
5895
5871
|
updateLogContext({ task: "createBuild" });
|
|
5896
5872
|
try {
|
|
5897
5873
|
let resp = yield ctx2.client.createBuild(ctx2.git, ctx2.config, ctx2.log, ctx2.build.name, ctx2.isStartExec, ctx2.env.SMART_GIT, ctx2.options.markBaseline, ctx2.options.baselineBuild, ctx2.options.scheduled, ctx2.env.LT_USERNAME, ctx2.env.LT_ACCESS_KEY);
|
|
@@ -6011,14 +5987,10 @@ function captureScreenshotsForConfig(ctx, browsers, urlConfig, browserName, rend
|
|
|
6011
5987
|
ctx.log.debug(`Failed resolving tunnel/proxy details: ${e}`);
|
|
6012
5988
|
}
|
|
6013
5989
|
let page;
|
|
6014
|
-
if (browserName == constants_default.CHROME)
|
|
6015
|
-
|
|
6016
|
-
else if (browserName == constants_default.
|
|
6017
|
-
|
|
6018
|
-
else if (browserName == constants_default.SAFARI)
|
|
6019
|
-
contextOptions.userAgent = constants_default.SAFARI_USER_AGENT;
|
|
6020
|
-
else if (browserName == constants_default.EDGE)
|
|
6021
|
-
contextOptions.userAgent = constants_default.EDGE_USER_AGENT;
|
|
5990
|
+
if (browserName == constants_default.CHROME) contextOptions.userAgent = constants_default.CHROME_USER_AGENT;
|
|
5991
|
+
else if (browserName == constants_default.FIREFOX) contextOptions.userAgent = constants_default.FIREFOX_USER_AGENT;
|
|
5992
|
+
else if (browserName == constants_default.SAFARI) contextOptions.userAgent = constants_default.SAFARI_USER_AGENT;
|
|
5993
|
+
else if (browserName == constants_default.EDGE) contextOptions.userAgent = constants_default.EDGE_USER_AGENT;
|
|
6022
5994
|
if (ctx.config.userAgent || userAgent) {
|
|
6023
5995
|
if (ctx.config.userAgent !== "") {
|
|
6024
5996
|
contextOptions.userAgent = ctx.config.userAgent;
|
|
@@ -6065,7 +6037,7 @@ function captureScreenshotsForConfig(ctx, browsers, urlConfig, browserName, rend
|
|
|
6065
6037
|
yield page.setExtraHTTPHeaders(headersObject);
|
|
6066
6038
|
}
|
|
6067
6039
|
if (ctx.env.CAPTURE_RENDERING_ERRORS) {
|
|
6068
|
-
yield page.route("**/*", (route, request) => __async(
|
|
6040
|
+
yield page.route("**/*", (route, request) => __async(null, null, function* () {
|
|
6069
6041
|
var _a;
|
|
6070
6042
|
const requestUrl = request.url();
|
|
6071
6043
|
const requestHostname = new URL(requestUrl).hostname;
|
|
@@ -6127,8 +6099,7 @@ function captureScreenshotsForConfig(ctx, browsers, urlConfig, browserName, rend
|
|
|
6127
6099
|
}
|
|
6128
6100
|
let ssPath = `screenshots/${ssId}/${`${browserName}-${viewport.width}x${viewport.height}`}-${ssId}.png`;
|
|
6129
6101
|
yield page == null ? void 0 : page.setViewportSize({ width: viewport.width, height: viewport.height || constants_default.MIN_VIEWPORT_HEIGHT });
|
|
6130
|
-
if (fullPage)
|
|
6131
|
-
yield page == null ? void 0 : page.evaluate(scrollToBottomAndBackToTop);
|
|
6102
|
+
if (fullPage) yield page == null ? void 0 : page.evaluate(scrollToBottomAndBackToTop);
|
|
6132
6103
|
yield page == null ? void 0 : page.waitForTimeout(waitForTimeout || 0);
|
|
6133
6104
|
yield executeDocumentScripts(ctx, page, "beforeSnapshot", beforeSnapshotScript);
|
|
6134
6105
|
discoveryErrors.name = name;
|
|
@@ -6207,10 +6178,8 @@ function captureScreenshots(ctx) {
|
|
|
6207
6178
|
}
|
|
6208
6179
|
for (let staticConfig of ctx.webStaticConfig) {
|
|
6209
6180
|
try {
|
|
6210
|
-
if (ctx.options.parallel)
|
|
6211
|
-
|
|
6212
|
-
else
|
|
6213
|
-
yield captureScreenshotsSync(ctx, staticConfig, browsers);
|
|
6181
|
+
if (ctx.options.parallel) yield captureScreenshotsAsync(ctx, staticConfig, browsers);
|
|
6182
|
+
else yield captureScreenshotsSync(ctx, staticConfig, browsers);
|
|
6214
6183
|
delDir(`screenshots/${staticConfig.name.toLowerCase().replace(/\s/g, "_")}`);
|
|
6215
6184
|
output += `${chalk__default.default.gray(staticConfig.name)} ${chalk__default.default.green("\u2713")}
|
|
6216
6185
|
`;
|
|
@@ -6366,7 +6335,7 @@ function captureScreenshotsConcurrent(ctx) {
|
|
|
6366
6335
|
let staticURLChunks = splitURLs(ctx.webStaticConfig, urlsPerInstance);
|
|
6367
6336
|
let totalCapturedScreenshots = 0;
|
|
6368
6337
|
let output = "";
|
|
6369
|
-
const responses = yield Promise.all(staticURLChunks.map((urlConfig) => __async(
|
|
6338
|
+
const responses = yield Promise.all(staticURLChunks.map((urlConfig) => __async(null, null, function* () {
|
|
6370
6339
|
let { capturedScreenshots, finalOutput } = yield processChunk(ctx, urlConfig);
|
|
6371
6340
|
return { capturedScreenshots, finalOutput };
|
|
6372
6341
|
})));
|
|
@@ -6438,7 +6407,7 @@ function executeDocumentScripts(ctx, page, actionType, script) {
|
|
|
6438
6407
|
var captureScreenshots_default = (ctx) => {
|
|
6439
6408
|
return {
|
|
6440
6409
|
title: "Capturing screenshots",
|
|
6441
|
-
task: (ctx2, task) => __async(
|
|
6410
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
6442
6411
|
try {
|
|
6443
6412
|
ctx2.task = task;
|
|
6444
6413
|
if (ctx2.options.fetchResults) {
|
|
@@ -6540,7 +6509,7 @@ var capture_default = command2;
|
|
|
6540
6509
|
var uploadScreenshots_default = (ctx) => {
|
|
6541
6510
|
return {
|
|
6542
6511
|
title: "Uploading screenshots",
|
|
6543
|
-
task: (ctx2, task) => __async(
|
|
6512
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
6544
6513
|
try {
|
|
6545
6514
|
ctx2.task = task;
|
|
6546
6515
|
if (ctx2.options.fetchResults) {
|
|
@@ -6614,7 +6583,7 @@ command3.name("upload").description("Upload screenshots from given directory").a
|
|
|
6614
6583
|
var upload_default = command3;
|
|
6615
6584
|
|
|
6616
6585
|
// src/lib/uploadFigmaDesigns.ts
|
|
6617
|
-
var uploadFigmaDesigns_default = (ctx) => __async(
|
|
6586
|
+
var uploadFigmaDesigns_default = (ctx) => __async(null, null, function* () {
|
|
6618
6587
|
const depth = ctx.figmaDesignConfig.depth;
|
|
6619
6588
|
const figmaConfigs = ctx.figmaDesignConfig.figma_config;
|
|
6620
6589
|
let results = "";
|
|
@@ -6641,7 +6610,7 @@ var uploadFigmaDesigns_default = (ctx) => __async(void 0, null, function* () {
|
|
|
6641
6610
|
var uploadFigmaDesigns_default2 = (ctx) => {
|
|
6642
6611
|
return {
|
|
6643
6612
|
title: "Uploading Figma Designs",
|
|
6644
|
-
task: (ctx2, task) => __async(
|
|
6613
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
6645
6614
|
try {
|
|
6646
6615
|
ctx2.task = task;
|
|
6647
6616
|
updateLogContext({ task: "upload-figma" });
|
|
@@ -6663,7 +6632,7 @@ var uploadFigmaDesigns_default2 = (ctx) => {
|
|
|
6663
6632
|
};
|
|
6664
6633
|
|
|
6665
6634
|
// src/lib/uploadWebFigma.ts
|
|
6666
|
-
var uploadWebFigma_default = (ctx) => __async(
|
|
6635
|
+
var uploadWebFigma_default = (ctx) => __async(null, null, function* () {
|
|
6667
6636
|
var _a, _b;
|
|
6668
6637
|
const figmaConfig = ctx.config && ((_a = ctx.config) == null ? void 0 : _a.figma) || {};
|
|
6669
6638
|
const webConfig = ctx.config && ((_b = ctx.config) == null ? void 0 : _b.web) || {};
|
|
@@ -6701,7 +6670,7 @@ var uploadWebFigma_default = (ctx) => __async(void 0, null, function* () {
|
|
|
6701
6670
|
});
|
|
6702
6671
|
|
|
6703
6672
|
// src/lib/fetchFigma.ts
|
|
6704
|
-
var fetchFigma_default = (ctx) => __async(
|
|
6673
|
+
var fetchFigma_default = (ctx) => __async(null, null, function* () {
|
|
6705
6674
|
const buildId = ctx.build.id;
|
|
6706
6675
|
ctx.log.debug(`Fetching figma results for buildId ${buildId}`);
|
|
6707
6676
|
const startTime = Date.now();
|
|
@@ -6746,7 +6715,7 @@ function callFetchWebFigmaRecursive(startTime, buildId, ctx) {
|
|
|
6746
6715
|
var uploadWebFigma_default2 = (ctx) => {
|
|
6747
6716
|
return {
|
|
6748
6717
|
title: "Processing Web Figma",
|
|
6749
|
-
task: (ctx2, task) => __async(
|
|
6718
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
6750
6719
|
try {
|
|
6751
6720
|
ctx2.task = task;
|
|
6752
6721
|
updateLogContext({ task: "upload-figma-web" });
|
|
@@ -6778,7 +6747,7 @@ var uploadWebFigma_default2 = (ctx) => {
|
|
|
6778
6747
|
};
|
|
6779
6748
|
|
|
6780
6749
|
// src/lib/uploadAppFigma.ts
|
|
6781
|
-
var uploadAppFigma_default = (ctx) => __async(
|
|
6750
|
+
var uploadAppFigma_default = (ctx) => __async(null, null, function* () {
|
|
6782
6751
|
var _a, _b;
|
|
6783
6752
|
const figmaConfig = ctx.config && ((_a = ctx.config) == null ? void 0 : _a.figma) || {};
|
|
6784
6753
|
const mobileConfig = ctx.config && ((_b = ctx.config) == null ? void 0 : _b.mobile) || {};
|
|
@@ -6820,7 +6789,7 @@ var uploadAppFigma_default = (ctx) => __async(void 0, null, function* () {
|
|
|
6820
6789
|
var uploadAppFigma_default2 = (ctx) => {
|
|
6821
6790
|
return {
|
|
6822
6791
|
title: "Processing App Figma",
|
|
6823
|
-
task: (ctx2, task) => __async(
|
|
6792
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
6824
6793
|
try {
|
|
6825
6794
|
ctx2.task = task;
|
|
6826
6795
|
updateLogContext({ task: "upload-figma-app" });
|
|
@@ -7117,7 +7086,7 @@ var ping_default = command6;
|
|
|
7117
7086
|
var fetchBranchInfo_default = (ctx) => {
|
|
7118
7087
|
return {
|
|
7119
7088
|
title: `Fetching branch info`,
|
|
7120
|
-
task: (ctx2, task) => __async(
|
|
7089
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
7121
7090
|
updateLogContext({ task: "fetchBranchInfo" });
|
|
7122
7091
|
try {
|
|
7123
7092
|
if (ctx2.mergeBranchSource === ctx2.mergeBranchTarget) {
|
|
@@ -7155,7 +7124,7 @@ var fetchBranchInfo_default = (ctx) => {
|
|
|
7155
7124
|
var mergeBuilds_default = (ctx) => {
|
|
7156
7125
|
return {
|
|
7157
7126
|
title: `Merging smartui builds`,
|
|
7158
|
-
task: (ctx2, task) => __async(
|
|
7127
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
7159
7128
|
updateLogContext({ task: "mergeBuilds" });
|
|
7160
7129
|
try {
|
|
7161
7130
|
let resp;
|
|
@@ -7252,7 +7221,7 @@ var mergeBranch_default = command7;
|
|
|
7252
7221
|
var fetchBuildInfo_default = (ctx) => {
|
|
7253
7222
|
return {
|
|
7254
7223
|
title: `Fetching build info`,
|
|
7255
|
-
task: (ctx2, task) => __async(
|
|
7224
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
7256
7225
|
updateLogContext({ task: "fetchBuildInfo" });
|
|
7257
7226
|
try {
|
|
7258
7227
|
if (ctx2.mergeBuildSource === ctx2.mergeBuildTarget) {
|
|
@@ -7407,7 +7376,7 @@ var pingTest_default = command9;
|
|
|
7407
7376
|
var uploadPdfs_default = (ctx) => {
|
|
7408
7377
|
return {
|
|
7409
7378
|
title: "Uploading PDFs",
|
|
7410
|
-
task: (ctx2, task) => __async(
|
|
7379
|
+
task: (ctx2, task) => __async(null, null, function* () {
|
|
7411
7380
|
try {
|
|
7412
7381
|
ctx2.task = task;
|
|
7413
7382
|
updateLogContext({ task: "upload-pdf" });
|
|
@@ -7517,8 +7486,7 @@ LambdaTest SmartUI CLI v${package_default.version}`);
|
|
|
7517
7486
|
log2.warn(`This version is deprecated. A new version ${latestVersion} is available!`);
|
|
7518
7487
|
} else if (package_default.version !== latestVersion) {
|
|
7519
7488
|
log2.info(chalk__default.default.green(`A new version ${latestVersion} is available!`));
|
|
7520
|
-
} else
|
|
7521
|
-
log2.info(chalk__default.default.gray("https://www.npmjs.com/package/@lambdatest/smartui-cli\n"));
|
|
7489
|
+
} else log2.info(chalk__default.default.gray("https://www.npmjs.com/package/@lambdatest/smartui-cli\n"));
|
|
7522
7490
|
} catch (error) {
|
|
7523
7491
|
log2.debug(error);
|
|
7524
7492
|
log2.info(chalk__default.default.gray("https://www.npmjs.com/package/@lambdatest/smartui-cli\n"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lambdatest/smartui-cli",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.49",
|
|
4
4
|
"description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*"
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"node-cache": "^5.1.2",
|
|
40
40
|
"postcss": "^8.5.6",
|
|
41
41
|
"sharp": "^0.33.4",
|
|
42
|
-
"tsup": "^7.2.0",
|
|
43
42
|
"uuid": "^11.0.3",
|
|
44
43
|
"which": "^4.0.0",
|
|
45
44
|
"winston": "^3.10.0"
|
|
@@ -49,7 +48,8 @@
|
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
50
|
"find-free-port": "^2.0.0",
|
|
52
|
-
"typescript": "^5.3.2"
|
|
51
|
+
"typescript": "^5.3.2",
|
|
52
|
+
"tsup": "^8.5.1"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsup",
|