@mablhq/mabl-cli 1.58.20 → 1.58.25
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 +21 -15
- package/api/mablApiClient.js +40 -48
- package/api/mablApiClientFactory.js +1 -1
- package/auth/OktaClient.js +1 -2
- package/browserEngines/chromiumBrowserEngine.js +1 -2
- package/browserEngines/firefoxBrowserEngine.js +2 -2
- package/browserEngines/webkitBrowerEngine.js +2 -2
- package/browserLauncher/browserLauncherFactory.js +2 -3
- package/browserLauncher/elementHandle.js +1 -2
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumElementHandleDelegate.js +12 -20
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumFrameDelegate.js +1 -1
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumPageDelegate.js +7 -10
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxFrameDelegate.js +3 -4
- package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractElementHandleDelegate.js +4 -5
- package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractPageDelegate.js +4 -7
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +1 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +6 -5
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +31 -37
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +8 -9
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +4 -8
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +4 -6
- package/browserLauncher/playwrightBrowserLauncher/webkit/webkitElementHandleDelegate.js +1 -2
- package/browserLauncher/playwrightBrowserLauncher/webkit/webkitFrameDelegate.js +1 -1
- package/browserTestMonitoring/metricsRecorder.js +6 -6
- package/commands/commandUtil/branches.js +2 -3
- package/commands/commandUtil/codeInsights.js +13 -16
- package/commands/commandUtil/fileUtil.js +1 -1
- package/commands/commandUtil/util.js +3 -4
- package/commands/commandUtil/versionUtil.js +4 -5
- package/commands/config/config_cmds/list.js +2 -2
- package/commands/constants.js +3 -1
- package/commands/datatables/datatables_cmds/create.js +2 -3
- package/commands/datatables/datatables_cmds/export.js +3 -5
- package/commands/datatables/datatables_cmds/list.js +1 -2
- package/commands/datatables/datatables_cmds/scenarios.js +1 -2
- package/commands/datatables/datatables_cmds/update.js +11 -11
- package/commands/datatables/utils.js +9 -9
- package/commands/deploy/deploy_cmds/awaitDeploymentCompletion.js +6 -8
- package/commands/deploy/deploy_cmds/create.js +11 -13
- package/commands/deploy/deploy_cmds/executionResultPresenter.js +8 -11
- package/commands/deploy/deploy_cmds/list.js +3 -4
- package/commands/deploy/deploy_cmds/watch.js +1 -2
- package/commands/environments/environments_cmds/create.js +1 -2
- package/commands/environments/environments_cmds/delete.js +1 -2
- package/commands/environments/environments_cmds/update.js +1 -2
- package/commands/environments/environments_cmds/urls_cmds/list.js +1 -2
- package/commands/flows/flows_cmds/export.js +1 -2
- package/commands/plans/plans_cmds/describe.js +1 -2
- package/commands/tests/mobileEmulationUtil.js +5 -7
- package/commands/tests/testsUtil.js +40 -42
- package/commands/tests/tests_cmds/export.js +1 -2
- package/commands/tests/tests_cmds/import.js +4 -5
- package/commands/tests/tests_cmds/run-cloud.js +12 -13
- package/commands/tests/tests_cmds/run.js +30 -11
- package/commands/users/users_cmds/list.js +2 -2
- package/commands/workspaces/workspace_cmds/copy.js +1 -2
- package/core/execution/ApiTestUtils.js +82 -94
- package/core/execution/LocalizationOptionsLists.js +1253 -0
- package/core/messaging/logLineMessaging.js +2 -3
- package/core/messaging/messaging.js +6 -7
- package/core/trainer/trainingSessions.js +15 -15
- package/coreWebVitals/index.js +14 -18
- package/domUtil/index.js +1 -1
- package/execution/index.js +1 -1
- package/functions/apiTest/utils.js +4 -5
- package/http/MablHttpAgent.js +4 -6
- package/http/RequestSecurityError.js +1 -1
- package/http/axiosProxyConfig.js +3 -5
- package/http/httpUtil.js +2 -3
- package/http/requestInterceptor.js +11 -15
- package/mablApi/index.js +1 -1
- package/mablscript/MablAction.js +2 -3
- package/mablscript/MablStep.js +2 -4
- package/mablscript/MablSymbol.js +1 -1
- package/mablscript/actions/ConditionAction.js +2 -4
- package/mablscript/actions/FindAction.js +2 -4
- package/mablscript/diffing/diffingUtil.js +8 -7
- package/mablscript/importer.js +1 -2
- package/mablscript/steps/AccessibilityCheck.js +7 -9
- package/mablscript/steps/AssertStep.js +11 -16
- package/mablscript/steps/ClickAndHoldStep.js +1 -2
- package/mablscript/steps/CookieUtils.js +40 -7
- package/mablscript/steps/CreateVariableStep.js +1 -2
- package/mablscript/steps/DownloadStep.js +1 -2
- package/mablscript/steps/EnterTextStep.js +1 -2
- package/mablscript/steps/EvaluateFlowStep.js +1 -1
- package/mablscript/steps/IfConditionStep.js +4 -6
- package/mablscript/steps/ReleaseStep.js +1 -2
- package/mablscript/steps/SendHttpRequestStep.js +2 -4
- package/mablscript/steps/SendKeyStep.js +1 -1
- package/mablscript/steps/SetCookieStep.js +35 -20
- package/mablscript/steps/SetViewportStep.js +1 -1
- package/mablscript/steps/SwitchContextStep.js +3 -6
- package/mablscript/steps/SyntheticStep.js +1 -2
- package/mablscriptFind/index.js +1 -1
- package/middleware.js +1 -2
- package/package.json +2 -2
- package/popupDismissal/index.js +4 -5
- package/providers/authenticationProvider.js +5 -6
- package/providers/cliConfigProvider.js +10 -12
- package/providers/exportRequestProvider.js +3 -5
- package/providers/logging/loggingProvider.js +1 -1
- package/reporters/mochAwesome/mochAwesomeReporter.js +12 -14
- package/resources/mablFind.js +1 -1
- package/util/actionabilityUtil.js +1 -1
- package/util/analytics.js +6 -9
- package/util/browserTestUtils.js +1 -2
- package/util/markdownUtil.js +9 -11
|
@@ -67,7 +67,7 @@ async function checkActionabilityAt(elementHandle, executionContext, recheckOnFa
|
|
|
67
67
|
throw new Error(NO_CLICKABLE_POINT_ERROR);
|
|
68
68
|
}
|
|
69
69
|
const frame = await elementHandle.frame();
|
|
70
|
-
if (frame
|
|
70
|
+
if (frame?.parentFrame()) {
|
|
71
71
|
const element = await frame.getFrameOwnerElement();
|
|
72
72
|
if (element !== undefined) {
|
|
73
73
|
const box = await element.boundingBox();
|
package/util/analytics.js
CHANGED
|
@@ -36,21 +36,20 @@ const analytics = new Analytics('ghbAXZbk8fqWROgMscPdkQMoqEjwsKRa', {
|
|
|
36
36
|
flushInterval: 1,
|
|
37
37
|
});
|
|
38
38
|
async function getTrackingInfo() {
|
|
39
|
-
var _a, _b, _c;
|
|
40
39
|
const config = await cliConfigProvider_1.CliConfigProvider.getCliConfig();
|
|
41
40
|
if (config.authentication.authType === undefined) {
|
|
42
41
|
return {};
|
|
43
42
|
}
|
|
44
43
|
let userId;
|
|
45
44
|
if (config.authentication.authType === types_1.AuthType.ApiKey) {
|
|
46
|
-
userId = `cliKey-${
|
|
45
|
+
userId = `cliKey-${config.workspace?.id ?? 'unknown'}`;
|
|
47
46
|
}
|
|
48
47
|
else {
|
|
49
48
|
userId = config.userId;
|
|
50
49
|
}
|
|
51
50
|
return {
|
|
52
51
|
userId,
|
|
53
|
-
workspaceId:
|
|
52
|
+
workspaceId: config.workspace?.id,
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
55
|
async function trackCliEvent(commands, argumentCountMap) {
|
|
@@ -95,8 +94,7 @@ async function trackMablTestsRunnerEvent(eventName, resultsMap) {
|
|
|
95
94
|
}
|
|
96
95
|
exports.trackMablTestsRunnerEvent = trackMablTestsRunnerEvent;
|
|
97
96
|
function trackEvent(event, userId, properties) {
|
|
98
|
-
|
|
99
|
-
const cpuInfo = (_a = os.cpus()) !== null && _a !== void 0 ? _a : [];
|
|
97
|
+
const cpuInfo = os.cpus() ?? [];
|
|
100
98
|
analytics.track({
|
|
101
99
|
userId,
|
|
102
100
|
event,
|
|
@@ -114,8 +112,8 @@ function trackEvent(event, userId, properties) {
|
|
|
114
112
|
userAgent: getUserAgent(),
|
|
115
113
|
userAgentData: {
|
|
116
114
|
cpuCount: cpuInfo.length,
|
|
117
|
-
cpuType:
|
|
118
|
-
cpuSpeed:
|
|
115
|
+
cpuType: cpuInfo?.[0]?.model,
|
|
116
|
+
cpuSpeed: cpuInfo?.[0]?.speed,
|
|
119
117
|
osArch: os.arch(),
|
|
120
118
|
memFree: os.freemem(),
|
|
121
119
|
memTotal: os.totalmem(),
|
|
@@ -125,7 +123,6 @@ function trackEvent(event, userId, properties) {
|
|
|
125
123
|
});
|
|
126
124
|
}
|
|
127
125
|
function getUserAgent() {
|
|
128
|
-
|
|
129
|
-
const nodeName = (_b = (_a = process === null || process === void 0 ? void 0 : process.release) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'node';
|
|
126
|
+
const nodeName = process?.release?.name ?? 'node';
|
|
130
127
|
return `${nodeName}_${process.arch}@${process.version}`;
|
|
131
128
|
}
|
package/util/browserTestUtils.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a, _b;
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.IS_TEST_BROWSER_WEBKIT = exports.IS_TEST_BROWSER_FIREFOX = exports.IS_TEST_BROWSER_CHROMIUM = exports.TEST_BROWSER_ENGINE = exports.TEST_BROWSER_TYPE = void 0;
|
|
5
4
|
const browserEngines_1 = require("../browserEngines/browserEngines");
|
|
6
5
|
const browserTypes_1 = require("../commands/browserTypes");
|
|
7
6
|
const VALID_TEST_BROWSER_TYPES = ['chrome', 'firefox', 'webkit'];
|
|
8
|
-
const browserTypeEnvironmentVariable =
|
|
7
|
+
const browserTypeEnvironmentVariable = process.env.TEST_BROWSER_TYPE?.toLowerCase() ?? 'chrome';
|
|
9
8
|
if (browserTypeEnvironmentVariable &&
|
|
10
9
|
!VALID_TEST_BROWSER_TYPES.includes(browserTypeEnvironmentVariable)) {
|
|
11
10
|
throw Error(`Test browser type cannot be ${browserTypeEnvironmentVariable}, it must be one of ${VALID_TEST_BROWSER_TYPES}`);
|
package/util/markdownUtil.js
CHANGED
|
@@ -14,21 +14,19 @@ var HumanizedMablStatuses;
|
|
|
14
14
|
HumanizedMablStatuses["Stopped"] = "Stopped";
|
|
15
15
|
})(HumanizedMablStatuses || (HumanizedMablStatuses = {}));
|
|
16
16
|
function formatResultsAsGithubMarkdown(results) {
|
|
17
|
-
var _a;
|
|
18
17
|
const tableRows = [];
|
|
19
18
|
tableRows.push(['Plan', 'Test', 'Browser', 'Status', 'Run Time']);
|
|
20
|
-
const finalExecutions =
|
|
19
|
+
const finalExecutions = results?.executions ?? [];
|
|
21
20
|
finalExecutions.forEach((summary) => {
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const humanizedPlanRunStatus = humanizeMablStatus((_d = summary === null || summary === void 0 ? void 0 : summary.plan_execution) === null || _d === void 0 ? void 0 : _d.status);
|
|
21
|
+
const retryPrefix = summary?.plan_execution?.is_retry ? '[Retry] ' : '';
|
|
22
|
+
const planName = retryPrefix + (summary.plan?.name ?? '<plan name unavailable>');
|
|
23
|
+
const humanizedPlanRunStatus = humanizeMablStatus(summary?.plan_execution?.status);
|
|
26
24
|
const planRunStatus = humanizedMablStatusToGithubIcon(humanizedPlanRunStatus) +
|
|
27
25
|
' ' +
|
|
28
|
-
maybeCapitalize(humanizedPlanRunStatus
|
|
29
|
-
const planHref =
|
|
26
|
+
maybeCapitalize(humanizedPlanRunStatus?.toString());
|
|
27
|
+
const planHref = summary.plan?.app_href;
|
|
30
28
|
const journeyMap = new Map();
|
|
31
|
-
|
|
29
|
+
summary.journeys?.forEach((journeySummary) => journeyMap.set(journeySummary.id, journeySummary));
|
|
32
30
|
tableRows.push([
|
|
33
31
|
`[${planName}](${planHref})`,
|
|
34
32
|
'---',
|
|
@@ -36,11 +34,11 @@ function formatResultsAsGithubMarkdown(results) {
|
|
|
36
34
|
planRunStatus,
|
|
37
35
|
summaryToElapsedTime(summary),
|
|
38
36
|
]);
|
|
39
|
-
|
|
37
|
+
summary.journey_executions?.forEach((journeyRun) => {
|
|
40
38
|
const humanizedJourneyRunStatus = humanizeMablStatus(journeyRun.status);
|
|
41
39
|
const journeyStatus = humanizedMablStatusToGithubIcon(humanizedJourneyRunStatus) +
|
|
42
40
|
' ' +
|
|
43
|
-
maybeCapitalize(humanizedJourneyRunStatus
|
|
41
|
+
maybeCapitalize(humanizedJourneyRunStatus?.toString());
|
|
44
42
|
const journeyBrowser = maybeCapitalize(journeyRun.browser_type);
|
|
45
43
|
const journeySummary = journeyMap.get(journeyRun.journey_id);
|
|
46
44
|
let journeyLabel = '<test name unavailable>';
|