@lambdatest/smartui-cli 4.1.7 → 4.1.9

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 +20 -3
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -637,6 +637,10 @@ var ConfigSchema = {
637
637
  tunnelName: {
638
638
  type: "string",
639
639
  errorMessage: "Invalid config; tunnelName must be string"
640
+ },
641
+ userAgent: {
642
+ type: "string",
643
+ errorMessage: "User Agent value must be a valid string"
640
644
  }
641
645
  },
642
646
  anyOf: [
@@ -667,6 +671,10 @@ var WebStaticConfigSchema = {
667
671
  maximum: 3e4,
668
672
  errorMessage: "waitForTimeout must be > 0 and <= 30000"
669
673
  },
674
+ userAgent: {
675
+ type: "string",
676
+ errorMessage: "User Agent value must be a valid string"
677
+ },
670
678
  execute: {
671
679
  type: "object",
672
680
  properties: {
@@ -1530,7 +1538,7 @@ var authExec_default = (ctx) => {
1530
1538
  };
1531
1539
 
1532
1540
  // package.json
1533
- var version = "4.1.7";
1541
+ var version = "4.1.9";
1534
1542
  var package_default = {
1535
1543
  name: "@lambdatest/smartui-cli",
1536
1544
  version,
@@ -2112,7 +2120,8 @@ var ctx_default = (options) => {
2112
2120
  ignoreHTTPSErrors: (_i = config.ignoreHTTPSErrors) != null ? _i : false,
2113
2121
  skipBuildCreation: (_j = config.skipBuildCreation) != null ? _j : false,
2114
2122
  tunnel: (_k = config.tunnel) != null ? _k : false,
2115
- tunnelName: config.tunnelName || ""
2123
+ tunnelName: config.tunnelName || "",
2124
+ userAgent: config.userAgent || ""
2116
2125
  },
2117
2126
  uploadFilePath: "",
2118
2127
  webStaticConfig: [],
@@ -3471,7 +3480,7 @@ var createBuild_default = (ctx) => {
3471
3480
  function captureScreenshotsForConfig(ctx, browsers, urlConfig, browserName, renderViewports) {
3472
3481
  return __async(this, null, function* () {
3473
3482
  ctx.log.debug(`*** urlConfig ${JSON.stringify(urlConfig)}`);
3474
- let { name, url, waitForTimeout, execute, pageEvent } = urlConfig;
3483
+ let { name, url, waitForTimeout, execute, pageEvent, userAgent } = urlConfig;
3475
3484
  let afterNavigationScript = execute == null ? void 0 : execute.afterNavigation;
3476
3485
  let beforeSnapshotScript = execute == null ? void 0 : execute.beforeSnapshot;
3477
3486
  let waitUntilEvent = pageEvent || process.env.SMARTUI_PAGE_WAIT_UNTIL_EVENT || "load";
@@ -3489,6 +3498,14 @@ function captureScreenshotsForConfig(ctx, browsers, urlConfig, browserName, rend
3489
3498
  contextOptions.userAgent = constants_default.SAFARI_USER_AGENT;
3490
3499
  else if (browserName == constants_default.EDGE)
3491
3500
  contextOptions.userAgent = constants_default.EDGE_USER_AGENT;
3501
+ if (ctx.config.userAgent || userAgent) {
3502
+ if (ctx.config.userAgent !== "") {
3503
+ contextOptions.userAgent = ctx.config.userAgent;
3504
+ }
3505
+ if (userAgent && userAgent !== "") {
3506
+ contextOptions.userAgent = userAgent;
3507
+ }
3508
+ }
3492
3509
  try {
3493
3510
  const browser = browsers[browserName];
3494
3511
  context = yield browser == null ? void 0 : browser.newContext(contextOptions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdatest/smartui-cli",
3
- "version": "4.1.7",
3
+ "version": "4.1.9",
4
4
  "description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
5
5
  "files": [
6
6
  "dist/**/*"