@mablhq/mabl-cli 2.61.18 → 2.63.3
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/browserEngines/chromiumBrowserEngine.js +5 -0
- package/browserEngines/firefoxBrowserEngine.js +25 -9
- package/browserLauncher/index.js +1 -1
- package/commands/constants.js +9 -3
- package/commands/flows/flows_cmds/export.js +18 -1
- package/commands/tests/testsUtil.js +7 -7
- package/commands/tests/tests_cmds/create.js +12 -8
- package/commands/tests/tests_cmds/export.js +12 -1
- package/core/execution/ApiTestUtils.js +72 -0
- package/core/trainer/trainingSessions.js +2 -1
- package/execution/index.js +1 -1
- package/package.json +1 -1
|
@@ -103,6 +103,11 @@ class ChromiumBrowserEngine {
|
|
|
103
103
|
else if (proxyInfo.socksProxy) {
|
|
104
104
|
commandLineArgs.push(`--proxy-server=socks=${proxyInfo.socksProxy}`);
|
|
105
105
|
}
|
|
106
|
+
else if (proxyInfo.httpProxy) {
|
|
107
|
+
const proxyUrl = new URL(proxyInfo.httpProxy);
|
|
108
|
+
const proxyAddress = `${proxyUrl.hostname}:${proxyUrl.port}`;
|
|
109
|
+
commandLineArgs.push(`--proxy-server=http=${proxyAddress};https=${proxyAddress}`);
|
|
110
|
+
}
|
|
106
111
|
else {
|
|
107
112
|
throw new Error('no proxy provided for cloud run');
|
|
108
113
|
}
|
|
@@ -54,25 +54,41 @@ class FirefoxBrowserEngine {
|
|
|
54
54
|
permissions: ['geolocation', 'notifications'],
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
getExecutionEngineBrowserLaunchOptions(options,
|
|
57
|
+
getExecutionEngineBrowserLaunchOptions(options, proxyInfo) {
|
|
58
|
+
if (Object.keys(this.getProxyPreferences(proxyInfo)).length === 0) {
|
|
59
|
+
throw new Error('no proxy provided for cloud run');
|
|
60
|
+
}
|
|
58
61
|
return {
|
|
59
62
|
commandLineArgs: [],
|
|
60
63
|
defaultDeviceDescriptor: (0, mobileEmulationUtil_1.getDeviceDescriptorForEmulation)(options.emulationConfig),
|
|
61
64
|
};
|
|
62
65
|
}
|
|
63
|
-
|
|
64
|
-
const
|
|
66
|
+
getProxyPreferences(proxyInfo) {
|
|
67
|
+
const proxyPreferences = {};
|
|
65
68
|
if (proxyInfo?.pacProxy) {
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
proxyPreferences['network.proxy.autoconfig_url'] = proxyInfo.pacProxy;
|
|
70
|
+
proxyPreferences['network.proxy.type'] = 2;
|
|
68
71
|
}
|
|
69
72
|
else if (proxyInfo?.socksProxy) {
|
|
70
73
|
const socksUrl = new URL(proxyInfo.socksProxy);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
proxyPreferences['network.proxy.socks'] = socksUrl.hostname;
|
|
75
|
+
proxyPreferences['network.proxy.socks_port'] = Number.parseInt(socksUrl.port);
|
|
76
|
+
proxyPreferences['network.proxy.socks_version'] = 5;
|
|
77
|
+
proxyPreferences['network.proxy.type'] = 1;
|
|
78
|
+
}
|
|
79
|
+
else if (proxyInfo?.httpProxy) {
|
|
80
|
+
const proxyUrl = new URL(proxyInfo.httpProxy);
|
|
81
|
+
proxyPreferences['network.proxy.http'] = proxyUrl.hostname;
|
|
82
|
+
proxyPreferences['network.proxy.http_port'] = Number.parseInt(proxyUrl.port);
|
|
83
|
+
proxyPreferences['network.proxy.ssl'] = proxyUrl.hostname;
|
|
84
|
+
proxyPreferences['network.proxy.ssl_port'] = Number.parseInt(proxyUrl.port);
|
|
85
|
+
proxyPreferences['network.proxy.share_proxy_settings'] = true;
|
|
86
|
+
proxyPreferences['network.proxy.type'] = 1;
|
|
75
87
|
}
|
|
88
|
+
return proxyPreferences;
|
|
89
|
+
}
|
|
90
|
+
prepareBrowserPreferencesDirectory(_windowPlacement, proxyInfo) {
|
|
91
|
+
const customPreferences = this.getProxyPreferences(proxyInfo);
|
|
76
92
|
return (0, async_retry_1.default)(() => {
|
|
77
93
|
const preferenceFileName = 'user.js';
|
|
78
94
|
const tempBrowserPreferencesDirectory = (0, browserEngine_1.getTempBrowserPrefDirectory)(this.name());
|