@mablhq/mabl-cli 1.12.9 → 1.12.38
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 +1 -1
- package/api/mablApiClient.js +9 -9
- package/auth/AuthClient.js +1 -4
- package/browserLauncher/browserLauncher.js +3 -1
- package/browserLauncher/browserLauncherFactory.js +6 -2
- package/browserLauncher/elementHandle.js +8 -1
- package/browserLauncher/frame.js +15 -0
- package/browserLauncher/frameBase.js +4 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +2 -2
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +1 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +119 -31
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +32 -21
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpResponse.js +3 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +43 -75
- package/browserLauncher/playwrightBrowserLauncher/wrappers.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +3 -3
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +59 -5
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerFrame.js +9 -8
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpRequest.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +4 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerJsHandle.js +3 -3
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +23 -61
- package/browserLauncher/puppeteerBrowserLauncher/wrappers.js +1 -1
- package/cli.js +6 -4
- package/commands/applications/applications_cmds/list.js +1 -1
- package/commands/branches/branches_cmds/create.js +1 -1
- package/commands/branches/branches_cmds/list.js +1 -1
- package/commands/branches/branches_cmds/merge.js +1 -1
- package/commands/commandUtil/awaitCompletion.js +2 -2
- package/commands/commandUtil/codeInsights.js +6 -6
- package/commands/commandUtil/fileUtil.js +1 -1
- package/commands/commandUtil/util.js +12 -12
- package/commands/config/config_cmds/list.js +1 -1
- package/commands/constants.js +1 -1
- package/commands/credentials/credentials_cmds/list.js +1 -1
- package/commands/deploy/deploy_cmds/create.js +2 -2
- package/commands/deploy/deploy_cmds/executionResultPresenter.js +7 -7
- package/commands/deploy/deploy_cmds/list.js +1 -1
- package/commands/environments/environments_cmds/create.js +3 -3
- package/commands/environments/environments_cmds/list.js +1 -1
- package/commands/environments/environments_cmds/urls_cmds/add.js +1 -1
- package/commands/flows/flows_cmds/list.js +1 -1
- package/commands/plans/plans_cmds/list.js +1 -1
- package/commands/test-runs/test-runs_cmds/export.js +1 -1
- package/commands/tests/executionUtil.js +1 -1
- package/commands/tests/testsUtil.js +16 -20
- package/commands/tests/tests_cmds/edit.js +1 -1
- package/commands/tests/tests_cmds/export.js +1 -1
- package/commands/tests/tests_cmds/import.js +13 -13
- package/commands/tests/tests_cmds/list.js +2 -2
- package/commands/tests/tests_cmds/run-alpha.js +1 -1
- package/commands/tests/tests_cmds/run-cloud.js +7 -7
- package/commands/tests/tests_cmds/run-legacy.js +2 -2
- package/commands/tests/tests_cmds/run.js +25 -7
- package/commands/workspaces/workspace_cmds/copy.js +1 -1
- package/commands/workspaces/workspace_cmds/list.js +1 -1
- package/configGenerators/flowConfigGenerator.js +3 -3
- package/configGenerators/selIdeGenerator.js +1 -1
- package/configGenerators/testConfigGenerator.js +7 -8
- package/core/execution/ApiTestUtils.js +2 -2
- package/core/messaging/messaging.js +14 -1
- package/core/trainer/openUtils.js +47 -0
- package/core/trainer/trainingSessions.js +36 -61
- package/env/defaultEnv.js +2 -1
- package/env/dev.js +2 -1
- package/env/env.js +3 -1
- package/env/local.js +2 -1
- package/env/prod.js +2 -1
- package/execution/index.js +1 -1
- package/index.d.ts +7 -0
- package/mablApi/index.js +1 -1
- package/mablscript/MablStep.js +11 -7
- package/mablscript/actions/ConditionAction.js +2 -4
- package/mablscript/actions/FindAction.js +4 -4
- package/mablscript/importer.js +16 -14
- package/mablscript/steps/AccessibilityCheck.js +88 -0
- package/mablscript/steps/AssertStep.js +6 -5
- package/mablscript/steps/CreateVariableStep.js +2 -3
- package/mablscript/steps/DownloadStep.js +1 -2
- package/mablscript/steps/EnterTextStep.js +2 -1
- package/mablscript/steps/IfConditionStep.js +3 -3
- package/mablscript/steps/SendHttpRequestStep.js +2 -2
- package/mablscript/steps/SendKeyStep.js +2 -2
- package/mablscript/steps/SetFilesStep.js +1 -1
- package/mablscript/steps/SwitchContextStep.js +2 -1
- package/mablscript/types/AccessibilityCheckStepDescriptor.js +2 -0
- package/mablscript/types/AccessibilityCheckTypes.js +9 -0
- package/mablscript/types/VariableDataType.js +1 -8
- package/mablscript/types/VariableNamespace.js +1 -1
- package/mablscriptFind/index.js +1 -1
- package/package.json +6 -4
- package/popupDismissal/index.js +13 -12
- package/providers/authenticationProvider.js +2 -3
- package/providers/cliConfigProvider.js +1 -1
- package/providers/exportRequestProvider.js +1 -1
- package/providers/logging/loggingProvider.js +2 -2
- package/providers/scmContextProvider.js +1 -1
- package/reporters/mochAwesome/mochAwesomeReporter.js +10 -6
- package/reporters/reporter.js +1 -1
- package/resources/mablFind.js +1 -1
- package/resources/popupDismissal.js +1 -1
- package/util/RichPromise.js +2 -2
- package/util/actionabilityUtil.js +44 -14
- package/util/downloadUtil.js +1 -1
- package/util/logUtils.js +20 -1
- package/util/markdownUtil.js +3 -3
- package/util/pureUtil.js +6 -6
- package/util/resourceUtil.js +14 -1
- package/core/trainer/trainerBrowserUtil.js +0 -33
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mablhq/mabl-cli",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.38",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "The official mabl command line interface tool",
|
|
6
6
|
"main": "index.js",
|
|
@@ -34,9 +34,10 @@
|
|
|
34
34
|
"anyproxy": "^4.1.3",
|
|
35
35
|
"async-mutex": "^0.3.1",
|
|
36
36
|
"async-retry": "1.3.3",
|
|
37
|
+
"axe-core": "4.3.3",
|
|
37
38
|
"axios": "^0.21.1",
|
|
38
|
-
"axios-cookiejar-support": "
|
|
39
|
-
"chalk": "
|
|
39
|
+
"axios-cookiejar-support": "1.0.1",
|
|
40
|
+
"chalk": "2.4.2",
|
|
40
41
|
"change-case": "^4.1.1",
|
|
41
42
|
"chrome-launcher": "^0.13.1",
|
|
42
43
|
"cli-table3": "^0.5.1",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"env-paths": "^2.2.0",
|
|
47
48
|
"esprima": "^4.0.1",
|
|
48
49
|
"estraverse": "^4.3.0",
|
|
50
|
+
"fastest-levenshtein": "^1.0.10",
|
|
49
51
|
"fs-extra": "^8.1.0",
|
|
50
52
|
"git-repo-info": "^2.1.1",
|
|
51
53
|
"glob": "^7.1.4",
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
"markdown-table": "^2.0.0",
|
|
60
62
|
"mime-types": "^2.1.26",
|
|
61
63
|
"mochawesome-report-generator": "^5.2.0",
|
|
62
|
-
"moment": "
|
|
64
|
+
"moment": "2.26.0",
|
|
63
65
|
"moment-duration-format": "^2.3.2",
|
|
64
66
|
"newman": "5.2.3",
|
|
65
67
|
"open": "^6.4.0",
|
package/popupDismissal/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.elementsInFrontCount = exports.detectAndDismissPopupCandidates = exports.elementsByHigherZIndex = void 0;
|
|
3
|
+
exports.elementsInFrontCount = exports.detectAndDismissPopupCandidates = exports.getAllElementsAbove = exports.elementsByHigherZIndex = void 0;
|
|
4
4
|
const DISMISSAL_WAIT_TIME_MS = 750;
|
|
5
5
|
const ZINDEX_AUTO = 'auto';
|
|
6
6
|
const MINIMUM_POPUP_DISPLAY_COVERAGE_PX = 0.95;
|
|
@@ -36,8 +36,8 @@ function elementsByHigherZIndex(aboveIndex) {
|
|
|
36
36
|
}, new Map());
|
|
37
37
|
}
|
|
38
38
|
exports.elementsByHigherZIndex = elementsByHigherZIndex;
|
|
39
|
-
function getEffectiveZIndex(element
|
|
40
|
-
const isRootElement = (element) => element
|
|
39
|
+
function getEffectiveZIndex(element) {
|
|
40
|
+
const isRootElement = (element) => element === undefined || element.tagName.toLowerCase() === 'html';
|
|
41
41
|
let current = element;
|
|
42
42
|
while (!isRootElement(current)) {
|
|
43
43
|
const zIndex = window.getComputedStyle(element).zIndex;
|
|
@@ -46,12 +46,12 @@ function getEffectiveZIndex(element, replaceAutoWithValue) {
|
|
|
46
46
|
}
|
|
47
47
|
current = (current === null || current === void 0 ? void 0 : current.parentElement) ? current.parentElement : undefined;
|
|
48
48
|
}
|
|
49
|
-
return
|
|
49
|
+
return 0;
|
|
50
50
|
}
|
|
51
51
|
function getDescendantElements(childElement) {
|
|
52
52
|
let children = [childElement];
|
|
53
53
|
const childNodes = Array.from(childElement.children);
|
|
54
|
-
childNodes.forEach(el => {
|
|
54
|
+
childNodes.forEach((el) => {
|
|
55
55
|
children = children.concat(getDescendantElements(el));
|
|
56
56
|
});
|
|
57
57
|
return children;
|
|
@@ -65,8 +65,8 @@ function matchWithWordBoundary(attribute, matchVal) {
|
|
|
65
65
|
}
|
|
66
66
|
function checkElementAttributes(element) {
|
|
67
67
|
let matches = 0;
|
|
68
|
-
ATTRIBUTES_TO_CHECK.forEach(attr => {
|
|
69
|
-
CLOSE_VALUES.forEach(closeVal => {
|
|
68
|
+
ATTRIBUTES_TO_CHECK.forEach((attr) => {
|
|
69
|
+
CLOSE_VALUES.forEach((closeVal) => {
|
|
70
70
|
if (element.getAttribute(attr.attributeName) &&
|
|
71
71
|
attr.matchFunction(element.getAttribute(attr.attributeName), closeVal)) {
|
|
72
72
|
matches += 1;
|
|
@@ -87,10 +87,10 @@ function checkElementDomCoverage(element) {
|
|
|
87
87
|
}
|
|
88
88
|
function developCloseCandidates(candidates) {
|
|
89
89
|
const candidatesByZIndex = [];
|
|
90
|
-
candidates.forEach(candidate => {
|
|
90
|
+
candidates.forEach((candidate) => {
|
|
91
91
|
const domCovering = [];
|
|
92
92
|
const actionableElements = [];
|
|
93
|
-
candidate.elements.forEach(element => {
|
|
93
|
+
candidate.elements.forEach((element) => {
|
|
94
94
|
var _a, _b;
|
|
95
95
|
if ((_a = element) === null || _a === void 0 ? void 0 : _a.offsetParent) {
|
|
96
96
|
if (['BUTTON', 'A', 'DIV'].includes((_b = element.tagName) === null || _b === void 0 ? void 0 : _b.toUpperCase()) &&
|
|
@@ -139,11 +139,11 @@ function elementsInFront(element, pointX, pointY) {
|
|
|
139
139
|
const x = pointX !== undefined ? pointX : getBoundingClientRectWithXY(element).x;
|
|
140
140
|
const y = pointY !== undefined ? pointY : getBoundingClientRectWithXY(element).y;
|
|
141
141
|
const elementsAtPoint = document.elementsFromPoint(x, y);
|
|
142
|
-
const targetIndex = elementsAtPoint.findIndex(iterElement => iterElement === element);
|
|
142
|
+
const targetIndex = elementsAtPoint.findIndex((iterElement) => iterElement === element);
|
|
143
143
|
return targetIndex ? elementsAtPoint.slice(0, targetIndex) : [];
|
|
144
144
|
}
|
|
145
145
|
function sleep(time) {
|
|
146
|
-
return new Promise(resolve => setTimeout(resolve, time));
|
|
146
|
+
return new Promise((resolve) => setTimeout(resolve, time));
|
|
147
147
|
}
|
|
148
148
|
function getBoundingClientRectWithXY(element) {
|
|
149
149
|
const rect = element.getBoundingClientRect();
|
|
@@ -159,7 +159,7 @@ function getBoundingClientRectWithXY(element) {
|
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
161
|
function getAllElementsAbove(elements) {
|
|
162
|
-
const zIndexAboveTarget = getEffectiveZIndex(elements[elements.length - 1]
|
|
162
|
+
const zIndexAboveTarget = getEffectiveZIndex(elements[elements.length - 1]);
|
|
163
163
|
const higherElementsByZIndex = elementsByHigherZIndex(zIndexAboveTarget);
|
|
164
164
|
const allElementsByZIndex = Array.from(higherElementsByZIndex).map(([item, higherElements]) => {
|
|
165
165
|
const allElements = higherElements
|
|
@@ -170,6 +170,7 @@ function getAllElementsAbove(elements) {
|
|
|
170
170
|
allElementsByZIndex.sort((a, b) => b.zIndex - a.zIndex);
|
|
171
171
|
return allElementsByZIndex;
|
|
172
172
|
}
|
|
173
|
+
exports.getAllElementsAbove = getAllElementsAbove;
|
|
173
174
|
async function detectAndDismissPopupCandidates(element) {
|
|
174
175
|
const elementBoundingBox = getBoundingClientRectWithXY(element);
|
|
175
176
|
try {
|
|
@@ -30,8 +30,7 @@ class AuthenticationProvider {
|
|
|
30
30
|
this.oktaClient = new OktaClient_1.OktaClient(client);
|
|
31
31
|
}
|
|
32
32
|
async getAuthConfigWithAutoRenew() {
|
|
33
|
-
let authConfig = cliConfigProvider_1.CliConfigProvider.getCliConfig()
|
|
34
|
-
.authentication;
|
|
33
|
+
let authConfig = cliConfigProvider_1.CliConfigProvider.getCliConfig().authentication;
|
|
35
34
|
if (authConfig.accessToken) {
|
|
36
35
|
if (this.verbose) {
|
|
37
36
|
loggingProvider_1.logger.info('Found existing access token');
|
|
@@ -134,7 +133,7 @@ class AuthenticationProvider {
|
|
|
134
133
|
async authenticate() {
|
|
135
134
|
var _a;
|
|
136
135
|
try {
|
|
137
|
-
const { codeChallenge, codeVerifier
|
|
136
|
+
const { codeChallenge, codeVerifier } = this.oktaClient.generateCodeChallenge();
|
|
138
137
|
const redirectUri = `${env_1.BASE_APP_URL}/app-code`;
|
|
139
138
|
const authUrl = this.oktaClient.buildAuthorizationUrl(codeChallenge, redirectUri);
|
|
140
139
|
loggingProvider_1.logger.info(`Your browser has been opened to the following URL for obtaining an authorization code:
|
|
@@ -103,7 +103,7 @@ class CliConfigProvider {
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
static clearAuthConfig() {
|
|
106
|
-
AUTH_KEY_NAMES.forEach(keyName => clearValue(keyName));
|
|
106
|
+
AUTH_KEY_NAMES.forEach((keyName) => clearValue(keyName));
|
|
107
107
|
return this.getCliConfig();
|
|
108
108
|
}
|
|
109
109
|
static setCliConfig(config) {
|
|
@@ -69,7 +69,7 @@ class ExportRequestProvider {
|
|
|
69
69
|
return new Promise((resolve, reject) => {
|
|
70
70
|
setTimeout(() => this.awaitCompletion()
|
|
71
71
|
.then(() => resolve())
|
|
72
|
-
.catch(error => reject(error)), this.pollingIntervalMilliseconds);
|
|
72
|
+
.catch((error) => reject(error)), this.pollingIntervalMilliseconds);
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -60,11 +60,11 @@ class CliTransport extends winston_transport_1.default {
|
|
|
60
60
|
}
|
|
61
61
|
exports.logger = winston.createLogger({
|
|
62
62
|
level: defaultEnv_1.CONSOLE_LOGGING_LEVEL,
|
|
63
|
-
format: winston.format.printf(info => `${stripAnsi(info.message)}`),
|
|
63
|
+
format: winston.format.printf((info) => `${stripAnsi(info.message)}`),
|
|
64
64
|
defaultMeta: { service: 'mabl-cli' },
|
|
65
65
|
transports: [
|
|
66
66
|
new CliTransport({
|
|
67
|
-
format: winston.format.printf(info => { var _a; return `${(_a = info.message) !== null && _a !== void 0 ? _a : info[MESSAGE]}`; }),
|
|
67
|
+
format: winston.format.printf((info) => { var _a; return `${(_a = info.message) !== null && _a !== void 0 ? _a : info[MESSAGE]}`; }),
|
|
68
68
|
}),
|
|
69
69
|
],
|
|
70
70
|
});
|
|
@@ -85,12 +85,16 @@ function generateMochAwesomeReportFromTestResults(testResults, reportOptions) {
|
|
|
85
85
|
exports.generateMochAwesomeReportFromTestResults = generateMochAwesomeReportFromTestResults;
|
|
86
86
|
function generatePlainSuiteFromTestResults(testResults) {
|
|
87
87
|
const parentId = uuid_1.v4();
|
|
88
|
-
const plainTests = testResults.testResults.map(testResult => generatePlainTestForTestRun(parentId, testResult));
|
|
89
|
-
const passes = plainTests
|
|
90
|
-
|
|
88
|
+
const plainTests = testResults.testResults.map((testResult) => generatePlainTestForTestRun(parentId, testResult));
|
|
89
|
+
const passes = plainTests
|
|
90
|
+
.filter((test) => test.pass)
|
|
91
|
+
.map((test) => test.uuid);
|
|
92
|
+
const failures = plainTests
|
|
93
|
+
.filter((test) => test.fail)
|
|
94
|
+
.map((test) => test.uuid);
|
|
91
95
|
const skipped = plainTests
|
|
92
|
-
.filter(test => test.skipped)
|
|
93
|
-
.map(test => test.uuid);
|
|
96
|
+
.filter((test) => test.skipped)
|
|
97
|
+
.map((test) => test.uuid);
|
|
94
98
|
const command = constructTestRunCommand();
|
|
95
99
|
return {
|
|
96
100
|
uuid: parentId,
|
|
@@ -160,7 +164,7 @@ function getTestState(testResultStatus) {
|
|
|
160
164
|
function constructTestRunCommand() {
|
|
161
165
|
try {
|
|
162
166
|
const processArgs = process.argv;
|
|
163
|
-
const testArgIndex = processArgs.findIndex(arg => arg === 'tests');
|
|
167
|
+
const testArgIndex = processArgs.findIndex((arg) => arg === 'tests');
|
|
164
168
|
if (testArgIndex) {
|
|
165
169
|
processArgs.splice(0, testArgIndex + 1);
|
|
166
170
|
}
|
package/reporters/reporter.js
CHANGED
|
@@ -29,7 +29,7 @@ exports.handleReportingForTestsRun = handleReportingForTestsRun;
|
|
|
29
29
|
function parseOutReportOptions(suppliedOptions) {
|
|
30
30
|
const reporterOptions = {};
|
|
31
31
|
const pairs = suppliedOptions.split(',');
|
|
32
|
-
pairs.forEach(pair => {
|
|
32
|
+
pairs.forEach((pair) => {
|
|
33
33
|
const [key, value] = pair.split('=', 3);
|
|
34
34
|
if (value.toLowerCase() === 'false' || value.toLowerCase() === 'true') {
|
|
35
35
|
reporterOptions[key] = value.toLowerCase() === 'true';
|