@lambdatest/smartui-cli 4.1.16 → 4.1.18-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs +27 -14
  2. package/package.json +4 -2
package/dist/index.cjs CHANGED
@@ -13,6 +13,7 @@ var addErrors = require('ajv-errors');
13
13
  var test = require('@playwright/test');
14
14
  var util = require('util');
15
15
  var winston = require('winston');
16
+ var stringify = require('json-stringify-safe');
16
17
  var FormData = require('form-data');
17
18
  var axios = require('axios');
18
19
  var https = require('https');
@@ -31,6 +32,7 @@ var fastify__default = /*#__PURE__*/_interopDefault(fastify);
31
32
  var fs5__default = /*#__PURE__*/_interopDefault(fs5);
32
33
  var Ajv__default = /*#__PURE__*/_interopDefault(Ajv);
33
34
  var addErrors__default = /*#__PURE__*/_interopDefault(addErrors);
35
+ var stringify__default = /*#__PURE__*/_interopDefault(stringify);
34
36
  var FormData__default = /*#__PURE__*/_interopDefault(FormData);
35
37
  var axios__default = /*#__PURE__*/_interopDefault(axios);
36
38
  var https__default = /*#__PURE__*/_interopDefault(https);
@@ -430,7 +432,7 @@ var constants_default = {
430
432
  },
431
433
  FIGMA_API: "https://api.figma.com/v1/",
