@lambdatest/smartui-cli 4.1.56 → 4.1.57
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 +112 -425
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -306,15 +306,6 @@ var constants_default = {
|
|
|
306
306
|
// Disallowed file extension
|
|
307
307
|
FILE_EXTENSION_ZIP: ".zip",
|
|
308
308
|
FILE_EXTENSION_GIFS: "gif",
|
|
309
|
-
// command types
|
|
310
|
-
COMMAND_TYPE_EXEC: "exec",
|
|
311
|
-
COMMAND_TYPE_EXEC_START: "exec-start",
|
|
312
|
-
COMMAND_TYPE_CAPTURE: "capture",
|
|
313
|
-
COMMAND_TYPE_UPLOAD: "upload",
|
|
314
|
-
COMMAND_TYPE_UPLOAD_FIGMA: "upload-figma",
|
|
315
|
-
COMMAND_TYPE_UPLOAD_PDF: "upload-pdf",
|
|
316
|
-
COMMAND_TYPE_MERGE: "merge",
|
|
317
|
-
ALLOWED_CUSTOM_VIEWPORT_COMMANDS: ["exec", "exec-start"],
|
|
318
309
|
// Default scrollTime
|
|
319
310
|
DEFAULT_SCROLL_TIME: 8,
|
|
320
311
|
// Default page load time
|
|
@@ -640,16 +631,11 @@ var ConfigSchema = {
|
|
|
640
631
|
type: "array",
|
|
641
632
|
items: { type: "string", enum: [constants_default.CHROME, constants_default.FIREFOX, constants_default.SAFARI, constants_default.EDGE] },
|
|
642
633
|
uniqueItems: true,
|
|
643
|
-
minItems: 1,
|
|
644
634
|
maxItems: 4,
|
|
645
|
-
errorMessage: {
|
|
646
|
-
minItems: "Invalid config; browsers must have at least one entry",
|
|
647
|
-
_: `Invalid config; allowed browsers - ${constants_default.CHROME}, ${constants_default.FIREFOX}, ${constants_default.SAFARI}, ${constants_default.EDGE}`
|
|
648
|
-
}
|
|
635
|
+
errorMessage: `Invalid config; allowed browsers - ${constants_default.CHROME}, ${constants_default.FIREFOX}, ${constants_default.SAFARI}, ${constants_default.EDGE}`
|
|
649
636
|
},
|
|
650
637
|
viewports: {
|
|
651
638
|
type: "array",
|
|
652
|
-
minItems: 1,
|
|
653
639
|
items: {
|
|
654
640
|
type: "array",
|
|
655
641
|
oneOf: [
|
|
@@ -671,51 +657,11 @@ var ConfigSchema = {
|
|
|
671
657
|
},
|
|
672
658
|
uniqueItems: true,
|
|
673
659
|
maxItems: 5,
|
|
674
|
-
errorMessage:
|
|
675
|
-
minItems: "Invalid config; viewports must have at least one entry",
|
|
676
|
-
maxItems: "Invalid config; max unique viewports allowed - 5"
|
|
677
|
-
}
|
|
678
|
-
},
|
|
679
|
-
customViewports: {
|
|
680
|
-
type: "array",
|
|
681
|
-
minItems: 1,
|
|
682
|
-
items: {
|
|
683
|
-
type: "object",
|
|
684
|
-
properties: {
|
|
685
|
-
browser: {
|
|
686
|
-
type: "string",
|
|
687
|
-
enum: [constants_default.CHROME, constants_default.FIREFOX, constants_default.SAFARI, constants_default.EDGE],
|
|
688
|
-
errorMessage: `Invalid config; allowed browsers - ${constants_default.CHROME}, ${constants_default.FIREFOX}, ${constants_default.SAFARI}, ${constants_default.EDGE}`
|
|
689
|
-
},
|
|
690
|
-
viewport: {
|
|
691
|
-
type: "array",
|
|
692
|
-
oneOf: [
|
|
693
|
-
{
|
|
694
|
-
items: [{ type: "number", minimum: 320, maximum: 7680 }],
|
|
695
|
-
minItems: 1,
|
|
696
|
-
maxItems: 1
|
|
697
|
-
},
|
|
698
|
-
{
|
|
699
|
-
items: [
|
|
700
|
-
{ type: "number", minimum: 320, maximum: 7680 },
|
|
701
|
-
{ type: "number", minimum: 320, maximum: 7680 }
|
|
702
|
-
],
|
|
703
|
-
minItems: 2,
|
|
704
|
-
maxItems: 2
|
|
705
|
-
}
|
|
706
|
-
],
|
|
707
|
-
errorMessage: "Invalid config; customViewports viewport width/height must be >= 320 and <= 7680"
|
|
708
|
-
}
|
|
709
|
-
},
|
|
710
|
-
required: ["browser", "viewport"],
|
|
711
|
-
additionalProperties: false
|
|
712
|
-
},
|
|
713
|
-
errorMessage: {
|
|
714
|
-
minItems: "Invalid config; customViewports must have at least one entry",
|
|
715
|
-
_: "Invalid config; customViewports must be an array of {browser, viewport} objects"
|
|
716
|
-
}
|
|
660
|
+
errorMessage: "Invalid config; max unique viewports allowed - 5"
|
|
717
661
|
}
|
|
718
|
-
}
|
|
662
|
+
},
|
|
663
|
+
required: ["browsers", "viewports"],
|
|
664
|
+
additionalProperties: false
|
|
719
665
|
},
|
|
720
666
|
mobile: {
|
|
721
667
|
type: "object",
|
|
@@ -1225,30 +1171,10 @@ var SnapshotSchema = {
|
|
|
1225
1171
|
},
|
|
1226
1172
|
uniqueItems: true,
|
|
1227
1173
|
errorMessage: "Invalid snapshot options; viewports must be an array of unique arrays."
|
|
1228
|
-
},
|
|
1229
|
-
customViewports: {
|
|
1230
|
-
type: "array",
|
|
1231
|
-
items: {
|
|
1232
|
-
type: "object",
|
|
1233
|
-
properties: {
|
|
1234
|
-
browser: {
|
|
1235
|
-
type: "string",
|
|
1236
|
-
enum: [constants_default.CHROME, constants_default.FIREFOX, constants_default.SAFARI, constants_default.EDGE]
|
|
1237
|
-
},
|
|
1238
|
-
viewport: {
|
|
1239
|
-
type: "array",
|
|
1240
|
-
items: { type: "number", minimum: 1 },
|
|
1241
|
-
minItems: 1,
|
|
1242
|
-
maxItems: 2
|
|
1243
|
-
}
|
|
1244
|
-
},
|
|
1245
|
-
required: ["browser", "viewport"],
|
|
1246
|
-
additionalProperties: false
|
|
1247
|
-
},
|
|
1248
|
-
errorMessage: "Invalid snapshot options; customViewports must be an array of {browser, viewport} objects"
|
|
1249
1174
|
}
|
|
1250
1175
|
},
|
|
1251
|
-
|
|
1176
|
+
required: ["viewports"],
|
|
1177
|
+
errorMessage: "Invalid snapshot options; web must include viewports property."
|
|
1252
1178
|
},
|
|
1253
1179
|
mobile: {
|
|
1254
1180
|
type: "object",
|
|
@@ -1733,55 +1659,20 @@ function closeBrowsers(browsers) {
|
|
|
1733
1659
|
function getWebRenderViewports(ctx) {
|
|
1734
1660
|
let webRenderViewports = [];
|
|
1735
1661
|
if (ctx.config.web) {
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
webRenderViewports.push({
|
|
1744
|
-
viewport,
|
|
1745
|
-
viewportString: `${viewport.width}${viewport.height ? "x" + viewport.height : ""}`,
|
|
1746
|
-
fullPage: viewport.height ? false : true,
|
|
1747
|
-
device: false
|
|
1748
|
-
});
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
} else {
|
|
1753
|
-
for (const viewport of ctx.config.web.viewports) {
|
|
1754
|
-
webRenderViewports.push({
|
|
1755
|
-
viewport,
|
|
1756
|
-
viewportString: `${viewport.width}${viewport.height ? "x" + viewport.height : ""}`,
|
|
1757
|
-
fullPage: viewport.height ? false : true,
|
|
1758
|
-
device: false
|
|
1759
|
-
});
|
|
1760
|
-
}
|
|
1662
|
+
for (const viewport of ctx.config.web.viewports) {
|
|
1663
|
+
webRenderViewports.push({
|
|
1664
|
+
viewport,
|
|
1665
|
+
viewportString: `${viewport.width}${viewport.height ? "x" + viewport.height : ""}`,
|
|
1666
|
+
fullPage: viewport.height ? false : true,
|
|
1667
|
+
device: false
|
|
1668
|
+
});
|
|
1761
1669
|
}
|
|
1762
1670
|
}
|
|
1763
1671
|
return webRenderViewports;
|
|
1764
1672
|
}
|
|
1765
1673
|
function getWebRenderViewportsForOptions(options) {
|
|
1766
1674
|
let webRenderViewports = [];
|
|
1767
|
-
if (options.web && Array.isArray(options.web.
|
|
1768
|
-
const browserViewports = transformCustomViewportsToBrowserViewports(options.web.customViewports);
|
|
1769
|
-
const seen = /* @__PURE__ */ new Set();
|
|
1770
|
-
for (const viewports of Object.values(browserViewports)) {
|
|
1771
|
-
for (const vp of viewports) {
|
|
1772
|
-
const key = `${vp.width}x${vp.height}`;
|
|
1773
|
-
if (!seen.has(key)) {
|
|
1774
|
-
seen.add(key);
|
|
1775
|
-
webRenderViewports.push({
|
|
1776
|
-
viewport: vp,
|
|
1777
|
-
viewportString: `${vp.width}${vp.height ? "x" + vp.height : ""}`,
|
|
1778
|
-
fullPage: vp.height ? false : true,
|
|
1779
|
-
device: false
|
|
1780
|
-
});
|
|
1781
|
-
}
|
|
1782
|
-
}
|
|
1783
|
-
}
|
|
1784
|
-
} else if (options.web && Array.isArray(options.web.viewports)) {
|
|
1675
|
+
if (options.web && Array.isArray(options.web.viewports)) {
|
|
1785
1676
|
for (const viewport of options.web.viewports) {
|
|
1786
1677
|
if (Array.isArray(viewport) && viewport.length > 0) {
|
|
1787
1678
|
let viewportObj = {
|
|
@@ -1801,22 +1692,6 @@ function getWebRenderViewportsForOptions(options) {
|
|
|
1801
1692
|
}
|
|
1802
1693
|
return webRenderViewports;
|
|
1803
1694
|
}
|
|
1804
|
-
function transformCustomViewportsToBrowserViewports(customViewports) {
|
|
1805
|
-
const browserViewports = {};
|
|
1806
|
-
for (const entry of customViewports) {
|
|
1807
|
-
if (!browserViewports[entry.browser]) {
|
|
1808
|
-
browserViewports[entry.browser] = [];
|
|
1809
|
-
}
|
|
1810
|
-
const vp = { width: entry.viewport[0], height: entry.viewport[1] || 0 };
|
|
1811
|
-
const exists = browserViewports[entry.browser].some(
|
|
1812
|
-
(existing) => existing.width === vp.width && existing.height === vp.height
|
|
1813
|
-
);
|
|
1814
|
-
if (!exists) {
|
|
1815
|
-
browserViewports[entry.browser].push(vp);
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
return browserViewports;
|
|
1819
|
-
}
|
|
1820
1695
|
function getMobileRenderViewports(ctx) {
|
|
1821
1696
|
var _a;
|
|
1822
1697
|
let mobileRenderViewports = {};
|
|
@@ -2095,15 +1970,9 @@ function stopTunnelHelper(ctx) {
|
|
|
2095
1970
|
function calculateVariantCount(config) {
|
|
2096
1971
|
let variantCount = 0;
|
|
2097
1972
|
if (config.web) {
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
}
|
|
2102
|
-
} else {
|
|
2103
|
-
const browsers = config.web.browsers || [];
|
|
2104
|
-
const viewports = config.web.viewports || [];
|
|
2105
|
-
variantCount += browsers.length * viewports.length;
|
|
2106
|
-
}
|
|
1973
|
+
const browsers = config.web.browsers || [];
|
|
1974
|
+
const viewports = config.web.viewports || [];
|
|
1975
|
+
variantCount += browsers.length * viewports.length;
|
|
2107
1976
|
}
|
|
2108
1977
|
if (config.mobile) {
|
|
2109
1978
|
const devices = config.mobile.devices || [];
|
|
@@ -2115,15 +1984,9 @@ function calculateVariantCountFromSnapshot(snapshot, globalConfig) {
|
|
|
2115
1984
|
var _a, _b;
|
|
2116
1985
|
let variantCount = 0;
|
|
2117
1986
|
if ((_a = snapshot.options) == null ? void 0 : _a.web) {
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
}
|
|
2122
|
-
} else {
|
|
2123
|
-
const browsers = snapshot.options.web.browsers || [];
|
|
2124
|
-
const viewports = snapshot.options.web.viewports || [];
|
|
2125
|
-
variantCount += browsers.length * viewports.length;
|
|
2126
|
-
}
|
|
1987
|
+
const browsers = snapshot.options.web.browsers || [];
|
|
1988
|
+
const viewports = snapshot.options.web.viewports || [];
|
|
1989
|
+
variantCount += browsers.length * viewports.length;
|
|
2127
1990
|
}
|
|
2128
1991
|
if ((_b = snapshot.options) == null ? void 0 : _b.mobile) {
|
|
2129
1992
|
const devices = snapshot.options.mobile.devices || [];
|
|
@@ -3124,7 +2987,7 @@ var authExec_default = (ctx) => {
|
|
|
3124
2987
|
};
|
|
3125
2988
|
|
|
3126
2989
|
// package.json
|
|
3127
|
-
var version = "4.1.
|
|
2990
|
+
var version = "4.1.57";
|
|
3128
2991
|
var package_default = {
|
|
3129
2992
|
name: "@lambdatest/smartui-cli",
|
|
3130
2993
|
version,
|
|
@@ -3981,7 +3844,7 @@ var httpClient = class {
|
|
|
3981
3844
|
}
|
|
3982
3845
|
};
|
|
3983
3846
|
var ctx_default = (options) => {
|
|
3984
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k
|
|
3847
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
3985
3848
|
let env = env_default();
|
|
3986
3849
|
let webConfig;
|
|
3987
3850
|
let mobileConfig;
|
|
@@ -4059,49 +3922,18 @@ var ctx_default = (options) => {
|
|
|
4059
3922
|
env.LT_USERNAME = options.userName;
|
|
4060
3923
|
env.LT_ACCESS_KEY = options.accessKey;
|
|
4061
3924
|
}
|
|
4062
|
-
if (((_b = config.web) == null ? void 0 : _b.customViewports) && !constants_default.ALLOWED_CUSTOM_VIEWPORT_COMMANDS.includes(options.commandType)) {
|
|
4063
|
-
throw new Error("customViewports is only supported for the exec command. Use browsers and viewports instead.");
|
|
4064
|
-
}
|
|
4065
3925
|
} catch (error) {
|
|
4066
3926
|
console.log(`[smartui] Error: ${error.message}`);
|
|
4067
3927
|
process.exit(1);
|
|
4068
3928
|
}
|
|
4069
3929
|
if (config.web) {
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
if (!hasCustomViewports && !hasBrowsersAndViewports) {
|
|
4073
|
-
throw new Error("Invalid config; web config must have either customViewports or both browsers and viewports");
|
|
4074
|
-
}
|
|
4075
|
-
if (hasCustomViewports) {
|
|
4076
|
-
const browserViewports = {};
|
|
4077
|
-
for (const entry of config.web.customViewports) {
|
|
4078
|
-
const vp = { width: entry.viewport[0], height: entry.viewport[1] || 0 };
|
|
4079
|
-
if (!browserViewports[entry.browser]) browserViewports[entry.browser] = [];
|
|
4080
|
-
if (!browserViewports[entry.browser].some((v) => v.width === vp.width && v.height === vp.height)) {
|
|
4081
|
-
browserViewports[entry.browser].push(vp);
|
|
4082
|
-
}
|
|
4083
|
-
}
|
|
4084
|
-
const browsers = Object.keys(browserViewports);
|
|
4085
|
-
const allViewports = [];
|
|
4086
|
-
for (const vps of Object.values(browserViewports)) {
|
|
4087
|
-
for (const vp of vps) {
|
|
4088
|
-
if (!allViewports.some((v) => v.width === vp.width && v.height === vp.height)) {
|
|
4089
|
-
allViewports.push(vp);
|
|
4090
|
-
}
|
|
4091
|
-
}
|
|
4092
|
-
}
|
|
4093
|
-
webConfig = { browsers, viewports: allViewports, browserViewports };
|
|
4094
|
-
} else {
|
|
4095
|
-
webConfig = { browsers: config.web.browsers, viewports: [] };
|
|
4096
|
-
if ((_c = config.web) == null ? void 0 : _c.viewports) {
|
|
4097
|
-
for (let viewport of config.web.viewports) webConfig.viewports.push({ width: viewport[0], height: viewport[1] || 0 });
|
|
4098
|
-
}
|
|
4099
|
-
}
|
|
3930
|
+
webConfig = { browsers: config.web.browsers, viewports: [] };
|
|
3931
|
+
for (let viewport of (_b = config.web) == null ? void 0 : _b.viewports) webConfig.viewports.push({ width: viewport[0], height: viewport[1] || 0 });
|
|
4100
3932
|
}
|
|
4101
3933
|
if (config.mobile) {
|
|
4102
3934
|
mobileConfig = {
|
|
4103
3935
|
devices: config.mobile.devices,
|
|
4104
|
-
fullPage: (
|
|
3936
|
+
fullPage: (_c = config.mobile.fullPage) != null ? _c : true,
|
|
4105
3937
|
orientation: config.mobile.orientation || constants_default.MOBILE_ORIENTATION_PORTRAIT
|
|
4106
3938
|
};
|
|
4107
3939
|
}
|
|
@@ -4168,18 +4000,18 @@ var ctx_default = (options) => {
|
|
|
4168
4000
|
waitForPageRender: config.waitForPageRender || 0,
|
|
4169
4001
|
waitForTimeout: config.waitForTimeout || 0,
|
|
4170
4002
|
waitForDiscovery: config.waitForDiscovery || 3e4,
|
|
4171
|
-
enableJavaScript: (
|
|
4172
|
-
cliEnableJavaScript: (
|
|
4003
|
+
enableJavaScript: (_d = config.enableJavaScript) != null ? _d : false,
|
|
4004
|
+
cliEnableJavaScript: (_e = config.cliEnableJavaScript) != null ? _e : true,
|
|
4173
4005
|
scrollTime: config.scrollTime || constants_default.DEFAULT_SCROLL_TIME,
|
|
4174
4006
|
allowedHostnames: config.allowedHostnames || [],
|
|
4175
4007
|
allowedAssets: config.allowedAssets || [],
|
|
4176
4008
|
basicAuthorization: basicAuthObj,
|
|
4177
4009
|
lazyLoadConfiguration: lazyLoadConfigObj,
|
|
4178
|
-
smartIgnore: (
|
|
4179
|
-
delayedUpload: (
|
|
4180
|
-
useGlobalCache: (
|
|
4181
|
-
ignoreHTTPSErrors: (
|
|
4182
|
-
skipBuildCreation: (
|
|
4010
|
+
smartIgnore: (_f = config.smartIgnore) != null ? _f : false,
|
|
4011
|
+
delayedUpload: (_g = config.delayedUpload) != null ? _g : false,
|
|
4012
|
+
useGlobalCache: (_h = config.useGlobalCache) != null ? _h : false,
|
|
4013
|
+
ignoreHTTPSErrors: (_i = config.ignoreHTTPSErrors) != null ? _i : false,
|
|
4014
|
+
skipBuildCreation: (_j = config.skipBuildCreation) != null ? _j : false,
|
|
4183
4015
|
tunnel: tunnelObj,
|
|
4184
4016
|
dedicatedProxyURL: config.dedicatedProxyURL || "",
|
|
4185
4017
|
geolocation: config.geolocation || "",
|
|
@@ -4192,7 +4024,7 @@ var ctx_default = (options) => {
|
|
|
4192
4024
|
loadDomContent,
|
|
4193
4025
|
approvalThreshold: config.approvalThreshold,
|
|
4194
4026
|
rejectionThreshold: config.rejectionThreshold,
|
|
4195
|
-
showRenderErrors: (
|
|
4027
|
+
showRenderErrors: (_k = config.showRenderErrors) != null ? _k : false,
|
|
4196
4028
|
customCSS: config.customCSS
|
|
4197
4029
|
},
|
|
4198
4030
|
uploadFilePath: "",
|
|
@@ -4726,7 +4558,6 @@ var normalizeSameSite = (value) => {
|
|
|
4726
4558
|
};
|
|
4727
4559
|
function prepareSnapshot(snapshot, ctx) {
|
|
4728
4560
|
return __async(this, null, function* () {
|
|
4729
|
-
var _a, _b;
|
|
4730
4561
|
let processedOptions = {};
|
|
4731
4562
|
processedOptions.cliEnableJavascript = ctx.config.cliEnableJavaScript;
|
|
4732
4563
|
processedOptions.ignoreHTTPSErrors = ctx.config.ignoreHTTPSErrors;
|
|
@@ -4748,8 +4579,8 @@ function prepareSnapshot(snapshot, ctx) {
|
|
|
4748
4579
|
if (options && Object.keys(options).length) {
|
|
4749
4580
|
ctx.log.debug(`Snapshot options: ${JSON.stringify(options)}`);
|
|
4750
4581
|
const isNotAllEmpty = (obj) => {
|
|
4751
|
-
var
|
|
4752
|
-
for (let key in obj) if ((
|
|
4582
|
+
var _a;
|
|
4583
|
+
for (let key in obj) if ((_a = obj[key]) == null ? void 0 : _a.length) return true;
|
|
4753
4584
|
return false;
|
|
4754
4585
|
};
|
|
4755
4586
|
if (options.loadDomContent) {
|
|
@@ -4770,20 +4601,13 @@ function prepareSnapshot(snapshot, ctx) {
|
|
|
4770
4601
|
}
|
|
4771
4602
|
if (options.web && Object.keys(options.web).length) {
|
|
4772
4603
|
processedOptions.web = {};
|
|
4773
|
-
if (options.web.
|
|
4774
|
-
processedOptions.web.
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
processedOptions.web.viewports = options.web.viewports.filter(
|
|
4778
|
-
(viewport) => Array.isArray(viewport) && viewport.length > 0
|
|
4779
|
-
);
|
|
4780
|
-
}
|
|
4781
|
-
if (options.web.browsers && options.web.browsers.length > 0) {
|
|
4782
|
-
processedOptions.web.browsers = options.web.browsers;
|
|
4783
|
-
}
|
|
4604
|
+
if (options.web.viewports && options.web.viewports.length > 0) {
|
|
4605
|
+
processedOptions.web.viewports = options.web.viewports.filter(
|
|
4606
|
+
(viewport) => Array.isArray(viewport) && viewport.length > 0
|
|
4607
|
+
);
|
|
4784
4608
|
}
|
|
4785
|
-
if (
|
|
4786
|
-
|
|
4609
|
+
if (options.web.browsers && options.web.browsers.length > 0) {
|
|
4610
|
+
processedOptions.web.browsers = options.web.browsers;
|
|
4787
4611
|
}
|
|
4788
4612
|
}
|
|
4789
4613
|
if (options.mobile && Object.keys(options.mobile).length) {
|
|
@@ -4839,16 +4663,6 @@ function prepareSnapshot(snapshot, ctx) {
|
|
|
4839
4663
|
processedOptions.ignoreType = options.ignoreType;
|
|
4840
4664
|
}
|
|
4841
4665
|
}
|
|
4842
|
-
if (!processedOptions.web && ((_a = ctx.config.web) == null ? void 0 : _a.browserViewports)) {
|
|
4843
|
-
processedOptions.web = { browserViewports: ctx.config.web.browserViewports };
|
|
4844
|
-
}
|
|
4845
|
-
if (!processedOptions.mobile && ctx.config.mobile) {
|
|
4846
|
-
processedOptions.mobile = {
|
|
4847
|
-
devices: ctx.config.mobile.devices,
|
|
4848
|
-
fullPage: (_b = ctx.config.mobile.fullPage) != null ? _b : true,
|
|
4849
|
-
orientation: ctx.config.mobile.orientation || constants_default.MOBILE_ORIENTATION_PORTRAIT
|
|
4850
|
-
};
|
|
4851
|
-
}
|
|
4852
4666
|
if (ctx.config.tunnel) {
|
|
4853
4667
|
if (ctx.tunnelDetails && ctx.tunnelDetails.tunnelPort != -1 && ctx.tunnelDetails.tunnelHost != "") {
|
|
4854
4668
|
const tunnelAddress = `http://${ctx.tunnelDetails.tunnelHost}:${ctx.tunnelDetails.tunnelPort}`;
|
|
@@ -4920,7 +4734,7 @@ function prepareSnapshot(snapshot, ctx) {
|
|
|
4920
4734
|
}
|
|
4921
4735
|
function processSnapshot(snapshot, ctx) {
|
|
4922
4736
|
return __async(this, null, function* () {
|
|
4923
|
-
var _a, _b
|
|
4737
|
+
var _a, _b;
|
|
4924
4738
|
updateLogContext({ task: "discovery" });
|
|
4925
4739
|
ctx.log.debug(`Processing snapshot ${snapshot.name} ${snapshot.url}`);
|
|
4926
4740
|
const isHeadless = ((_a = process.env.HEADLESS) == null ? void 0 : _a.toLowerCase()) === "false" ? false : true;
|
|
@@ -5209,20 +5023,13 @@ function processSnapshot(snapshot, ctx) {
|
|
|
5209
5023
|
}
|
|
5210
5024
|
if (options.web && Object.keys(options.web).length) {
|
|
5211
5025
|
processedOptions.web = {};
|
|
5212
|
-
if (options.web.
|
|
5213
|
-
processedOptions.web.
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
processedOptions.web.viewports = options.web.viewports.filter(
|
|
5217
|
-
(viewport) => Array.isArray(viewport) && viewport.length > 0
|
|
5218
|
-
);
|
|
5219
|
-
}
|
|
5220
|
-
if (options.web.browsers && options.web.browsers.length > 0) {
|
|
5221
|
-
processedOptions.web.browsers = options.web.browsers;
|
|
5222
|
-
}
|
|
5026
|
+
if (options.web.viewports && options.web.viewports.length > 0) {
|
|
5027
|
+
processedOptions.web.viewports = options.web.viewports.filter(
|
|
5028
|
+
(viewport) => Array.isArray(viewport) && viewport.length > 0
|
|
5029
|
+
);
|
|
5223
5030
|
}
|
|
5224
|
-
if (
|
|
5225
|
-
|
|
5031
|
+
if (options.web.browsers && options.web.browsers.length > 0) {
|
|
5032
|
+
processedOptions.web.browsers = options.web.browsers;
|
|
5226
5033
|
}
|
|
5227
5034
|
}
|
|
5228
5035
|
if (options.mobile && Object.keys(options.mobile).length) {
|
|
@@ -5280,16 +5087,6 @@ function processSnapshot(snapshot, ctx) {
|
|
|
5280
5087
|
processedOptions.ignoreType = options.ignoreType;
|
|
5281
5088
|
}
|
|
5282
5089
|
}
|
|
5283
|
-
if (!processedOptions.web && ((_c = ctx.config.web) == null ? void 0 : _c.browserViewports)) {
|
|
5284
|
-
processedOptions.web = { browserViewports: ctx.config.web.browserViewports };
|
|
5285
|
-
}
|
|
5286
|
-
if (!processedOptions.mobile && ctx.config.mobile) {
|
|
5287
|
-
processedOptions.mobile = {
|
|
5288
|
-
devices: ctx.config.mobile.devices,
|
|
5289
|
-
fullPage: (_d = ctx.config.mobile.fullPage) != null ? _d : true,
|
|
5290
|
-
orientation: ctx.config.mobile.orientation || constants_default.MOBILE_ORIENTATION_PORTRAIT
|
|
5291
|
-
};
|
|
5292
|
-
}
|
|
5293
5090
|
if (ctx.config.tunnel) {
|
|
5294
5091
|
if (ctx.tunnelDetails && ctx.tunnelDetails.tunnelPort != -1 && ctx.tunnelDetails.tunnelHost != "") {
|
|
5295
5092
|
const tunnelAddress = `http://${ctx.tunnelDetails.tunnelHost}:${ctx.tunnelDetails.tunnelPort}`;
|
|
@@ -5661,42 +5458,28 @@ var Queue = class {
|
|
|
5661
5458
|
}
|
|
5662
5459
|
}
|
|
5663
5460
|
processGenerateVariants(snapshot) {
|
|
5664
|
-
var _a, _b;
|
|
5665
|
-
let hasWebOptions = ((_a = snapshot.options) == null ? void 0 : _a.web) && Object.keys(snapshot.options.web).length > 0;
|
|
5666
|
-
let hasMobileOptions = ((_b = snapshot.options) == null ? void 0 : _b.mobile) && Object.keys(snapshot.options.mobile).length > 0;
|
|
5667
5461
|
if (snapshot.options) {
|
|
5668
|
-
if (
|
|
5462
|
+
if (snapshot.options.web) {
|
|
5669
5463
|
this.generateWebVariants(snapshot, snapshot.options.web);
|
|
5670
5464
|
}
|
|
5671
|
-
if (
|
|
5465
|
+
if (snapshot.options.mobile) {
|
|
5672
5466
|
this.generateMobileVariants(snapshot, snapshot.options.mobile);
|
|
5673
5467
|
}
|
|
5674
5468
|
}
|
|
5675
|
-
if (!snapshot.options || !
|
|
5469
|
+
if (!snapshot.options || snapshot.options && !snapshot.options.web && !snapshot.options.mobile) {
|
|
5676
5470
|
this.generateVariants(snapshot, this.ctx.config);
|
|
5677
5471
|
}
|
|
5678
5472
|
}
|
|
5679
5473
|
generateVariants(snapshot, config) {
|
|
5680
5474
|
if (config.web) {
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
}
|
|
5690
|
-
} else {
|
|
5691
|
-
const browsers = config.web.browsers || [];
|
|
5692
|
-
const viewports = config.web.viewports || [];
|
|
5693
|
-
for (const browser of browsers) {
|
|
5694
|
-
for (const viewport of viewports) {
|
|
5695
|
-
const width = viewport.width;
|
|
5696
|
-
const height = viewport.height || 0;
|
|
5697
|
-
const variant = `${snapshot.name}_${browser}_viewport[${width}]_viewport[${height}]`;
|
|
5698
|
-
this.variants.push(variant);
|
|
5699
|
-
}
|
|
5475
|
+
const browsers = config.web.browsers || [];
|
|
5476
|
+
const viewports = config.web.viewports || [];
|
|
5477
|
+
for (const browser of browsers) {
|
|
5478
|
+
for (const viewport of viewports) {
|
|
5479
|
+
const width = viewport.width;
|
|
5480
|
+
const height = viewport.height || 0;
|
|
5481
|
+
const variant = `${snapshot.name}_${browser}_viewport[${width}]_viewport[${height}]`;
|
|
5482
|
+
this.variants.push(variant);
|
|
5700
5483
|
}
|
|
5701
5484
|
}
|
|
5702
5485
|
}
|
|
@@ -5711,24 +5494,15 @@ var Queue = class {
|
|
|
5711
5494
|
}
|
|
5712
5495
|
generateWebVariants(snapshot, webConfig) {
|
|
5713
5496
|
var _a, _b, _c;
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
const
|
|
5497
|
+
const browsers = (_c = (_b = webConfig.browsers) != null ? _b : (_a = this.ctx.config.web) == null ? void 0 : _a.browsers) != null ? _c : [constants_default.CHROME, constants_default.EDGE, constants_default.FIREFOX, constants_default.SAFARI];
|
|
5498
|
+
const viewports = webConfig.viewports || [];
|
|
5499
|
+
for (const browser of browsers) {
|
|
5500
|
+
for (const viewport of viewports) {
|
|
5501
|
+
const width = viewport[0];
|
|
5502
|
+
const height = viewport[1] || 0;
|
|
5503
|
+
const variant = `${snapshot.name}_${browser}_viewport[${width}]_viewport[${height}]`;
|
|
5719
5504
|
this.variants.push(variant);
|
|
5720
5505
|
}
|
|
5721
|
-
} else {
|
|
5722
|
-
const browsers = (_c = (_b = webConfig.browsers) != null ? _b : (_a = this.ctx.config.web) == null ? void 0 : _a.browsers) != null ? _c : [constants_default.CHROME, constants_default.EDGE, constants_default.FIREFOX, constants_default.SAFARI];
|
|
5723
|
-
const viewports = webConfig.viewports || [];
|
|
5724
|
-
for (const browser of browsers) {
|
|
5725
|
-
for (const viewport of viewports) {
|
|
5726
|
-
const width = viewport[0];
|
|
5727
|
-
const height = viewport[1] || 0;
|
|
5728
|
-
const variant = `${snapshot.name}_${browser}_viewport[${width}]_viewport[${height}]`;
|
|
5729
|
-
this.variants.push(variant);
|
|
5730
|
-
}
|
|
5731
|
-
}
|
|
5732
5506
|
}
|
|
5733
5507
|
}
|
|
5734
5508
|
generateMobileVariants(snapshot, mobileConfig) {
|
|
@@ -5741,19 +5515,16 @@ var Queue = class {
|
|
|
5741
5515
|
}
|
|
5742
5516
|
}
|
|
5743
5517
|
filterExistingVariants(snapshot, config) {
|
|
5744
|
-
var _a, _b;
|
|
5745
5518
|
let drop = true;
|
|
5746
|
-
|
|
5747
|
-
let hasMobileOptions = ((_b = snapshot.options) == null ? void 0 : _b.mobile) && Object.keys(snapshot.options.mobile).length > 0;
|
|
5748
|
-
if (snapshot.options && hasWebOptions) {
|
|
5519
|
+
if (snapshot.options && snapshot.options.web) {
|
|
5749
5520
|
const webDrop = this.filterWebVariants(snapshot, snapshot.options.web);
|
|
5750
5521
|
if (!webDrop) drop = false;
|
|
5751
5522
|
}
|
|
5752
|
-
if (snapshot.options &&
|
|
5523
|
+
if (snapshot.options && snapshot.options.mobile) {
|
|
5753
5524
|
const mobileDrop = this.filterMobileVariants(snapshot, snapshot.options.mobile);
|
|
5754
5525
|
if (!mobileDrop) drop = false;
|
|
5755
5526
|
}
|
|
5756
|
-
if (!snapshot.options || !
|
|
5527
|
+
if (!snapshot.options || snapshot.options && !snapshot.options.web && !snapshot.options.mobile) {
|
|
5757
5528
|
const configDrop = this.filterVariants(snapshot, config);
|
|
5758
5529
|
if (!configDrop) drop = false;
|
|
5759
5530
|
}
|
|
@@ -5763,63 +5534,28 @@ var Queue = class {
|
|
|
5763
5534
|
var _a;
|
|
5764
5535
|
let allVariantsDropped = true;
|
|
5765
5536
|
if (config.web) {
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
}
|
|
5780
|
-
}
|
|
5781
|
-
}
|
|
5782
|
-
}
|
|
5783
|
-
if (customViewports.length > 0) {
|
|
5784
|
-
if (!snapshot.options) snapshot.options = {};
|
|
5785
|
-
snapshot.options.web = { browsers: [], viewports: [], customViewports };
|
|
5786
|
-
for (const entry of customViewports) {
|
|
5787
|
-
if (!snapshot.options.web.browsers.includes(entry.browser)) {
|
|
5788
|
-
snapshot.options.web.browsers.push(entry.browser);
|
|
5537
|
+
const browsers = config.web.browsers || [];
|
|
5538
|
+
const viewports = config.web.viewports || [];
|
|
5539
|
+
for (const browser of browsers) {
|
|
5540
|
+
for (const viewport of viewports) {
|
|
5541
|
+
const width = viewport.width;
|
|
5542
|
+
const height = viewport.height || 0;
|
|
5543
|
+
const variant = `${snapshot.name}_${browser}_viewport[${width}]_viewport[${height}]`;
|
|
5544
|
+
if (!this.variants.includes(variant)) {
|
|
5545
|
+
allVariantsDropped = false;
|
|
5546
|
+
if (!snapshot.options) snapshot.options = {};
|
|
5547
|
+
if (!snapshot.options.web) snapshot.options.web = { browsers: [], viewports: [] };
|
|
5548
|
+
if (!snapshot.options.web.browsers.includes(browser)) {
|
|
5549
|
+
snapshot.options.web.browsers.push(browser);
|
|
5789
5550
|
}
|
|
5790
|
-
const vp = entry.viewport;
|
|
5791
5551
|
const viewportExists = snapshot.options.web.viewports.some(
|
|
5792
|
-
(
|
|
5552
|
+
(existingViewport) => existingViewport[0] === width && (existingViewport.length < 2 || existingViewport[1] === height)
|
|
5793
5553
|
);
|
|
5794
5554
|
if (!viewportExists) {
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
} else {
|
|
5800
|
-
const browsers = config.web.browsers || [];
|
|
5801
|
-
const viewports = config.web.viewports || [];
|
|
5802
|
-
for (const browser of browsers) {
|
|
5803
|
-
for (const viewport of viewports) {
|
|
5804
|
-
const width = viewport.width;
|
|
5805
|
-
const height = viewport.height || 0;
|
|
5806
|
-
const variant = `${snapshot.name}_${browser}_viewport[${width}]_viewport[${height}]`;
|
|
5807
|
-
if (!this.variants.includes(variant)) {
|
|
5808
|
-
allVariantsDropped = false;
|
|
5809
|
-
if (!snapshot.options) snapshot.options = {};
|
|
5810
|
-
if (!snapshot.options.web) snapshot.options.web = { browsers: [], viewports: [] };
|
|
5811
|
-
if (!snapshot.options.web.browsers.includes(browser)) {
|
|
5812
|
-
snapshot.options.web.browsers.push(browser);
|
|
5813
|
-
}
|
|
5814
|
-
const viewportExists = snapshot.options.web.viewports.some(
|
|
5815
|
-
(existingViewport) => existingViewport[0] === width && (existingViewport.length < 2 || existingViewport[1] === height)
|
|
5816
|
-
);
|
|
5817
|
-
if (!viewportExists) {
|
|
5818
|
-
if (height > 0) {
|
|
5819
|
-
snapshot.options.web.viewports.push([width, height]);
|
|
5820
|
-
} else {
|
|
5821
|
-
snapshot.options.web.viewports.push([width]);
|
|
5822
|
-
}
|
|
5555
|
+
if (height > 0) {
|
|
5556
|
+
snapshot.options.web.viewports.push([width, height]);
|
|
5557
|
+
} else {
|
|
5558
|
+
snapshot.options.web.viewports.push([width]);
|
|
5823
5559
|
}
|
|
5824
5560
|
}
|
|
5825
5561
|
}
|
|
@@ -5847,60 +5583,31 @@ var Queue = class {
|
|
|
5847
5583
|
}
|
|
5848
5584
|
filterWebVariants(snapshot, webConfig) {
|
|
5849
5585
|
var _a, _b, _c;
|
|
5586
|
+
const browsers = (_c = (_b = webConfig.browsers) != null ? _b : (_a = this.ctx.config.web) == null ? void 0 : _a.browsers) != null ? _c : [constants_default.CHROME, constants_default.EDGE, constants_default.FIREFOX, constants_default.SAFARI];
|
|
5587
|
+
const viewports = webConfig.viewports || [];
|
|
5850
5588
|
let allVariantsDropped = true;
|
|
5851
5589
|
if (!snapshot.options) {
|
|
5852
5590
|
snapshot.options = {};
|
|
5853
5591
|
}
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
const
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
const
|
|
5860
|
-
const height = entry.viewport[1] || 0;
|
|
5861
|
-
const variant = `${snapshot.name}_${entry.browser}_viewport[${width}]_viewport[${height}]`;
|
|
5592
|
+
snapshot.options.web = { browsers: [], viewports: [] };
|
|
5593
|
+
for (const browser of browsers) {
|
|
5594
|
+
for (const viewport of viewports) {
|
|
5595
|
+
const width = viewport[0];
|
|
5596
|
+
const height = viewport[1] || 0;
|
|
5597
|
+
const variant = `${snapshot.name}_${browser}_viewport[${width}]_viewport[${height}]`;
|
|
5862
5598
|
if (!this.variants.includes(variant)) {
|
|
5863
5599
|
allVariantsDropped = false;
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
browsers.push(entry.browser);
|
|
5600
|
+
if (!snapshot.options.web.browsers.includes(browser)) {
|
|
5601
|
+
snapshot.options.web.browsers.push(browser);
|
|
5867
5602
|
}
|
|
5868
|
-
const viewportExists = viewports.some(
|
|
5869
|
-
(
|
|
5603
|
+
const viewportExists = snapshot.options.web.viewports.some(
|
|
5604
|
+
(existingViewport) => existingViewport[0] === width && (existingViewport.length < 2 || existingViewport[1] === height)
|
|
5870
5605
|
);
|
|
5871
5606
|
if (!viewportExists) {
|
|
5872
5607
|
if (height > 0) {
|
|
5873
|
-
viewports.push([width, height]);
|
|
5608
|
+
snapshot.options.web.viewports.push([width, height]);
|
|
5874
5609
|
} else {
|
|
5875
|
-
viewports.push([width]);
|
|
5876
|
-
}
|
|
5877
|
-
}
|
|
5878
|
-
}
|
|
5879
|
-
}
|
|
5880
|
-
snapshot.options.web = { browsers, viewports, customViewports: filteredCustomViewports };
|
|
5881
|
-
} else {
|
|
5882
|
-
snapshot.options.web = { browsers: [], viewports: [] };
|
|
5883
|
-
const browsers = (_c = (_b = webConfig.browsers) != null ? _b : (_a = this.ctx.config.web) == null ? void 0 : _a.browsers) != null ? _c : [constants_default.CHROME, constants_default.EDGE, constants_default.FIREFOX, constants_default.SAFARI];
|
|
5884
|
-
const viewports = webConfig.viewports || [];
|
|
5885
|
-
for (const browser of browsers) {
|
|
5886
|
-
for (const viewport of viewports) {
|
|
5887
|
-
const width = viewport[0];
|
|
5888
|
-
const height = viewport[1] || 0;
|
|
5889
|
-
const variant = `${snapshot.name}_${browser}_viewport[${width}]_viewport[${height}]`;
|
|
5890
|
-
if (!this.variants.includes(variant)) {
|
|
5891
|
-
allVariantsDropped = false;
|
|
5892
|
-
if (!snapshot.options.web.browsers.includes(browser)) {
|
|
5893
|
-
snapshot.options.web.browsers.push(browser);
|
|
5894
|
-
}
|
|
5895
|
-
const viewportExists = snapshot.options.web.viewports.some(
|
|
5896
|
-
(existingViewport) => existingViewport[0] === width && (existingViewport.length < 2 || existingViewport[1] === height)
|
|
5897
|
-
);
|
|
5898
|
-
if (!viewportExists) {
|
|
5899
|
-
if (height > 0) {
|
|
5900
|
-
snapshot.options.web.viewports.push([width, height]);
|
|
5901
|
-
} else {
|
|
5902
|
-
snapshot.options.web.viewports.push([width]);
|
|
5903
|
-
}
|
|
5610
|
+
snapshot.options.web.viewports.push([width]);
|
|
5904
5611
|
}
|
|
5905
5612
|
}
|
|
5906
5613
|
}
|
|
@@ -6211,9 +5918,7 @@ command.name("exec").description("Run test commands around SmartUI").argument("<
|
|
|
6211
5918
|
console.log(`Error: The '--buildName' option cannot be an empty string.`);
|
|
6212
5919
|
process.exit(1);
|
|
6213
5920
|
}
|
|
6214
|
-
let
|
|
6215
|
-
opts.commandType = constants_default.COMMAND_TYPE_EXEC;
|
|
6216
|
-
let ctx = ctx_default(opts);
|
|
5921
|
+
let ctx = ctx_default(command11.optsWithGlobals());
|
|
6217
5922
|
if (!which__default.default.sync(execCommand[0], { nothrow: true })) {
|
|
6218
5923
|
ctx.log.error(`Error: Command not found "${execCommand[0]}"`);
|
|
6219
5924
|
return;
|
|
@@ -7054,9 +6759,7 @@ command2.name("capture").description("Capture screenshots of static sites").argu
|
|
|
7054
6759
|
console.log(`Error: The '--buildName' option cannot be an empty string.`);
|
|
7055
6760
|
process.exit(1);
|
|
7056
6761
|
}
|
|
7057
|
-
let
|
|
7058
|
-
opts.commandType = constants_default.COMMAND_TYPE_CAPTURE;
|
|
7059
|
-
let ctx = ctx_default(opts);
|
|
6762
|
+
let ctx = ctx_default(command11.optsWithGlobals());
|
|
7060
6763
|
ctx.isSnapshotCaptured = true;
|
|
7061
6764
|
if (!fs6__default.default.existsSync(file)) {
|
|
7062
6765
|
ctx.log.error(`Web Static Config file ${file} not found.`);
|
|
@@ -7151,9 +6854,7 @@ command3.name("upload").description("Upload screenshots from given directory").a
|
|
|
7151
6854
|
console.log(`Error: The '--buildName' option cannot be an empty string.`);
|
|
7152
6855
|
process.exit(1);
|
|
7153
6856
|
}
|
|
7154
|
-
let
|
|
7155
|
-
opts.commandType = constants_default.COMMAND_TYPE_UPLOAD;
|
|
7156
|
-
let ctx = ctx_default(opts);
|
|
6857
|
+
let ctx = ctx_default(command11.optsWithGlobals());
|
|
7157
6858
|
ctx.isSnapshotCaptured = true;
|
|
7158
6859
|
if (!fs6__default.default.existsSync(directory)) {
|
|
7159
6860
|
console.log(`Error: The provided directory ${directory} not found.`);
|
|
@@ -7436,9 +7137,7 @@ var uploadAppFigmaCommand = new commander.Command();
|
|
|
7436
7137
|
uploadFigma.name("upload-figma").description("Capture screenshots of static sites").argument("<file>", "figma design config file").option("--markBaseline", "Mark the uploaded images as baseline").option("--buildName <buildName>", "Name of the build").action(function(file, _, command11) {
|
|
7437
7138
|
return __async(this, null, function* () {
|
|
7438
7139
|
var _a, _b;
|
|
7439
|
-
let
|
|
7440
|
-
opts.commandType = constants_default.COMMAND_TYPE_UPLOAD_FIGMA;
|
|
7441
|
-
let ctx = ctx_default(opts);
|
|
7140
|
+
let ctx = ctx_default(command11.optsWithGlobals());
|
|
7442
7141
|
ctx.isSnapshotCaptured = true;
|
|
7443
7142
|
if (!fs6__default.default.existsSync(file)) {
|
|
7444
7143
|
console.log(`Error: Figma Config file ${file} not found.`);
|
|
@@ -7480,9 +7179,7 @@ uploadFigma.name("upload-figma").description("Capture screenshots of static site
|
|
|
7480
7179
|
uploadWebFigmaCommand.name("upload-figma-web").description("Capture figma screenshots into CLI build").argument("<file>", "figma config config file").option("--markBaseline", "Mark the uploaded images as baseline").option("--buildName <buildName>", "Name of the build").option("--fetch-results [filename]", "Fetch results and optionally specify an output file, e.g., <filename>.json").action(function(file, _, command11) {
|
|
7481
7180
|
return __async(this, null, function* () {
|
|
7482
7181
|
var _a;
|
|
7483
|
-
let
|
|
7484
|
-
opts.commandType = constants_default.COMMAND_TYPE_UPLOAD_FIGMA;
|
|
7485
|
-
let ctx = ctx_default(opts);
|
|
7182
|
+
let ctx = ctx_default(command11.optsWithGlobals());
|
|
7486
7183
|
if (!fs6__default.default.existsSync(file)) {
|
|
7487
7184
|
console.log(`Error: figma-web config file ${file} not found.`);
|
|
7488
7185
|
return;
|
|
@@ -7535,9 +7232,7 @@ uploadWebFigmaCommand.name("upload-figma-web").description("Capture figma screen
|
|
|
7535
7232
|
uploadAppFigmaCommand.name("upload-figma-app").description("Capture figma screenshots into App Build").argument("<file>", "figma config config file").option("--markBaseline", "Mark the uploaded images as baseline").option("--buildName <buildName>", "Name of the build").option("--fetch-results [filename]", "Fetch results and optionally specify an output file, e.g., <filename>.json").action(function(file, _, command11) {
|
|
7536
7233
|
return __async(this, null, function* () {
|
|
7537
7234
|
var _a;
|
|
7538
|
-
let
|
|
7539
|
-
opts.commandType = constants_default.COMMAND_TYPE_UPLOAD_FIGMA;
|
|
7540
|
-
let ctx = ctx_default(opts);
|
|
7235
|
+
let ctx = ctx_default(command11.optsWithGlobals());
|
|
7541
7236
|
if (!fs6__default.default.existsSync(file)) {
|
|
7542
7237
|
console.log(`Error: figma-app config file ${file} not found.`);
|
|
7543
7238
|
return;
|
|
@@ -7596,9 +7291,7 @@ command4.name("exec:start").description("Start SmartUI server").option("-P, --po
|
|
|
7596
7291
|
console.log(`Error: The '--buildName' option cannot be an empty string.`);
|
|
7597
7292
|
process.exit(1);
|
|
7598
7293
|
}
|
|
7599
|
-
let
|
|
7600
|
-
opts.commandType = constants_default.COMMAND_TYPE_EXEC_START;
|
|
7601
|
-
let ctx = ctx_default(opts);
|
|
7294
|
+
let ctx = ctx_default(command4.optsWithGlobals());
|
|
7602
7295
|
ctx.snapshotQueue = new Queue(ctx);
|
|
7603
7296
|
ctx.totalSnapshots = 0;
|
|
7604
7297
|
ctx.isStartExec = true;
|
|
@@ -7798,9 +7491,7 @@ var command7 = new commander.Command();
|
|
|
7798
7491
|
command7.name("branch").description("Merge a source branch into the target branch").requiredOption("--source <string>", "Source branch to merge").requiredOption("--target <string>", "Target branch to merge into").action(function(options) {
|
|
7799
7492
|
return __async(this, null, function* () {
|
|
7800
7493
|
const { source, target } = options;
|
|
7801
|
-
let
|
|
7802
|
-
opts.commandType = constants_default.COMMAND_TYPE_MERGE;
|
|
7803
|
-
let ctx = ctx_default(opts);
|
|
7494
|
+
let ctx = ctx_default(command7.optsWithGlobals());
|
|
7804
7495
|
if (!source || source.trim() === "") {
|
|
7805
7496
|
ctx.log.error("Error: The --source option cannot be empty.");
|
|
7806
7497
|
process.exit(1);
|
|
@@ -7883,9 +7574,7 @@ var command8 = new commander.Command();
|
|
|
7883
7574
|
command8.name("build").description("Merge a source build into the target build").requiredOption("--source <string>", "Source build to merge").requiredOption("--target <string>", "Target build to merge into").action(function(options) {
|
|
7884
7575
|
return __async(this, null, function* () {
|
|
7885
7576
|
const { source, target } = options;
|
|
7886
|
-
let
|
|
7887
|
-
opts.commandType = constants_default.COMMAND_TYPE_MERGE;
|
|
7888
|
-
let ctx = ctx_default(opts);
|
|
7577
|
+
let ctx = ctx_default(command8.optsWithGlobals());
|
|
7889
7578
|
if (!source || source.trim() === "") {
|
|
7890
7579
|
ctx.log.error("Error: The --source option cannot be empty.");
|
|
7891
7580
|
process.exit(1);
|
|
@@ -8057,9 +7746,7 @@ command10.name("upload-pdf").description("Upload PDFs for visual comparison").ar
|
|
|
8057
7746
|
console.log(`Error: The '--buildName' option cannot be an empty string.`);
|
|
8058
7747
|
process.exit(1);
|
|
8059
7748
|
}
|
|
8060
|
-
let
|
|
8061
|
-
opts.commandType = constants_default.COMMAND_TYPE_UPLOAD_PDF;
|
|
8062
|
-
let ctx = ctx_default(opts);
|
|
7749
|
+
let ctx = ctx_default(command11.optsWithGlobals());
|
|
8063
7750
|
if (!fs6__default.default.existsSync(directory)) {
|
|
8064
7751
|
console.log(`Error: The provided directory ${directory} not found.`);
|
|
8065
7752
|
process.exit(1);
|