@mablhq/mabl-cli 1.16.32 → 1.18.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/api/basicApiClient.js +9 -4
- package/api/featureSet.js +1 -4
- package/api/mablApiClient.js +16 -9
- package/browserLauncher/browserLauncherFactory.js +4 -4
- package/browserLauncher/elementHandle.js +2 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +8 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +11 -9
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +23 -29
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +28 -6
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +5 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +13 -9
- package/browserLauncher/runnerType.js +0 -1
- package/cli.js +12 -8
- package/commands/applications/applications_cmds/describe.js +4 -4
- package/commands/applications/applications_cmds/list.js +4 -4
- package/commands/auth/auth_cmds/activate-key.js +1 -1
- package/commands/branches/branches_cmds/create.js +4 -4
- package/commands/branches/branches_cmds/describe.js +3 -3
- package/commands/branches/branches_cmds/list.js +3 -3
- package/commands/branches/branches_cmds/merge.js +4 -4
- package/commands/commandUtil/codeInsights.js +4 -2
- package/commands/commandUtil/describe.js +1 -1
- package/commands/commandUtil/fileUtil.js +5 -1
- package/commands/commandUtil/util.js +2 -2
- package/commands/config/config_cmds/delete.js +1 -1
- package/commands/config/config_cmds/set.js +1 -1
- package/commands/constants.js +3 -1
- package/commands/credentials/credentials_cmds/list.js +4 -4
- package/commands/deploy/deploy_cmds/create.js +18 -13
- package/commands/deploy/deploy_cmds/describe.js +5 -5
- package/commands/deploy/deploy_cmds/executionResultPresenter.js +1 -1
- package/commands/deploy/deploy_cmds/list.js +4 -4
- package/commands/deploy/deploy_cmds/watch.js +2 -2
- package/commands/environments/environments_cmds/create.js +7 -7
- package/commands/environments/environments_cmds/delete.js +1 -1
- package/commands/environments/environments_cmds/describe.js +4 -4
- package/commands/environments/environments_cmds/list.js +4 -4
- package/commands/environments/environments_cmds/update.js +2 -2
- package/commands/environments/environments_cmds/urls_cmds/add.js +3 -3
- package/commands/environments/environments_cmds/urls_cmds/list.js +2 -2
- package/commands/flows/flows_cmds/export.js +5 -5
- package/commands/flows/flows_cmds/list.js +2 -2
- package/commands/link-agents/link-agents_cmds/delete.js +1 -1
- package/commands/plans/plans_cmds/describe.js +4 -4
- package/commands/plans/plans_cmds/list.js +2 -2
- package/commands/test-runs/test-runs_cmds/export.js +2 -2
- package/commands/tests/executionUtil.js +5 -5
- package/commands/tests/testsUtil.js +30 -18
- package/commands/tests/tests_cmds/create.js +3 -3
- package/commands/tests/tests_cmds/edit.js +3 -3
- package/commands/tests/tests_cmds/export.js +7 -7
- package/commands/tests/tests_cmds/import.js +35 -14
- package/commands/tests/tests_cmds/list.js +3 -3
- package/commands/tests/tests_cmds/run-alpha.js +3 -3
- package/commands/tests/tests_cmds/run-cloud.js +4 -4
- package/commands/tests/tests_cmds/run-legacy.js +8 -8
- package/commands/tests/tests_cmds/run.js +13 -8
- package/commands/tests/tests_cmds/trainer_cmds/trainerUtil.js +2 -2
- package/commands/tests/tests_cmds/trainer_cmds/update.js +1 -1
- package/commands/tests/tests_cmds/trainer_cmds/version.js +2 -2
- package/commands/workspaces/workspace_cmds/copy.js +2 -2
- package/commands/workspaces/workspace_cmds/describe.js +4 -4
- package/commands/workspaces/workspace_cmds/list.js +2 -2
- package/configGenerators/flowConfigGenerator.js +1 -1
- package/configGenerators/selIdeGenerator.js +6 -6
- package/core/messaging/actions/runnerActions.js +2 -2
- package/core/trainer/openUtils.js +2 -2
- package/core/trainer/trainingSessions.js +26 -26
- package/domUtil/index.js +1 -1
- package/domUtil/index.js.LICENSE.txt +5 -5
- package/env/env.js +5 -1
- package/execution/index.js +1 -1
- package/execution/index.js.LICENSE.txt +7 -5
- package/index.d.ts +0 -1
- package/mablApi/index.js +1 -1
- package/mablscript/AttributesConstants.js +2 -1
- package/mablscript/MablAction.js +1 -1
- package/mablscript/MablStep.js +26 -14
- package/mablscript/actions/AwaitPDFDownloadAction.js +2 -1
- package/mablscript/actions/ConditionAction.js +12 -4
- package/mablscript/actions/ExtractAction.js +16 -7
- package/mablscript/actions/FindAction.js +105 -80
- package/mablscript/actions/GenerateRandomStringAction.js +2 -1
- package/mablscript/actions/GetUrlAction.js +2 -2
- package/mablscript/actions/GetVariableValue.js +3 -3
- package/mablscript/actions/JavaScriptAction.js +16 -16
- package/mablscript/diffing/diffingUtil.js +146 -0
- package/mablscript/importer.js +26 -8
- package/mablscript/steps/AccessibilityCheck.js +9 -7
- package/mablscript/steps/AssertStep.js +60 -46
- package/mablscript/steps/AssertStepOld.js +41 -23
- package/mablscript/steps/AwaitTabStep.js +7 -6
- package/mablscript/steps/ClickAndHoldStep.js +6 -6
- package/mablscript/steps/ClickStep.js +6 -6
- package/mablscript/steps/CreateVariableStep.js +8 -8
- package/mablscript/steps/DoubleClickStep.js +7 -7
- package/mablscript/steps/DownloadStep.js +3 -2
- package/mablscript/steps/EchoStep.js +5 -3
- package/mablscript/steps/ElseIfConditionStep.js +5 -2
- package/mablscript/steps/EnterTextStep.js +13 -10
- package/mablscript/steps/EvaluateFlowStep.js +40 -0
- package/mablscript/steps/HoverStep.js +6 -6
- package/mablscript/steps/IfConditionStep.js +8 -7
- package/mablscript/steps/NavigateStep.js +1 -1
- package/mablscript/steps/ReleaseStep.js +7 -6
- package/mablscript/steps/RemoveCookieStep.js +2 -3
- package/mablscript/steps/SelectStep.js +5 -5
- package/mablscript/steps/SendHttpRequestStep.js +3 -3
- package/mablscript/steps/SendKeyStep.js +9 -9
- package/mablscript/steps/SetCookieStep.js +2 -4
- package/mablscript/steps/SetFilesStep.js +5 -5
- package/mablscript/steps/SetViewportStep.js +2 -2
- package/mablscript/steps/SwitchContextStep.js +12 -12
- package/mablscript/steps/VisitUrlStep.js +3 -2
- package/mablscript/steps/WaitStep.js +2 -5
- package/mablscript/steps/WaitUntilStep.js +3 -3
- package/{browserLauncher/puppeteerBrowserLauncher/internals.js → mablscript/types/EvaluateFlowStepDescriptor.js} +0 -0
- package/mablscript/types/GetCurrentLocationDescriptor.js +4 -3
- package/mablscript/types/OperatingSystemDescriptor.js +5 -1
- package/mablscript/types/VariableNamespace.js +1 -1
- package/mablscriptFind/index.js +1 -1
- package/mablscriptFind/index.js.LICENSE.txt +5 -5
- package/observers/mockObserver.js +4 -2
- package/package.json +55 -56
- package/popupDismissal/index.js +3 -3
- package/providers/authenticationProvider.js +3 -3
- package/providers/logging/loggingProvider.js +5 -1
- package/proxy/index.js +2 -1
- package/proxy/index.js.LICENSE.txt +5 -0
- package/reporters/mochAwesome/mochAwesomeReporter.js +11 -7
- package/reporters/reporter.js +1 -1
- package/resources/mablFind.js +1 -1
- package/resources/pdf-viewer/index.js +1 -1
- package/resources/pdf-viewer/libEmbeddedPdfHandler.js +11 -2
- package/resources/popupDismissal.js +1 -1
- package/util/RichPromise.js +1 -0
- package/util/actionabilityUtil.js +16 -35
- package/util/analytics.js +7 -3
- package/util/downloadUtil.js +6 -2
- package/util/httpUtil.js +6 -2
- package/util/markdownUtil.js +1 -1
- package/util/pureUtil.js +5 -1
- package/util/resourceUtil.js +5 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +0 -134
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowserLauncher.js +0 -45
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +0 -139
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerFrame.js +0 -115
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpRequest.js +0 -38
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +0 -27
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerJsHandle.js +0 -36
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +0 -331
- package/browserLauncher/puppeteerBrowserLauncher/wrappers.js +0 -25
package/api/basicApiClient.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -53,11 +57,12 @@ var AuthType;
|
|
|
53
57
|
class BasicApiClient {
|
|
54
58
|
constructor(options) {
|
|
55
59
|
var _a, _b, _c, _d;
|
|
56
|
-
const config = httpUtil_1.axiosProxyConfig({
|
|
60
|
+
const config = (0, httpUtil_1.axiosProxyConfig)({
|
|
57
61
|
sslVerify: options.sslVerify,
|
|
58
62
|
proxyHost: options.proxyUrl,
|
|
59
63
|
});
|
|
60
|
-
config.timeout =
|
|
64
|
+
config.timeout =
|
|
65
|
+
(_c = (_a = options.requestTimeoutMillis) !== null && _a !== void 0 ? _a : (_b = options.retryConfig) === null || _b === void 0 ? void 0 : _b.requestTimeoutMillis) !== null && _c !== void 0 ? _c : DEFAULT_RETRYABLE_REQUEST_TIMEOUT_MILLISECONDS;
|
|
61
66
|
switch (options.authType) {
|
|
62
67
|
case AuthType.ApiKey:
|
|
63
68
|
config.auth = {
|
|
@@ -184,7 +189,7 @@ class BasicApiClient {
|
|
|
184
189
|
},
|
|
185
190
|
forever: false,
|
|
186
191
|
};
|
|
187
|
-
return asyncUtil_1.promiseWithTimeout(async_retry_1.default(async (bail) => {
|
|
192
|
+
return (0, asyncUtil_1.promiseWithTimeout)((0, async_retry_1.default)(async (bail) => {
|
|
188
193
|
try {
|
|
189
194
|
return await requestFunc();
|
|
190
195
|
}
|
package/api/featureSet.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FeatureSet = exports.FindImplementationVersion = void 0;
|
|
4
4
|
const runnerType_1 = require("../browserLauncher/runnerType");
|
|
5
|
-
const PLAYWRIGHT_FEATURE_FLAG = 'nodejs_execution_engine_playwright';
|
|
6
5
|
const SMARTER_WAIT_FEATURE_FLAG = 'smarter_wait';
|
|
7
6
|
var FindImplementationVersion;
|
|
8
7
|
(function (FindImplementationVersion) {
|
|
@@ -14,9 +13,7 @@ class FeatureSet {
|
|
|
14
13
|
this.featureFlags = featureFlags;
|
|
15
14
|
}
|
|
16
15
|
getRunnerType() {
|
|
17
|
-
return
|
|
18
|
-
? runnerType_1.RunnerType.Playwright
|
|
19
|
-
: runnerType_1.RunnerType.Puppeteer;
|
|
16
|
+
return runnerType_1.RunnerType.Playwright;
|
|
20
17
|
}
|
|
21
18
|
getFindImplementationVersion() {
|
|
22
19
|
return this.featureFlags.has(SMARTER_WAIT_FEATURE_FLAG)
|
package/api/mablApiClient.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -299,7 +303,7 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
299
303
|
return await this.makeGetRequest(`${env_1.BASE_API_URL}/accounts/${accountId}`);
|
|
300
304
|
}
|
|
301
305
|
catch (error) {
|
|
302
|
-
throw
|
|
306
|
+
throw toApiError(`Failed to get account`, error);
|
|
303
307
|
}
|
|
304
308
|
}
|
|
305
309
|
async getApiKeyDetails() {
|
|
@@ -453,7 +457,7 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
453
457
|
return await this.makePostRequest(`${env_1.BASE_API_URL}/mailbox/address`, body);
|
|
454
458
|
}
|
|
455
459
|
catch (error) {
|
|
456
|
-
throw
|
|
460
|
+
throw toApiError('Failed to create mailbox email address', error);
|
|
457
461
|
}
|
|
458
462
|
}
|
|
459
463
|
async createBranch(workspaceId, branchName) {
|
|
@@ -516,10 +520,14 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
516
520
|
if (options.mablBranch) {
|
|
517
521
|
requestBody.source_control_tag = options.mablBranch;
|
|
518
522
|
}
|
|
519
|
-
requestBody.properties.repository_branch_name =
|
|
520
|
-
|
|
521
|
-
requestBody.properties.
|
|
522
|
-
|
|
523
|
+
requestBody.properties.repository_branch_name =
|
|
524
|
+
(_b = options.sourceControlMetadata) === null || _b === void 0 ? void 0 : _b.branchName;
|
|
525
|
+
requestBody.properties.repository_tag_name =
|
|
526
|
+
(_c = options.sourceControlMetadata) === null || _c === void 0 ? void 0 : _c.branchName;
|
|
527
|
+
requestBody.properties.repository_url =
|
|
528
|
+
(_d = options.sourceControlMetadata) === null || _d === void 0 ? void 0 : _d.repoUrl;
|
|
529
|
+
requestBody.properties.repository_name =
|
|
530
|
+
(_e = options.sourceControlMetadata) === null || _e === void 0 ? void 0 : _e.repoName;
|
|
523
531
|
const planOverrides = {};
|
|
524
532
|
if ((_f = options.browserTypes) === null || _f === void 0 ? void 0 : _f.length) {
|
|
525
533
|
planOverrides.browser_types = options.browserTypes;
|
|
@@ -712,8 +720,7 @@ function sortTemporallyAscending(entities) {
|
|
|
712
720
|
entities.sort((a, b) => (a.created_time >= b.created_time ? 1 : -1));
|
|
713
721
|
}
|
|
714
722
|
function toApiError(summary, cause) {
|
|
715
|
-
|
|
716
|
-
const errorResponse = (_a = cause) === null || _a === void 0 ? void 0 : _a.response;
|
|
723
|
+
const errorResponse = cause === null || cause === void 0 ? void 0 : cause.response;
|
|
717
724
|
const code = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.status;
|
|
718
725
|
const mablError = errorResponse === null || errorResponse === void 0 ? void 0 : errorResponse.data;
|
|
719
726
|
const message = `${summary}: ${mablError
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BrowserLauncherFactory = void 0;
|
|
7
|
-
const puppeteerBrowserLauncher_1 = require("./puppeteerBrowserLauncher/puppeteerBrowserLauncher");
|
|
8
7
|
const playwrightBrowserLauncher_1 = require("./playwrightBrowserLauncher/playwrightBrowserLauncher");
|
|
9
8
|
const runnerType_1 = require("./runnerType");
|
|
10
9
|
const logUtils_1 = require("../util/logUtils");
|
|
@@ -18,13 +17,14 @@ class BrowserLauncherFactory {
|
|
|
18
17
|
static createRunner(runnerType = runnerType_1.RunnerType.Playwright, loggerFunc) {
|
|
19
18
|
const runnerFromEnv = BrowserLauncherFactory.getRunnerFromEnvironment();
|
|
20
19
|
const runner = runnerFromEnv ? runnerFromEnv : runnerType;
|
|
21
|
-
loggerFunc =
|
|
20
|
+
loggerFunc =
|
|
21
|
+
loggerFunc !== null && loggerFunc !== void 0 ? loggerFunc : ((line) => (0, logUtils_1.logCliOutput)(loggingProvider_1.LogLevel.Info, line));
|
|
22
22
|
if (runner === runnerType_1.RunnerType.Playwright) {
|
|
23
23
|
loggerFunc(chalk_1.default.cyan(`Browser launcher:`, chalk_1.default.magenta('Playwright')));
|
|
24
24
|
return new playwrightBrowserLauncher_1.PlaywrightBrowserLauncher();
|
|
25
25
|
}
|
|
26
|
-
loggerFunc(chalk_1.default.
|
|
27
|
-
|
|
26
|
+
loggerFunc(chalk_1.default.red.bold(`Unsupported runner type:`, runner));
|
|
27
|
+
throw new Error(`Unsupported runner type:[${runner}]`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
exports.BrowserLauncherFactory = BrowserLauncherFactory;
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isElementHandle = exports.getHighlightColor = exports.MAX_HIGHLIGHT_OPACITY = void 0;
|
|
4
4
|
exports.MAX_HIGHLIGHT_OPACITY = 0.9;
|
|
5
|
-
|
|
5
|
+
const getHighlightColor = (transparency) => ({
|
|
6
6
|
r: 196,
|
|
7
7
|
g: 68,
|
|
8
8
|
b: 183,
|
|
9
9
|
a: transparency,
|
|
10
10
|
});
|
|
11
|
+
exports.getHighlightColor = getHighlightColor;
|
|
11
12
|
function isElementHandle(value) {
|
|
12
13
|
return (value &&
|
|
13
14
|
typeof value === 'object' &&
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -124,5 +128,8 @@ class PlaywrightBrowser extends events_1.default {
|
|
|
124
128
|
await playwrightPage.waitForInitialization();
|
|
125
129
|
return playwrightPage;
|
|
126
130
|
}
|
|
131
|
+
exposeFunction(name, callback) {
|
|
132
|
+
return this.defaultContext.exposeFunction(name, callback);
|
|
133
|
+
}
|
|
127
134
|
}
|
|
128
135
|
exports.PlaywrightBrowser = PlaywrightBrowser;
|
|
@@ -23,20 +23,22 @@ class PlaywrightBrowserLauncher {
|
|
|
23
23
|
:
|
|
24
24
|
null;
|
|
25
25
|
const defaultContext = await test_1.chromium.launchPersistentContext(options.userDataDir, {
|
|
26
|
-
|
|
27
|
-
headless: options.headless,
|
|
26
|
+
acceptDownloads: true,
|
|
28
27
|
args: options.args,
|
|
29
|
-
|
|
28
|
+
bypassCSP: options.bypassContentSecurityPolicy,
|
|
29
|
+
deviceScaleFactor: (_a = options.defaultDeviceDescriptor) === null || _a === void 0 ? void 0 : _a.deviceScaleFactor,
|
|
30
30
|
downloadsPath: options.downloadPath,
|
|
31
31
|
executablePath: options.executablePath,
|
|
32
|
-
viewport,
|
|
33
|
-
acceptDownloads: true,
|
|
34
|
-
httpCredentials: options.credentials,
|
|
35
32
|
extraHTTPHeaders: options.extraHttpHeaders,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
hasTouch: (_b = options.defaultDeviceDescriptor) === null || _b === void 0 ? void 0 : _b.hasTouch,
|
|
34
|
+
headless: options.headless,
|
|
35
|
+
httpCredentials: options.credentials,
|
|
36
|
+
ignoreDefaultArgs: options.ignoreDefaultArgs,
|
|
37
|
+
ignoreHTTPSErrors: true,
|
|
38
|
+
isMobile: (_c = options.defaultDeviceDescriptor) === null || _c === void 0 ? void 0 : _c.isMobile,
|
|
39
39
|
timeout: BROWSER_LAUNCH_TIMEOUT_MS,
|
|
40
|
+
userAgent: options.userAgent,
|
|
41
|
+
viewport,
|
|
40
42
|
});
|
|
41
43
|
return new playwrightBrowser_1.PlaywrightBrowser(defaultContext, path_1.default.join(options.downloadPath, 'final'), '');
|
|
42
44
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -44,12 +48,12 @@ class PlaywrightJsHandle {
|
|
|
44
48
|
}
|
|
45
49
|
async evaluateHandle(code, arg) {
|
|
46
50
|
const handle = await this.handle.evaluateHandle(code, PlaywrightJsHandle.unwrapProperties(arg));
|
|
47
|
-
return utils_1.mapIfNotNull(handle, (handle) => handle.asElement()
|
|
51
|
+
return (0, utils_1.mapIfNotNull)(handle, (handle) => handle.asElement()
|
|
48
52
|
? new PlaywrightElementHandle(handle.asElement(), this.page)
|
|
49
53
|
: new PlaywrightJsHandle(handle, this.page));
|
|
50
54
|
}
|
|
51
55
|
async getProperty(propertyName) {
|
|
52
|
-
return utils_1.mapIfNotNull(await this.handle.getProperty(propertyName), (handle) => new PlaywrightJsHandle(handle, this.page));
|
|
56
|
+
return (0, utils_1.mapIfNotNull)(await this.handle.getProperty(propertyName), (handle) => new PlaywrightJsHandle(handle, this.page));
|
|
53
57
|
}
|
|
54
58
|
jsonValue() {
|
|
55
59
|
return this.handle.jsonValue();
|
|
@@ -97,7 +101,7 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
97
101
|
this.elementImpl = playwright._toImpl(this.element);
|
|
98
102
|
this.cdpSession = (_c = (_b = (_a = this.elementImpl) === null || _a === void 0 ? void 0 : _a._context) === null || _b === void 0 ? void 0 : _b._delegate) === null || _c === void 0 ? void 0 : _c._client;
|
|
99
103
|
if (this.elementImpl === undefined) {
|
|
100
|
-
logUtils_1.logInternal(`Unable to get the Element's internal implementation.
|
|
104
|
+
(0, logUtils_1.logInternal)(`Unable to get the Element's internal implementation.
|
|
101
105
|
Some functionality, such as getting the clickable point or element highlighting might not work.`);
|
|
102
106
|
}
|
|
103
107
|
else if (this.cdpSession === undefined) {
|
|
@@ -106,13 +110,13 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
106
110
|
: ((_f = this.elementImpl) === null || _f === void 0 ? void 0 : _f._context) !== undefined
|
|
107
111
|
? '_delegate'
|
|
108
112
|
: '_context';
|
|
109
|
-
logUtils_1.logInternal(`Unable to get the CDP Session of the element handle.
|
|
113
|
+
(0, logUtils_1.logInternal)(`Unable to get the CDP Session of the element handle.
|
|
110
114
|
${undefinedField} is undefined.
|
|
111
115
|
Some functionality, such as element highlighting will not work.`);
|
|
112
116
|
}
|
|
113
117
|
}
|
|
114
118
|
catch (e) {
|
|
115
|
-
logUtils_1.logInternal(`Unable to get the element handle's implementation. Error: ${e}`);
|
|
119
|
+
(0, logUtils_1.logInternal)(`Unable to get the element handle's implementation. Error: ${e}`);
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
uploadFile(filePath) {
|
|
@@ -122,10 +126,10 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
122
126
|
return (await this.element.$$(`xpath=${xpathQuery}`)).map((element) => new PlaywrightElementHandle(element, this.page));
|
|
123
127
|
}
|
|
124
128
|
asElement() {
|
|
125
|
-
return utils_1.mapIfNotNull(this.handle.asElement(), (handle) => new PlaywrightElementHandle(handle, this.page));
|
|
129
|
+
return (0, utils_1.mapIfNotNull)(this.handle.asElement(), (handle) => new PlaywrightElementHandle(handle, this.page));
|
|
126
130
|
}
|
|
127
131
|
async boundingBox() {
|
|
128
|
-
return utils_1.mapIfNotNull(await this.element.boundingBox(), (boundingBox) => boundingBox);
|
|
132
|
+
return (0, utils_1.mapIfNotNull)(await this.element.boundingBox(), (boundingBox) => boundingBox);
|
|
129
133
|
}
|
|
130
134
|
async click(options) {
|
|
131
135
|
var _a, _b, _c, _d;
|
|
@@ -140,7 +144,7 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
140
144
|
}
|
|
141
145
|
catch (error) {
|
|
142
146
|
if (error.message.includes(exports.NAVIGATION_ERROR_MESSAGE)) {
|
|
143
|
-
logUtils_1.logInternal(`Action timed out due to navigation timeout. ${error.toString()}`);
|
|
147
|
+
(0, logUtils_1.logInternal)(`Action timed out due to navigation timeout. ${error.toString()}`);
|
|
144
148
|
return;
|
|
145
149
|
}
|
|
146
150
|
throw error;
|
|
@@ -158,7 +162,7 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
158
162
|
}
|
|
159
163
|
catch (error) {
|
|
160
164
|
if (error.message.includes(exports.NAVIGATION_ERROR_MESSAGE)) {
|
|
161
|
-
logUtils_1.logInternal(`Action timed out due to navigation timeout. ${error.toString()}`);
|
|
165
|
+
(0, logUtils_1.logInternal)(`Action timed out due to navigation timeout. ${error.toString()}`);
|
|
162
166
|
}
|
|
163
167
|
}
|
|
164
168
|
}
|
|
@@ -172,13 +176,13 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
172
176
|
return clickablePoint;
|
|
173
177
|
}
|
|
174
178
|
async contentFrame() {
|
|
175
|
-
return utils_1.mapIfNotNull(await this.element.contentFrame(), (frame) => this.page.getOrCreateFrame(frame));
|
|
179
|
+
return (0, utils_1.mapIfNotNull)(await this.element.contentFrame(), (frame) => this.page.getOrCreateFrame(frame));
|
|
176
180
|
}
|
|
177
181
|
focus() {
|
|
178
182
|
return this.element.focus();
|
|
179
183
|
}
|
|
180
184
|
async frame() {
|
|
181
|
-
return utils_1.mapIfNotNull(await this.element.ownerFrame(), (frame) => this.page.getOrCreateFrame(frame));
|
|
185
|
+
return (0, utils_1.mapIfNotNull)(await this.element.ownerFrame(), (frame) => this.page.getOrCreateFrame(frame));
|
|
182
186
|
}
|
|
183
187
|
hover() {
|
|
184
188
|
return this.element.hover();
|
|
@@ -190,30 +194,20 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
190
194
|
return this.element.selectOption(value);
|
|
191
195
|
}
|
|
192
196
|
async type(text, options) {
|
|
193
|
-
const timeout = PlaywrightElementHandle.getTypeTimeout(text, options);
|
|
194
197
|
await this.element.focus();
|
|
195
198
|
await this.element.selectText({ force: true });
|
|
196
199
|
return this.element.type(text, {
|
|
197
200
|
delay: options === null || options === void 0 ? void 0 : options.delay,
|
|
198
|
-
timeout,
|
|
201
|
+
timeout: 0,
|
|
199
202
|
});
|
|
200
203
|
}
|
|
201
|
-
static getTypeTimeout(text, options) {
|
|
202
|
-
var _a;
|
|
203
|
-
let timeout;
|
|
204
|
-
const newTimeout = text.length * ((_a = options === null || options === void 0 ? void 0 : options.delay) !== null && _a !== void 0 ? _a : 1) * 2;
|
|
205
|
-
if (newTimeout > types_1.DefaultTimeouts.defaultTextInputTimeoutMs) {
|
|
206
|
-
timeout = newTimeout;
|
|
207
|
-
}
|
|
208
|
-
return timeout;
|
|
209
|
-
}
|
|
210
204
|
press(key) {
|
|
211
205
|
return this.element.press(key);
|
|
212
206
|
}
|
|
213
207
|
getRemoteObjectId() {
|
|
214
208
|
var _a, _b, _c;
|
|
215
209
|
if (((_a = this.elementImpl) === null || _a === void 0 ? void 0 : _a._objectId) === undefined) {
|
|
216
|
-
logUtils_1.logInternal('ObjectId of an element handle was not found.');
|
|
210
|
+
(0, logUtils_1.logInternal)('ObjectId of an element handle was not found.');
|
|
217
211
|
}
|
|
218
212
|
return (_c = (_b = this.elementImpl) === null || _b === void 0 ? void 0 : _b._objectId) !== null && _c !== void 0 ? _c : '';
|
|
219
213
|
}
|
|
@@ -228,8 +222,8 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
228
222
|
const highlightConfig = {
|
|
229
223
|
backendNodeId: nodeInfo.node.backendNodeId,
|
|
230
224
|
highlightConfig: {
|
|
231
|
-
borderColor: elementHandle_1.getHighlightColor(0),
|
|
232
|
-
contentColor: elementHandle_1.getHighlightColor(1),
|
|
225
|
+
borderColor: (0, elementHandle_1.getHighlightColor)(0),
|
|
226
|
+
contentColor: (0, elementHandle_1.getHighlightColor)(1),
|
|
233
227
|
colorFormat: 'rgb',
|
|
234
228
|
},
|
|
235
229
|
};
|
|
@@ -252,7 +246,7 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
252
246
|
x * (1 - x) * 4 * elementHandle_1.MAX_HIGHLIGHT_OPACITY;
|
|
253
247
|
}
|
|
254
248
|
await this.makeCdpCall('Overlay.highlightNode', highlightConfig);
|
|
255
|
-
await testsUtil_1.sleep(phaseIntervalMilliseconds);
|
|
249
|
+
await (0, testsUtil_1.sleep)(phaseIntervalMilliseconds);
|
|
256
250
|
}
|
|
257
251
|
}
|
|
258
252
|
async enableDom() {
|
|
@@ -273,11 +267,11 @@ class PlaywrightElementHandle extends PlaywrightJsHandle {
|
|
|
273
267
|
}
|
|
274
268
|
async getAttribute(attributeName) {
|
|
275
269
|
const result = await this.element.evaluate((el, attributeName) => el.getAttribute(attributeName), attributeName);
|
|
276
|
-
return pureUtil_1.isNullish(result) ? undefined : result;
|
|
270
|
+
return (0, pureUtil_1.isNullish)(result) ? undefined : result;
|
|
277
271
|
}
|
|
278
272
|
async getInnerText() {
|
|
279
273
|
const result = await this.element.evaluate((el) => el.innerText);
|
|
280
|
-
return pureUtil_1.isNullish(result) ? undefined : result;
|
|
274
|
+
return (0, pureUtil_1.isNullish)(result) ? undefined : result;
|
|
281
275
|
}
|
|
282
276
|
}
|
|
283
277
|
exports.PlaywrightElementHandle = PlaywrightElementHandle;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -44,7 +48,7 @@ class PlaywrightFrame extends browserLauncher_1.Frame {
|
|
|
44
48
|
if (this.utilityWorldAvailable === undefined) {
|
|
45
49
|
await Promise.race([
|
|
46
50
|
this._contextData.get(UTILITY_CONTEXT).contextPromise,
|
|
47
|
-
testsUtil_1.sleep(WAIT_FOR_CONTEXT_TIMEOUT),
|
|
51
|
+
(0, testsUtil_1.sleep)(WAIT_FOR_CONTEXT_TIMEOUT),
|
|
48
52
|
]);
|
|
49
53
|
this.utilityWorldAvailable =
|
|
50
54
|
this._contextData.get(UTILITY_CONTEXT).context !== null;
|
|
@@ -75,7 +79,7 @@ class PlaywrightFrame extends browserLauncher_1.Frame {
|
|
|
75
79
|
functionHandleOverride.bind(serverFrame);
|
|
76
80
|
}
|
|
77
81
|
async $(selector) {
|
|
78
|
-
return utils_1.mapIfNotNull(await this.frame.$(selector), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this.parentPage));
|
|
82
|
+
return (0, utils_1.mapIfNotNull)(await this.frame.$(selector), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this.parentPage));
|
|
79
83
|
}
|
|
80
84
|
async $$(selector) {
|
|
81
85
|
const maybePlaywrightHandles = await this.frame.$$(selector);
|
|
@@ -128,7 +132,7 @@ class PlaywrightFrame extends browserLauncher_1.Frame {
|
|
|
128
132
|
timeout: types_1.DefaultTimeouts.quickActionTimeoutMs,
|
|
129
133
|
});
|
|
130
134
|
}
|
|
131
|
-
return utils_1.mapIfNotNull(response, (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this.parentPage, response));
|
|
135
|
+
return (0, utils_1.mapIfNotNull)(response, (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this.parentPage, response));
|
|
132
136
|
}
|
|
133
137
|
catch (e) {
|
|
134
138
|
if (e instanceof playwright.errors.TimeoutError) {
|
|
@@ -144,13 +148,13 @@ class PlaywrightFrame extends browserLauncher_1.Frame {
|
|
|
144
148
|
return this.frame.name();
|
|
145
149
|
}
|
|
146
150
|
parentFrame() {
|
|
147
|
-
return utils_1.mapIfNotNull(this.frame.parentFrame(), (frame) => this.parentPage.getOrCreateFrame(frame));
|
|
151
|
+
return (0, utils_1.mapIfNotNull)(this.frame.parentFrame(), (frame) => this.parentPage.getOrCreateFrame(frame));
|
|
148
152
|
}
|
|
149
153
|
url() {
|
|
150
154
|
return this.frame.url();
|
|
151
155
|
}
|
|
152
156
|
async waitForSelector(selector, options) {
|
|
153
|
-
return utils_1.mapIfNotNull(await this.frame.waitForSelector(selector, options), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this.parentPage));
|
|
157
|
+
return (0, utils_1.mapIfNotNull)(await this.frame.waitForSelector(selector, options), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this.parentPage));
|
|
154
158
|
}
|
|
155
159
|
page() {
|
|
156
160
|
return this.parentPage;
|
|
@@ -174,5 +178,23 @@ class PlaywrightFrame extends browserLauncher_1.Frame {
|
|
|
174
178
|
}
|
|
175
179
|
return this.frameImpl;
|
|
176
180
|
}
|
|
181
|
+
async initializeExposedFunctionInSecondaryWorld(functionName) {
|
|
182
|
+
var _a;
|
|
183
|
+
try {
|
|
184
|
+
const pageImpl = this.parentPage.getPageImpl();
|
|
185
|
+
if (!pageImpl) {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
const binding = (_a = pageImpl._pageBindings.get(functionName)) !== null && _a !== void 0 ? _a : pageImpl._browserContext._pageBindings.get(functionName);
|
|
189
|
+
if (!binding) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
await this.evaluateCodeInSecondaryWorld(binding.source, {});
|
|
193
|
+
}
|
|
194
|
+
catch (e) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
177
199
|
}
|
|
178
200
|
exports.PlaywrightFrame = PlaywrightFrame;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -68,7 +72,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
68
72
|
});
|
|
69
73
|
}
|
|
70
74
|
async waitForInitialization() {
|
|
71
|
-
this.openerPage = await utils_1.mapIfNotNull(await this.page.opener(), (page) => this.browser.getOrCreatePage(page));
|
|
75
|
+
this.openerPage = await (0, utils_1.mapIfNotNull)(await this.page.opener(), (page) => this.browser.getOrCreatePage(page));
|
|
72
76
|
this.fallbackCdpSession = await this.createFallbackCdpSession();
|
|
73
77
|
}
|
|
74
78
|
on(event, listener) {
|
|
@@ -143,7 +147,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
149
|
catch (error) {
|
|
146
|
-
logUtils_1.logInternal(`Unable to register event ${event.toString()}. Error: ${error}`);
|
|
150
|
+
(0, logUtils_1.logInternal)(`Unable to register event ${event.toString()}. Error: ${error}`);
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
153
|
async screenshot(clip) {
|
|
@@ -227,7 +231,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
227
231
|
async goto(url, options) {
|
|
228
232
|
try {
|
|
229
233
|
const response = await this.page.goto(url, options);
|
|
230
|
-
return utils_1.mapIfNotNull(response, (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
|
|
234
|
+
return (0, utils_1.mapIfNotNull)(response, (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
|
|
231
235
|
}
|
|
232
236
|
catch (e) {
|
|
233
237
|
if (e instanceof playwright.errors.TimeoutError) {
|
|
@@ -262,7 +266,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
262
266
|
}
|
|
263
267
|
async reload(options) {
|
|
264
268
|
try {
|
|
265
|
-
return utils_1.mapIfNotNull(await this.page.reload(options), (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
|
|
269
|
+
return (0, utils_1.mapIfNotNull)(await this.page.reload(options), (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, response));
|
|
266
270
|
}
|
|
267
271
|
catch (e) {
|
|
268
272
|
if (e instanceof playwright.errors.TimeoutError) {
|
|
@@ -305,7 +309,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
305
309
|
await this.setBrowserBounds(viewport.width, viewport.height);
|
|
306
310
|
}
|
|
307
311
|
catch (error) {
|
|
308
|
-
logUtils_1.logInternal(`Set Browser Bounds during setViewport step failed: ${error}`);
|
|
312
|
+
(0, logUtils_1.logInternal)(`Set Browser Bounds during setViewport step failed: ${error}`);
|
|
309
313
|
}
|
|
310
314
|
}
|
|
311
315
|
async emulateDevice(deviceDescriptor) {
|
|
@@ -320,7 +324,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
320
324
|
async waitForNavigation(options) {
|
|
321
325
|
try {
|
|
322
326
|
const result = await this.page.waitForNavigation(options);
|
|
323
|
-
return utils_1.mapIfNotNull(result, (result) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, result));
|
|
327
|
+
return (0, utils_1.mapIfNotNull)(result, (result) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this, result));
|
|
324
328
|
}
|
|
325
329
|
catch (e) {
|
|
326
330
|
if (e instanceof playwright.errors.TimeoutError) {
|
|
@@ -330,7 +334,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
330
334
|
}
|
|
331
335
|
}
|
|
332
336
|
async waitForSelector(selector, options) {
|
|
333
|
-
return utils_1.mapIfNotNull(await this.page.waitForSelector(selector, options), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this));
|
|
337
|
+
return (0, utils_1.mapIfNotNull)(await this.page.waitForSelector(selector, options), (handle) => new playwrightDom_1.PlaywrightElementHandle(handle, this));
|
|
334
338
|
}
|
|
335
339
|
acceptDialogs(dialog) {
|
|
336
340
|
return dialog.accept();
|
|
@@ -352,7 +356,7 @@ class PlaywrightPage extends events_1.default {
|
|
|
352
356
|
: ((_f = this.getPageImpl()) === null || _f === void 0 ? void 0 : _f._delegate) !== undefined
|
|
353
357
|
? '_mainFrameSession'
|
|
354
358
|
: 'pageImpl';
|
|
355
|
-
logUtils_1.logInternal(`Unable to get the CDP Session of the page (${undefinedField} is undefined).
|
|
359
|
+
(0, logUtils_1.logInternal)(`Unable to get the CDP Session of the page (${undefinedField} is undefined).
|
|
356
360
|
Creating a fallback session. Some functionality might not work as expected.`);
|
|
357
361
|
}
|
|
358
362
|
return ((_k = (_j = (_h = (_g = this.getPageImpl()) === null || _g === void 0 ? void 0 : _g._delegate) === null || _h === void 0 ? void 0 : _h._mainFrameSession) === null || _j === void 0 ? void 0 : _j._client) !== null && _k !== void 0 ? _k : this.fallbackCdpSession);
|
package/cli.js
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k;
|
|
5
|
-
Object.
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
6
10
|
}) : (function(o, m, k, k2) {
|
|
7
11
|
if (k2 === undefined) k2 = k;
|
|
8
12
|
o[k2] = m[k];
|
|
@@ -37,7 +41,7 @@ const messaging_1 = require("./core/messaging/messaging");
|
|
|
37
41
|
const updateNotifier = require('update-notifier');
|
|
38
42
|
const cliPackage = require('./package.json');
|
|
39
43
|
const UPDATE_CHECK_INTERVAL_MILLISECONDS = 24 * 60 * 60 * 1000;
|
|
40
|
-
const MIN_SUPPORTED_NODE_VERSION = versionUtil_1.extractNodeVersionTuple((_a = cliPackage === null || cliPackage === void 0 ? void 0 : cliPackage.engines) === null || _a === void 0 ? void 0 : _a.node);
|
|
44
|
+
const MIN_SUPPORTED_NODE_VERSION = (0, versionUtil_1.extractNodeVersionTuple)((_a = cliPackage === null || cliPackage === void 0 ? void 0 : cliPackage.engines) === null || _a === void 0 ? void 0 : _a.node);
|
|
41
45
|
require('v8-compile-cache');
|
|
42
46
|
require('yargonaut').style('cyan').helpStyle('magenta').errorsStyle('red');
|
|
43
47
|
yargs
|
|
@@ -65,16 +69,16 @@ yargs
|
|
|
65
69
|
.epilogue('Read full docs @ https://help.mabl.com/docs/mabl-cli')
|
|
66
70
|
.middleware([
|
|
67
71
|
() => {
|
|
68
|
-
logLineMessaging_1.registerConsoleLoggerForOutput(messaging_1.mablEventEmitter);
|
|
72
|
+
(0, logLineMessaging_1.registerConsoleLoggerForOutput)(messaging_1.mablEventEmitter);
|
|
69
73
|
},
|
|
70
74
|
() => {
|
|
71
75
|
try {
|
|
72
|
-
const nodeVersion = versionUtil_1.extractNodeVersionTuple(process.version);
|
|
73
|
-
if (versionUtil_1.compareNodeVersions(nodeVersion, MIN_SUPPORTED_NODE_VERSION) < 0) {
|
|
76
|
+
const nodeVersion = (0, versionUtil_1.extractNodeVersionTuple)(process.version);
|
|
77
|
+
if ((0, versionUtil_1.compareNodeVersions)(nodeVersion, MIN_SUPPORTED_NODE_VERSION) < 0) {
|
|
74
78
|
loggingProvider_1.logger.info(chalk_1.default.bgYellow.black(`WARNING: Unsupported Node.js detected (`) +
|
|
75
|
-
chalk_1.default.bgYellow.bold.white(versionUtil_1.nodeVersionToString(nodeVersion)) +
|
|
79
|
+
chalk_1.default.bgYellow.bold.white((0, versionUtil_1.nodeVersionToString)(nodeVersion)) +
|
|
76
80
|
chalk_1.default.bgYellow.black(`). \nmabl-cli functionality may be limited, please update to `) +
|
|
77
|
-
chalk_1.default.bgYellow.bold.white(versionUtil_1.nodeVersionToString(MIN_SUPPORTED_NODE_VERSION)) +
|
|
81
|
+
chalk_1.default.bgYellow.bold.white((0, versionUtil_1.nodeVersionToString)(MIN_SUPPORTED_NODE_VERSION)) +
|
|
78
82
|
chalk_1.default.bgYellow.black(' or later'));
|
|
79
83
|
}
|
|
80
84
|
}
|
|
@@ -82,7 +86,7 @@ yargs
|
|
|
82
86
|
}
|
|
83
87
|
},
|
|
84
88
|
(argv) => {
|
|
85
|
-
analytics_1.trackCliEvent(argv._, pureUtil_1.extractKeyCountsFromArgs(argv));
|
|
89
|
+
(0, analytics_1.trackCliEvent)(argv._, (0, pureUtil_1.extractKeyCountsFromArgs)(argv));
|
|
86
90
|
},
|
|
87
91
|
() => {
|
|
88
92
|
updateNotifier({
|
|
@@ -4,15 +4,15 @@ const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
|
|
|
4
4
|
const describe_1 = require("../../commandUtil/describe");
|
|
5
5
|
const util_1 = require("../../commandUtil/util");
|
|
6
6
|
exports.command = 'describe <id>';
|
|
7
|
-
exports.describe = util_1.getDescribeDescriptions('application');
|
|
8
|
-
exports.builder = describe_1.getDescribeBuilderOptions();
|
|
9
|
-
exports.handler = util_1.failWrapper(getApplication);
|
|
7
|
+
exports.describe = (0, util_1.getDescribeDescriptions)('application');
|
|
8
|
+
exports.builder = (0, describe_1.getDescribeBuilderOptions)();
|
|
9
|
+
exports.handler = (0, util_1.failWrapper)(getApplication);
|
|
10
10
|
async function getApplication(parsed) {
|
|
11
11
|
try {
|
|
12
12
|
const applicationId = parsed.id;
|
|
13
13
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
14
14
|
const application = await apiClient.getApplication(applicationId);
|
|
15
|
-
describe_1.outputEntity(application, parsed.output);
|
|
15
|
+
(0, describe_1.outputEntity)(application, parsed.output);
|
|
16
16
|
return application.id;
|
|
17
17
|
}
|
|
18
18
|
catch (error) {
|