432
434
  DEFAULT_FIGMA_CONFIG: {
433
- "depth": 2,
435
+ "depth": 1,
434
436
  "figma_config": [
435
437
  {
436
438
  "figma_file_token": "token_for_first_figma_file",
@@ -451,7 +453,7 @@ var constants_default = {
451
453
  ]
452
454
  },
453
455
  figma: {
454
- "depth": 2,
456
+ "depth": 1,
455
457
  "configs": [
456
458
  {
457
459
  "figma_file_token": "<token>",
@@ -478,7 +480,7 @@ var constants_default = {
478
480
  }
479
481
  ],
480
482
  figma: {
481
- "depth": 2,
483
+ "depth": 1,
482
484
  "configs": [
483
485
  {
484
486
  "figma_file_token": "<token>",
@@ -749,6 +751,10 @@ var ConfigSchema = {
749
751
  errorMessage: {
750
752
  uniqueItems: "Invalid config; duplicates in requestHeaders"
751
753
  }
754
+ },
755
+ allowDuplicateSnapshotNames: {
756
+ type: "boolean",
757
+ errorMessage: "Invalid config; allowDuplicateSnapshotNames must be true/false"
752
758
  }
753
759
  },
754
760
  anyOf: [
@@ -996,8 +1002,8 @@ var FigmaDesignConfigSchema = {
996
1002
  properties: {
997
1003
  depth: {
998
1004
  type: "integer",
999
- minimum: 2,
1000
- errorMessage: "Depth must be an integer and greater than 1"
1005
+ minimum: 1,
1006
+ errorMessage: "Depth must be an integer and greater than 0"
1001
1007
  },
1002
1008
  figma_config: {
1003
1009
  type: "array",
@@ -1069,8 +1075,8 @@ var FigmaWebConfigSchema = {
1069
1075
  "properties": {
1070
1076
  depth: {
1071
1077
  type: "integer",
1072
- minimum: 2,
1073
- errorMessage: "Depth must be an integer and greater than 1"
1078
+ minimum: 1,
1079
+ errorMessage: "Depth must be an integer and greater than 0"
1074
1080
  },
1075
1081
  "configs": {
1076
1082
  "type": "array",
@@ -1183,8 +1189,8 @@ var FigmaAppConfigSchema = {
1183
1189
  "properties": {
1184
1190
  depth: {
1185
1191
  type: "integer",
1186
- minimum: 2,
1187
- errorMessage: "Depth must be an integer and greater than 1"
1192
+ minimum: 1,
1193
+ errorMessage: "Depth must be an integer and greater than 0"
1188
1194
  },
1189
1195
  "configs": {
1190
1196
  "type": "array",
@@ -1792,7 +1798,7 @@ var logger = winston.createLogger({
1792
1798
  winston.format.timestamp(),
1793
1799
  winston.format.printf((info) => {
1794
1800
  let contextString = Object.values(logContext).join(" | ");
1795
- let message = typeof info.message === "object" ? JSON.stringify(info.message).trim() : info.message.trim();
1801
+ let message = typeof info.message === "object" ? stringify__default.default(info.message) : info.message.trim();
1796
1802
  switch (info.level) {
1797
1803
  case "warn":
1798
1804
  message = chalk__default.default.yellow(message);
@@ -1871,7 +1877,7 @@ var authExec_default = (ctx) => {
1871
1877
  };
1872
1878
 
1873
1879
  // package.json
1874
- var version = "4.1.16";
1880
+ var version = "4.1.18-beta.0";
1875
1881
  var package_default = {
1876
1882
  name: "@lambdatest/smartui-cli",
1877
1883
  version,
@@ -1897,14 +1903,15 @@ var package_default = {
1897
1903
  author: "LambdaTest <keys@lambdatest.com>",
1898
1904
  license: "MIT",
1899
1905
  dependencies: {
1906
+ "@lambdatest/node-tunnel": "^4.0.9",
1900
1907
  "@playwright/browser-chromium": "^1.47.2",
1901
1908
  "@playwright/browser-firefox": "^1.47.2",
1902
1909
  "@playwright/browser-webkit": "^1.47.2",
1903
1910
  "@playwright/test": "^1.47.2",
1904
1911
  "@types/cross-spawn": "^6.0.4",
1912
+ "@types/json-stringify-safe": "^5.0.3",
1905
1913
  "@types/node": "^20.8.9",
1906
1914
  "@types/which": "^3.0.2",
1907
- "@lambdatest/node-tunnel": "^4.0.9",
1908
1915
  ajv: "^8.12.0",
1909
1916
  "ajv-errors": "^3.0.0",
1910
1917
  axios: "^1.6.0",
@@ -1913,6 +1920,7 @@ var package_default = {
1913
1920
  "cross-spawn": "^7.0.3",
1914
1921
  fastify: "^4.24.3",
1915
1922
  "form-data": "^4.0.0",
1923
+ "json-stringify-safe": "^5.0.1",
1916
1924
  listr2: "^7.0.1",
1917
1925
  "node-cache": "^5.1.2",
1918
1926
  sharp: "^0.33.4",
@@ -2463,6 +2471,7 @@ var ctx_default = (options) => {
2463
2471
  let fetchResultObj;
2464
2472
  let fetchResultsFileObj;
2465
2473
  let buildNameObj;
2474
+ let allowDuplicateSnapshotNames = false;
2466
2475
  try {
2467
2476
  if (options.config) {
2468
2477
  config = JSON.parse(fs5__default.default.readFileSync(options.config, "utf-8"));
@@ -2523,6 +2532,9 @@ var ctx_default = (options) => {
2523
2532
  if (config.tunnel) {
2524
2533
  tunnelObj = config.tunnel;
2525
2534
  }
2535
+ if (config.allowDuplicateSnapshotNames) {
2536
+ allowDuplicateSnapshotNames = true;
2537
+ }
2526
2538
  return {
2527
2539
  env,
2528
2540
  log: logger_default,
@@ -2546,7 +2558,8 @@ var ctx_default = (options) => {
2546
2558
  skipBuildCreation: (_j = config.skipBuildCreation) != null ? _j : false,
2547
2559
  tunnel: tunnelObj,
2548
2560
  userAgent: config.userAgent || "",
2549
- requestHeaders: config.requestHeaders || {}
2561
+ requestHeaders: config.requestHeaders || {},
2562
+ allowDuplicateSnapshotNames
2550
2563
  },
2551
2564
  uploadFilePath: "",
2552
2565
  webStaticConfig: [],
@@ -3821,7 +3834,7 @@ var Queue = class {
3821
3834
  if (this.ctx.isStartExec && !this.ctx.config.tunnel) {
3822
3835
  this.ctx.log.info(`Processing Snapshot: ${snapshot == null ? void 0 : snapshot.name}`);
3823
3836
  }
3824
- if (!this.ctx.config.delayedUpload && snapshot && snapshot.name && this.snapshotNames.includes(snapshot.name)) {
3837
+ if (!this.ctx.config.delayedUpload && snapshot && snapshot.name && this.snapshotNames.includes(snapshot.name) && !this.ctx.config.allowDuplicateSnapshotNames) {
3825
3838
  drop = true;
3826
3839
  this.ctx.log.info(`Skipping duplicate SmartUI snapshot '${snapshot.name}'. To capture duplicate screenshots, please set the 'delayedUpload' configuration as true in your config file.`);
3827
3840
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdatest/smartui-cli",
3
- "version": "4.1.16",
3
+ "version": "4.1.18-beta.0",
4
4
  "description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
5
5
  "files": [
6
6
  "dist/**/*"
@@ -17,14 +17,15 @@
17
17
  "author": "LambdaTest <keys@lambdatest.com>",
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
+ "@lambdatest/node-tunnel": "^4.0.9",
20
21
  "@playwright/browser-chromium": "^1.47.2",
21
22
  "@playwright/browser-firefox": "^1.47.2",
22
23
  "@playwright/browser-webkit": "^1.47.2",
23
24
  "@playwright/test": "^1.47.2",
24
25
  "@types/cross-spawn": "^6.0.4",
26
+ "@types/json-stringify-safe": "^5.0.3",
25
27
  "@types/node": "^20.8.9",
26
28
  "@types/which": "^3.0.2",
27
- "@lambdatest/node-tunnel": "^4.0.9",
28
29
  "ajv": "^8.12.0",
29
30
  "ajv-errors": "^3.0.0",
30
31
  "axios": "^1.6.0",
@@ -33,6 +34,7 @@
33
34
  "cross-spawn": "^7.0.3",
34
35
  "fastify": "^4.24.3",
35
36
  "form-data": "^4.0.0",
37
+ "json-stringify-safe": "^5.0.1",
36
38
  "listr2": "^7.0.1",
37
39
  "node-cache": "^5.1.2",
38
40
  "sharp": "^0.33.4",