@lambdatest/smartui-cli 4.1.18 → 4.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs +38 -9
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1249,6 +1249,32 @@ var validateSnapshot = ajv.compile(SnapshotSchema);
1249
1249
  var validateFigmaDesignConfig = ajv.compile(FigmaDesignConfigSchema);
1250
1250
  var validateWebFigmaConfig = ajv.compile(FigmaWebConfigSchema);
1251
1251
  var validateAppFigmaConfig = ajv.compile(FigmaAppConfigSchema);
1252
+ var validateConfigForScheduled = (config) => {
1253
+ validateConfigForScheduled.errors = null;
1254
+ if (!validateConfig(config)) {
1255
+ let errors = validateConfig.errors || [];
1256
+ errors = errors.filter((error) => {
1257
+ const message = error.message || "";
1258
+ return !message.includes("max unique viewports allowed - 5");
1259
+ });
1260
+ if (config.web && config.web.viewports && Array.isArray(config.web.viewports)) {
1261
+ if (config.web.viewports.length > 8) {
1262
+ errors.push({
1263
+ message: "Invalid config; max unique viewports allowed - 8 (scheduled build)",
1264
+ keyword: "maxItems",
1265
+ instancePath: "/web/viewports",
1266
+ schemaPath: "#/properties/web/properties/viewports/maxItems"
1267
+ });
1268
+ }
1269
+ }
1270
+ if (errors.length > 0) {
1271
+ validateConfigForScheduled.errors = errors;
1272
+ return false;
1273
+ }
1274
+ }
1275
+ return true;
1276
+ };
1277
+ validateConfigForScheduled.errors = null;
1252
1278
  var lambdaTunnel = __require("@lambdatest/node-tunnel");
1253
1279
  util.promisify(setTimeout);
1254
1280
  var tunnelInstance;
@@ -1877,7 +1903,7 @@ var authExec_default = (ctx) => {
1877
1903
  };
1878
1904
 
1879
1905
  // package.json
1880
- var version = "4.1.18";
1906
+ var version = "4.1.20";
1881
1907
  var package_default = {
1882
1908
  name: "@lambdatest/smartui-cli",
1883
1909
  version,
@@ -2109,7 +2135,7 @@ var httpClient = class {
2109
2135
  }
2110
2136
  });
2111
2137
  }
2112
- createBuild(git, config, log2, buildName, isStartExec, smartGit, markBaseline, baselineBuild) {
2138
+ createBuild(git, config, log2, buildName, isStartExec, smartGit, markBaseline, baselineBuild, scheduled) {
2113
2139
  return this.request({
2114
2140
  url: "/build",
2115
2141
  method: "POST",
@@ -2121,7 +2147,8 @@ var httpClient = class {
2121
2147
  packageVersion: package_default.version,
2122
2148
  smartGit,
2123
2149
  markBaseline,
2124
- baselineBuild
2150
+ baselineBuild,
2151
+ scheduled
2125
2152
  }
2126
2153
  }, log2);
2127
2154
  }
@@ -2479,8 +2506,9 @@ var ctx_default = (options) => {
2479
2506
  config.web.viewports = config.web.resolutions;
2480
2507
  delete config.web.resolutions;
2481
2508
  }
2482
- if (!validateConfig(config)) {
2483
- throw new Error(validateConfig.errors[0].message);
2509
+ let validateConfigFn = options.scheduled ? validateConfigForScheduled : validateConfig;
2510
+ if (!validateConfigFn(config)) {
2511
+ throw new Error(validateConfigFn.errors[0].message);
2484
2512
  }
2485
2513
  } else {
2486
2514
  logger_default.info("## No config file provided. Using default config.");
@@ -2587,6 +2615,7 @@ var ctx_default = (options) => {
2587
2615
  force: options.force ? true : false,
2588
2616
  markBaseline: options.markBaseline ? true : false,
2589
2617
  buildName: options.buildName || "",
2618
+ scheduled: options.scheduled || "",
2590
2619
  port,
2591
2620
  ignoreResolutions: resolutionOff,
2592
2621
  fileExtension: extensionFiles,
@@ -2718,7 +2747,7 @@ var createBuildExec_default = (ctx) => {
2718
2747
  updateLogContext({ task: "createBuild" });
2719
2748
  try {
2720
2749
  if (ctx2.authenticatedInitially && !ctx2.config.skipBuildCreation) {
2721
- 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);
2750
+ 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);
2722
2751
  if (resp && resp.data && resp.data.buildId) {
2723
2752
  ctx2.build = {
2724
2753
  id: resp.data.buildId,
@@ -3996,7 +4025,7 @@ var startTunnel_default = (ctx) => {
3996
4025
 
3997
4026
  // src/commander/exec.ts
3998
4027
  var command = new commander.Command();
3999
- 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("--userName <string>", "Specify the LT username").option("--accessKey <string>", "Specify the LT accesskey").action(function(execCommand, _, command9) {
4028
+ 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, _, command9) {
4000
4029
  return __async(this, null, function* () {
4001
4030
  var _a;
4002
4031
  const options = command9.optsWithGlobals();
@@ -4227,7 +4256,7 @@ var createBuild_default = (ctx) => {
4227
4256
  task: (ctx2, task) => __async(void 0, null, function* () {
4228
4257
  updateLogContext({ task: "createBuild" });
4229
4258
  try {
4230
- 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);
4259
+ 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);
4231
4260
  if (resp && resp.data && resp.data.buildId) {
4232
4261
  ctx2.build = {
4233
4262
  id: resp.data.buildId,
@@ -4620,7 +4649,7 @@ var captureScreenshots_default = (ctx) => {
4620
4649
 
4621
4650
  // src/commander/capture.ts
4622
4651
  var command2 = new commander.Command();
4623
- command2.name("capture").description("Capture screenshots of static sites").argument("<file>", "Web static config file").option("-C, --parallel [number]", "Specify the number of instances per browser", parseInt).option("-F, --force", "forcefully apply the specified parallel instances per browser").option("--fetch-results [filename]", "Fetch results and optionally specify an output file, e.g., <filename>.json").option("--buildName <string>", "Specify the build name").option("--userName <string>", "Specify the LT username").option("--accessKey <string>", "Specify the LT accesskey").action(function(file, _, command9) {
4652
+ command2.name("capture").description("Capture screenshots of static sites").argument("<file>", "Web static config file").option("-C, --parallel [number]", "Specify the number of instances per browser", parseInt).option("-F, --force", "forcefully apply the specified parallel instances per browser").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(file, _, command9) {
4624
4653
  return __async(this, null, function* () {
4625
4654
  var _a, _b;
4626
4655
  const options = command9.optsWithGlobals();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdatest/smartui-cli",
3
- "version": "4.1.18",
3
+ "version": "4.1.20",
4
4
  "description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
5
5
  "files": [
6
6
  "dist/**/*"