@lambdatest/smartui-cli 4.1.7 → 4.1.8
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 +16 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -667,6 +667,10 @@ var WebStaticConfigSchema = {
|
|
|
667
667
|
maximum: 3e4,
|
|
668
668
|
errorMessage: "waitForTimeout must be > 0 and <= 30000"
|
|
669
669
|
},
|
|
670
|
+
userAgent: {
|
|
671
|
+
type: "string",
|
|
672
|
+
errorMessage: "User Agent value must be a valid string"
|
|
673
|
+
},
|
|
670
674
|
execute: {
|
|
671
675
|
type: "object",
|
|
672
676
|
properties: {
|
|
@@ -1530,7 +1534,7 @@ var authExec_default = (ctx) => {
|
|
|
1530
1534
|
};
|
|
1531
1535
|
|
|
1532
1536
|
// package.json
|
|
1533
|
-
var version = "4.1.
|
|
1537
|
+
var version = "4.1.8";
|
|
1534
1538
|
var package_default = {
|
|
1535
1539
|
name: "@lambdatest/smartui-cli",
|
|
1536
1540
|
version,
|
|
@@ -2112,7 +2116,8 @@ var ctx_default = (options) => {
|
|
|
2112
2116
|
ignoreHTTPSErrors: (_i = config.ignoreHTTPSErrors) != null ? _i : false,
|
|
2113
2117
|
skipBuildCreation: (_j = config.skipBuildCreation) != null ? _j : false,
|
|
2114
2118
|
tunnel: (_k = config.tunnel) != null ? _k : false,
|
|
2115
|
-
tunnelName: config.tunnelName || ""
|
|
2119
|
+
tunnelName: config.tunnelName || "",
|
|
2120
|
+
userAgent: config.userAgent || ""
|
|
2116
2121
|
},
|
|
2117
2122
|
uploadFilePath: "",
|
|
2118
2123
|
webStaticConfig: [],
|
|
@@ -3471,7 +3476,7 @@ var createBuild_default = (ctx) => {
|
|
|
3471
3476
|
function captureScreenshotsForConfig(ctx, browsers, urlConfig, browserName, renderViewports) {
|
|
3472
3477
|
return __async(this, null, function* () {
|
|
3473
3478
|
ctx.log.debug(`*** urlConfig ${JSON.stringify(urlConfig)}`);
|
|
3474
|
-
let { name, url, waitForTimeout, execute, pageEvent } = urlConfig;
|
|
3479
|
+
let { name, url, waitForTimeout, execute, pageEvent, userAgent } = urlConfig;
|
|
3475
3480
|
let afterNavigationScript = execute == null ? void 0 : execute.afterNavigation;
|
|
3476
3481
|
let beforeSnapshotScript = execute == null ? void 0 : execute.beforeSnapshot;
|
|
3477
3482
|
let waitUntilEvent = pageEvent || process.env.SMARTUI_PAGE_WAIT_UNTIL_EVENT || "load";
|
|
@@ -3489,6 +3494,14 @@ function captureScreenshotsForConfig(ctx, browsers, urlConfig, browserName, rend
|
|
|
3489
3494
|
contextOptions.userAgent = constants_default.SAFARI_USER_AGENT;
|
|
3490
3495
|
else if (browserName == constants_default.EDGE)
|
|
3491
3496
|
contextOptions.userAgent = constants_default.EDGE_USER_AGENT;
|
|
3497
|
+
if (ctx.config.userAgent || userAgent) {
|
|
3498
|
+
if (ctx.config.userAgent !== "") {
|
|
3499
|
+
contextOptions.userAgent = ctx.config.userAgent;
|
|
3500
|
+
}
|
|
3501
|
+
if (userAgent && userAgent !== "") {
|
|
3502
|
+
contextOptions.userAgent = userAgent;
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3492
3505
|
try {
|
|
3493
3506
|
const browser = browsers[browserName];
|
|
3494
3507
|
context = yield browser == null ? void 0 : browser.newContext(contextOptions);
|