@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
|
@@ -60,9 +60,9 @@ exports.builder = (yargs) => {
|
|
|
60
60
|
nargs: 1,
|
|
61
61
|
type: 'string',
|
|
62
62
|
})
|
|
63
|
-
.check((argv) => testsUtil_1.validateRunEditCommand(argv[constants_1.CommandArgId], argv[constants_1.CommandArgTestRunId]));
|
|
63
|
+
.check((argv) => (0, testsUtil_1.validateRunEditCommand)(argv[constants_1.CommandArgId], argv[constants_1.CommandArgTestRunId]));
|
|
64
64
|
};
|
|
65
|
-
exports.handler = util_1.failWrapper(runLegacy);
|
|
65
|
+
exports.handler = (0, util_1.failWrapper)(runLegacy);
|
|
66
66
|
async function runLegacy(parsed) {
|
|
67
67
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
68
68
|
loggingProvider_1.logger.info(chalk_1.default.bgYellow.black("DEPRECATION NOTICE: 'run-legacy' will be removed in a future release. Please migrate to 'run'"));
|
|
@@ -70,7 +70,7 @@ async function runLegacy(parsed) {
|
|
|
70
70
|
const testRunId = parsed['run-id'];
|
|
71
71
|
let testRunIdConfig = { testId: '', filterHttpRequests: false };
|
|
72
72
|
if (testRunId) {
|
|
73
|
-
testRunIdConfig = await testsUtil_1.pullDownTestRunConfig(testRunId, apiClient);
|
|
73
|
+
testRunIdConfig = await (0, testsUtil_1.pullDownTestRunConfig)(testRunId, apiClient);
|
|
74
74
|
}
|
|
75
75
|
const testId = (_a = parsed.id) !== null && _a !== void 0 ? _a : testRunIdConfig.testId;
|
|
76
76
|
const url = (_b = parsed.url) !== null && _b !== void 0 ? _b : testRunIdConfig.url;
|
|
@@ -78,14 +78,14 @@ async function runLegacy(parsed) {
|
|
|
78
78
|
const branchName = (_e = (_d = parsed['mabl-branch']) !== null && _d !== void 0 ? _d : testRunIdConfig.branchName) !== null && _e !== void 0 ? _e : constants_1.DefaultBranchName;
|
|
79
79
|
const environmentId = (_f = parsed[constants_1.CommandArgEnvironmentId]) !== null && _f !== void 0 ? _f : testRunIdConfig.environmentId;
|
|
80
80
|
const test = await apiClient.getJourney(testId, branchName);
|
|
81
|
-
branches_1.printBranchRunningInfo(branchName);
|
|
82
|
-
branches_1.crossCheckBranchWithTest(branchName, test);
|
|
81
|
+
(0, branches_1.printBranchRunningInfo)(branchName);
|
|
82
|
+
(0, branches_1.crossCheckBranchWithTest)(branchName, test);
|
|
83
83
|
let environment;
|
|
84
84
|
if (environmentId) {
|
|
85
85
|
environment = await apiClient.getEnvironment(environmentId, true);
|
|
86
86
|
}
|
|
87
|
-
const flowArray = await util_1.getJourneyFlowArray(test, apiClient, branchName);
|
|
88
|
-
const finalUrl = testsUtil_1.getFinalUrl(test, url);
|
|
87
|
+
const flowArray = await (0, util_1.getJourneyFlowArray)(test, apiClient, branchName);
|
|
88
|
+
const finalUrl = (0, testsUtil_1.getFinalUrl)(test, url);
|
|
89
89
|
if (flowArray
|
|
90
90
|
.map((flow) => flow.flow_type === mablApi_1.Flow.FlowTypeEnum.Mablscript)
|
|
91
91
|
.includes(false)) {
|
|
@@ -104,6 +104,6 @@ async function runLegacy(parsed) {
|
|
|
104
104
|
if (test.description) {
|
|
105
105
|
loggingProvider_1.logger.info(chalk_1.default.cyan(`Test description: `, chalk_1.default.magenta(test.description)));
|
|
106
106
|
}
|
|
107
|
-
await executionUtil_1.runTheTestInNewWindow(test, flowArray, branchName, finalUrl, credentialsId, environment, parsed.width, parsed.height);
|
|
107
|
+
await (0, executionUtil_1.runTheTestInNewWindow)(test, flowArray, branchName, finalUrl, credentialsId, environment, parsed.width, parsed.height);
|
|
108
108
|
return 'done';
|
|
109
109
|
}
|
|
@@ -149,6 +149,10 @@ exports.builder = (yargs) => {
|
|
|
149
149
|
.option(constants_1.CommandArgHttpHeaders, {
|
|
150
150
|
describe: 'Space delimited HTTP headers added to browser requests (e.g. "x-header:foo")',
|
|
151
151
|
type: 'array',
|
|
152
|
+
})
|
|
153
|
+
.option(constants_1.CommandArgUserAgent, {
|
|
154
|
+
describe: 'Emulates a custom user-agent (e.g. "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4651.0 Safari/537.36")',
|
|
155
|
+
type: 'string',
|
|
152
156
|
})
|
|
153
157
|
.option(constants_1.CommandArgTestInteractionSpeed, {
|
|
154
158
|
describe: 'Set the speed that mabl interacts with webpages. Overrides test run settings if specified.',
|
|
@@ -156,15 +160,15 @@ exports.builder = (yargs) => {
|
|
|
156
160
|
choices: Object.keys(mablApi_1.JourneyParameters.PageLoadWaitEnum).map((pageLoadWait) => pageLoadWait.toLowerCase()),
|
|
157
161
|
})
|
|
158
162
|
.check((argv) => {
|
|
159
|
-
testsUtil_1.validateRunCommandWithLabels(argv[constants_1.CommandArgId], argv[constants_1.CommandArgLabelsInclude], argv[constants_1.CommandArgLabelsExclude], argv[constants_1.CommandArgTestRunId], argv[constants_1.CommandArgFromPlanId], true, argv[constants_1.CommandArgTestFile]);
|
|
163
|
+
(0, testsUtil_1.validateRunCommandWithLabels)(argv[constants_1.CommandArgId], argv[constants_1.CommandArgLabelsInclude], argv[constants_1.CommandArgLabelsExclude], argv[constants_1.CommandArgTestRunId], argv[constants_1.CommandArgFromPlanId], true, argv[constants_1.CommandArgTestFile]);
|
|
160
164
|
const httpHeaders = argv[constants_1.CommandArgHttpHeaders];
|
|
161
|
-
util_1.validateArrayInputs(httpHeaders, 'HTTP headers must be SPACE delimited, e.g. "--http-headers "foo:bar" "baz:qux"');
|
|
162
|
-
argv[constants_1.CommandArgHttpHeaders] = util_1.validateValuePairInputs('HTTP header', httpHeaders);
|
|
165
|
+
(0, util_1.validateArrayInputs)(httpHeaders, 'HTTP headers must be SPACE delimited, e.g. "--http-headers "foo:bar" "baz:qux"');
|
|
166
|
+
argv[constants_1.CommandArgHttpHeaders] = (0, util_1.validateValuePairInputs)('HTTP header', httpHeaders);
|
|
163
167
|
return true;
|
|
164
168
|
});
|
|
165
169
|
};
|
|
166
170
|
const exitCodeOnError = 1;
|
|
167
|
-
exports.handler = util_1.failWrapper(run, exitCodeOnError);
|
|
171
|
+
exports.handler = (0, util_1.failWrapper)(run, exitCodeOnError);
|
|
168
172
|
async function run(parsed) {
|
|
169
173
|
var _a, _b, _c;
|
|
170
174
|
const commandStartTime = Date.now();
|
|
@@ -200,6 +204,7 @@ async function run(parsed) {
|
|
|
200
204
|
testFile: parsed[constants_1.CommandArgTestFile],
|
|
201
205
|
runId: parsed['run-id'],
|
|
202
206
|
url: parsed.url,
|
|
207
|
+
userAgent: parsed[constants_1.CommandArgUserAgent],
|
|
203
208
|
width: parsed.width,
|
|
204
209
|
workspaceId,
|
|
205
210
|
};
|
|
@@ -212,7 +217,7 @@ async function run(parsed) {
|
|
|
212
217
|
if (results.numPassedTests) {
|
|
213
218
|
results.testResults.forEach((result) => {
|
|
214
219
|
if (result.status === 'passed') {
|
|
215
|
-
loggingProvider_1.logger.info(` - ${result.testName} (${testsUtil_1.calculateTotalTimeSeconds(result.startTime, result.endTime)}s)`);
|
|
220
|
+
loggingProvider_1.logger.info(` - ${result.testName} (${(0, testsUtil_1.calculateTotalTimeSeconds)(result.startTime, result.endTime)}s)`);
|
|
216
221
|
}
|
|
217
222
|
});
|
|
218
223
|
}
|
|
@@ -228,13 +233,13 @@ async function run(parsed) {
|
|
|
228
233
|
if (results.numFailedTests) {
|
|
229
234
|
results.testResults.forEach((result) => {
|
|
230
235
|
if (result.status === 'failed') {
|
|
231
|
-
loggingProvider_1.logger.info(chalk.red(` - ${result.testName} (${testsUtil_1.calculateTotalTimeSeconds(result.startTime, result.endTime)}s)`));
|
|
236
|
+
loggingProvider_1.logger.info(chalk.red(` - ${result.testName} (${(0, testsUtil_1.calculateTotalTimeSeconds)(result.startTime, result.endTime)}s)`));
|
|
232
237
|
}
|
|
233
238
|
});
|
|
234
239
|
}
|
|
235
|
-
loggingProvider_1.logger.info(`Total time: ${testsUtil_1.calculateTotalTimeSeconds(commandStartTime, Date.now())} seconds`);
|
|
240
|
+
loggingProvider_1.logger.info(`Total time: ${(0, testsUtil_1.calculateTotalTimeSeconds)(commandStartTime, Date.now())} seconds`);
|
|
236
241
|
if (parsed.reporter) {
|
|
237
|
-
await reporter_1.handleReportingForTestsRun(parsed.reporter, results, parsed['reporter-options']);
|
|
242
|
+
await (0, reporter_1.handleReportingForTestsRun)(parsed.reporter, results, parsed['reporter-options']);
|
|
238
243
|
}
|
|
239
244
|
if (!results.success && !testRunnerConfig.keepBrowserOpen) {
|
|
240
245
|
process.exit(1);
|
|
@@ -93,7 +93,7 @@ function getTrainerVersion() {
|
|
|
93
93
|
exports.getTrainerVersion = getTrainerVersion;
|
|
94
94
|
async function downloadTrainer(version) {
|
|
95
95
|
fs.ensureDirSync(getTrainerPath());
|
|
96
|
-
const client = axios_1.default.create(httpUtil_1.currentProxyConfig());
|
|
96
|
+
const client = axios_1.default.create((0, httpUtil_1.currentProxyConfig)());
|
|
97
97
|
const url = `${env_1.BASE_API_URL}/trainer/distribution?${buildQueryStringsForDistro(version)}`;
|
|
98
98
|
const finalPath = getTrainerZipFile();
|
|
99
99
|
const writer = fs.createWriteStream(finalPath);
|
|
@@ -154,7 +154,7 @@ exports.checkForTrainerUpdate = checkForTrainerUpdate;
|
|
|
154
154
|
async function getCurrentVersionChecksum() {
|
|
155
155
|
const url = `${env_1.BASE_API_URL}/trainer/distribution?${buildQueryStringsForDistro()}`;
|
|
156
156
|
return axios_1.default
|
|
157
|
-
.head(url, httpUtil_1.currentProxyConfig())
|
|
157
|
+
.head(url, (0, httpUtil_1.currentProxyConfig)())
|
|
158
158
|
.then((response) => response.headers['x-goog-hash'])
|
|
159
159
|
.catch((error) => {
|
|
160
160
|
loggingProvider_1.logger.error(chalk.red.bold(`There was an issue checking the current mabl trainer. ${error.message}`));
|
|
@@ -19,7 +19,7 @@ async function updateTrainer(parsed) {
|
|
|
19
19
|
const version = parsed['trainer-version'];
|
|
20
20
|
const printedVersion = chalk.magenta(`${version !== null && version !== void 0 ? version : 'latest'}`);
|
|
21
21
|
loggingProvider_1.logger.info(`Updating the local version of the mabl Trainer to: ${printedVersion}`);
|
|
22
|
-
const updatedVersion = await trainerUtil_1.updateMablTrainer(version);
|
|
22
|
+
const updatedVersion = await (0, trainerUtil_1.updateMablTrainer)(version);
|
|
23
23
|
const newVersion = updatedVersion !== null && updatedVersion !== void 0 ? updatedVersion : 'unknown';
|
|
24
24
|
loggingProvider_1.logger.info(`Update complete, version: ${chalk.magenta(newVersion)}, is ready`);
|
|
25
25
|
return newVersion;
|
|
@@ -9,8 +9,8 @@ exports.builder = {};
|
|
|
9
9
|
exports.handler = getVersion;
|
|
10
10
|
async function getVersion() {
|
|
11
11
|
try {
|
|
12
|
-
await trainerUtil_1.checkForTrainerUpdate();
|
|
13
|
-
const trainerVersion = trainerUtil_1.getTrainerVersion() || '';
|
|
12
|
+
await (0, trainerUtil_1.checkForTrainerUpdate)();
|
|
13
|
+
const trainerVersion = (0, trainerUtil_1.getTrainerVersion)() || '';
|
|
14
14
|
if (trainerVersion) {
|
|
15
15
|
loggingProvider_1.logger.info(`Current CLI mabl Trainer version is: ${chalk.magenta(trainerVersion)}`);
|
|
16
16
|
}
|
|
@@ -27,9 +27,9 @@ exports.builder = (yargs) => {
|
|
|
27
27
|
nargs: 1,
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
exports.handler = util_1.failWrapper(copyWorkspace);
|
|
30
|
+
exports.handler = (0, util_1.failWrapper)(copyWorkspace);
|
|
31
31
|
function getTimestamp() {
|
|
32
|
-
return moment_1.default().format('HH:mm:ss');
|
|
32
|
+
return (0, moment_1.default)().format('HH:mm:ss');
|
|
33
33
|
}
|
|
34
34
|
function hasOwnerRoleInWorkspace(user, workspaceId) {
|
|
35
35
|
var _a;
|
|
@@ -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('workspace');
|
|
8
|
-
exports.builder = describe_1.getDescribeBuilderOptions();
|
|
9
|
-
exports.handler = util_1.failWrapper(getWorkspace);
|
|
7
|
+
exports.describe = (0, util_1.getDescribeDescriptions)('workspace');
|
|
8
|
+
exports.builder = (0, describe_1.getDescribeBuilderOptions)();
|
|
9
|
+
exports.handler = (0, util_1.failWrapper)(getWorkspace);
|
|
10
10
|
async function getWorkspace(parsed) {
|
|
11
11
|
try {
|
|
12
12
|
const workspaceId = parsed.id;
|
|
13
13
|
const apiClient = await mablApiClientFactory_1.MablApiClientFactory.createApiClient();
|
|
14
14
|
const workspace = await apiClient.getWorkspace(workspaceId);
|
|
15
|
-
describe_1.outputEntity(workspace, parsed.output);
|
|
15
|
+
(0, describe_1.outputEntity)(workspace, parsed.output);
|
|
16
16
|
return workspace.id;
|
|
17
17
|
}
|
|
18
18
|
catch (error) {
|
|
@@ -28,7 +28,7 @@ exports.builder = (yargs) => {
|
|
|
28
28
|
nargs: 1,
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
|
-
exports.handler = util_1.failWrapper(listWorkspaces);
|
|
31
|
+
exports.handler = (0, util_1.failWrapper)(listWorkspaces);
|
|
32
32
|
async function listWorkspaces(parsed) {
|
|
33
33
|
const output = parsed.output;
|
|
34
34
|
const limit = parsed.limit;
|
|
@@ -43,7 +43,7 @@ function printWorkspaces(workspaces, output) {
|
|
|
43
43
|
loggingProvider_1.logger.info(JSON.stringify(workspaces, null, 2));
|
|
44
44
|
break;
|
|
45
45
|
case 'yaml':
|
|
46
|
-
loggingProvider_1.logger.info(js_yaml_1.dump(workspaces));
|
|
46
|
+
loggingProvider_1.logger.info((0, js_yaml_1.dump)(workspaces));
|
|
47
47
|
break;
|
|
48
48
|
default:
|
|
49
49
|
const table = new cli_table3_1.default({
|
|
@@ -18,7 +18,7 @@ class FlowConfig {
|
|
|
18
18
|
flowConfig.flowType = this.flow.flow_type;
|
|
19
19
|
flowConfig.workspaceId = this.flow.organization_id;
|
|
20
20
|
flowConfig.reusable = this.flow.reusable;
|
|
21
|
-
const loadedSteps = importer_1.parseMablScriptIntoSteps(this.flow);
|
|
21
|
+
const loadedSteps = (0, importer_1.parseMablScriptIntoSteps)(this.flow);
|
|
22
22
|
flowConfig.steps = loadedSteps.map((step) => step.getFormattedStep(this.includeLocatorInfo));
|
|
23
23
|
return flowConfig;
|
|
24
24
|
}
|
|
@@ -12,15 +12,15 @@ class SelIdeConfig {
|
|
|
12
12
|
var _a;
|
|
13
13
|
const selIdeConfig = {};
|
|
14
14
|
const selIdeTest = {};
|
|
15
|
-
selIdeTest.id = SeleniumIdeStep_1.generateIdForSeleniumEntity(this.journey.id + 'test');
|
|
15
|
+
selIdeTest.id = (0, SeleniumIdeStep_1.generateIdForSeleniumEntity)(this.journey.id + 'test');
|
|
16
16
|
selIdeTest.name = (_a = this.journey.name) !== null && _a !== void 0 ? _a : '';
|
|
17
17
|
let steps = [];
|
|
18
18
|
this.flows.forEach((flow) => {
|
|
19
|
-
const loadedSteps = importer_1.parseMablScriptIntoSteps(flow);
|
|
19
|
+
const loadedSteps = (0, importer_1.parseMablScriptIntoSteps)(flow);
|
|
20
20
|
steps = steps.concat(loadedSteps);
|
|
21
21
|
});
|
|
22
|
-
selIdeTest.commands = importer_1.seleniumIdeTheLoadedSteps(steps);
|
|
23
|
-
const storeDefaultUrl = SeleniumIdeStep_1.buildSeleniumIdeStep('store');
|
|
22
|
+
selIdeTest.commands = (0, importer_1.seleniumIdeTheLoadedSteps)(steps);
|
|
23
|
+
const storeDefaultUrl = (0, SeleniumIdeStep_1.buildSeleniumIdeStep)('store');
|
|
24
24
|
if (this.journey.url) {
|
|
25
25
|
storeDefaultUrl.target = this.journey.url;
|
|
26
26
|
selIdeConfig.url = this.journey.url;
|
|
@@ -32,7 +32,7 @@ class SelIdeConfig {
|
|
|
32
32
|
selIdeConfig.tests = [selIdeTest];
|
|
33
33
|
selIdeConfig.suites = [
|
|
34
34
|
{
|
|
35
|
-
id: SeleniumIdeStep_1.generateIdForSeleniumEntity(this.journey.id + 'suite'),
|
|
35
|
+
id: (0, SeleniumIdeStep_1.generateIdForSeleniumEntity)(this.journey.id + 'suite'),
|
|
36
36
|
name: this.journey.name,
|
|
37
37
|
persistSession: false,
|
|
38
38
|
parallel: false,
|
|
@@ -40,7 +40,7 @@ class SelIdeConfig {
|
|
|
40
40
|
tests: [selIdeTest.id],
|
|
41
41
|
},
|
|
42
42
|
];
|
|
43
|
-
selIdeConfig.id = SeleniumIdeStep_1.generateIdForSeleniumEntity(this.journey.id + 'config');
|
|
43
|
+
selIdeConfig.id = (0, SeleniumIdeStep_1.generateIdForSeleniumEntity)(this.journey.id + 'config');
|
|
44
44
|
return selIdeConfig;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -9,10 +9,10 @@ var RunnerActionMessageTypes;
|
|
|
9
9
|
})(RunnerActionMessageTypes = exports.RunnerActionMessageTypes || (exports.RunnerActionMessageTypes = {}));
|
|
10
10
|
class RunnerActionEventEmitter {
|
|
11
11
|
static stopRunningTest(eventEmitter) {
|
|
12
|
-
messaging_1.getEmitter(eventEmitter).sendToProcess(new messaging_1.MablCoreProcessAction(RunnerActionMessageTypes.RUNNER_STOP, {}));
|
|
12
|
+
(0, messaging_1.getEmitter)(eventEmitter).sendToProcess(new messaging_1.MablCoreProcessAction(RunnerActionMessageTypes.RUNNER_STOP, {}));
|
|
13
13
|
}
|
|
14
14
|
static killRunningTest(eventEmitter) {
|
|
15
|
-
messaging_1.getEmitter(eventEmitter).sendToProcess(new messaging_1.MablCoreProcessAction(RunnerActionMessageTypes.RUNNER_TERMINATE, {}));
|
|
15
|
+
(0, messaging_1.getEmitter)(eventEmitter).sendToProcess(new messaging_1.MablCoreProcessAction(RunnerActionMessageTypes.RUNNER_TERMINATE, {}));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
exports.RunnerActionEventEmitter = RunnerActionEventEmitter;
|
|
@@ -12,11 +12,11 @@ const messaging_1 = require("../messaging/messaging");
|
|
|
12
12
|
const chalk_1 = __importDefault(require("chalk"));
|
|
13
13
|
async function openUrlInDesktopApp(url, trainingSessionOptions) {
|
|
14
14
|
const params = querystring_1.default.stringify({ ...trainingSessionOptions });
|
|
15
|
-
const childProcess = await open_1.default(`${env_1.ELECTRON_PROTOCOL}://${url}/${params}`);
|
|
15
|
+
const childProcess = await (0, open_1.default)(`${env_1.ELECTRON_PROTOCOL}://${url}/${params}`);
|
|
16
16
|
let childProcessExited = false;
|
|
17
17
|
const keepAliveUntilExited = () => {
|
|
18
18
|
if (!childProcessExited) {
|
|
19
|
-
timers_1.setTimeout(keepAliveUntilExited, 1000);
|
|
19
|
+
(0, timers_1.setTimeout)(keepAliveUntilExited, 1000);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
keepAliveUntilExited();
|
|
@@ -14,12 +14,12 @@ var ElectronProtocolUrl;
|
|
|
14
14
|
})(ElectronProtocolUrl = exports.ElectronProtocolUrl || (exports.ElectronProtocolUrl = {}));
|
|
15
15
|
async function trainNewTest(trainingSessionOptions) {
|
|
16
16
|
var _a;
|
|
17
|
-
const apiClient = await util_1.getApiClientFromOptions(trainingSessionOptions, true);
|
|
17
|
+
const apiClient = await (0, util_1.getApiClientFromOptions)(trainingSessionOptions, true);
|
|
18
18
|
if (!trainingSessionOptions.branchName) {
|
|
19
19
|
trainingSessionOptions.branchName = constants_1.DefaultBranchName;
|
|
20
20
|
}
|
|
21
21
|
if (trainingSessionOptions.branchName !== 'master') {
|
|
22
|
-
await branches_1.checkBranchNameAndAutoBranchMaybe(trainingSessionOptions.workspaceId, apiClient, trainingSessionOptions.branchName, trainingSessionOptions.autoBranch);
|
|
22
|
+
await (0, branches_1.checkBranchNameAndAutoBranchMaybe)(trainingSessionOptions.workspaceId, apiClient, trainingSessionOptions.branchName, trainingSessionOptions.autoBranch);
|
|
23
23
|
}
|
|
24
24
|
if (trainingSessionOptions.environmentId) {
|
|
25
25
|
await apiClient.getEnvironment(trainingSessionOptions.environmentId);
|
|
@@ -33,26 +33,26 @@ async function trainNewTest(trainingSessionOptions) {
|
|
|
33
33
|
if (trainingSessionOptions.applicationId) {
|
|
34
34
|
await apiClient.getApplication(trainingSessionOptions.applicationId);
|
|
35
35
|
}
|
|
36
|
-
testsUtil_1.logTestInfoIfPresent(`Creating test in desktop app: `, trainingSessionOptions.testName);
|
|
37
|
-
testsUtil_1.logTestInfoIfPresent(`Add auto login flow: `, trainingSessionOptions.autoLogin);
|
|
38
|
-
testsUtil_1.logTestInfoIfPresent(`URL: `, trainingSessionOptions.url);
|
|
39
|
-
testsUtil_1.logTestInfoIfPresent(`Workspace: `, trainingSessionOptions.workspaceId);
|
|
40
|
-
testsUtil_1.logTestInfoIfPresent(`Branch: `, trainingSessionOptions.branchName);
|
|
41
|
-
testsUtil_1.logTestInfoIfPresent(`Plan ID: `, trainingSessionOptions.planId);
|
|
42
|
-
testsUtil_1.logTestInfoIfPresent(`Application ID: `, trainingSessionOptions.applicationId);
|
|
43
|
-
testsUtil_1.logTestInfoIfPresent(`Environment ID: `, trainingSessionOptions.environmentId);
|
|
44
|
-
testsUtil_1.logTestInfoIfPresent(`Credentials ID: `, trainingSessionOptions.credentialsId);
|
|
45
|
-
testsUtil_1.logTestInfoIfPresent(`Datatable ID(s): `, (_a = trainingSessionOptions.dataTableIds) === null || _a === void 0 ? void 0 : _a.join(', '));
|
|
46
|
-
testsUtil_1.logTestInfoIfPresent(`Test description: `, trainingSessionOptions.testDescription);
|
|
47
|
-
await openUtils_1.openUrlInDesktopApp(ElectronProtocolUrl.TRAIN_NEW_TEST, trainingSessionOptions);
|
|
36
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Creating test in desktop app: `, trainingSessionOptions.testName);
|
|
37
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Add auto login flow: `, trainingSessionOptions.autoLogin);
|
|
38
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`URL: `, trainingSessionOptions.url);
|
|
39
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Workspace: `, trainingSessionOptions.workspaceId);
|
|
40
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Branch: `, trainingSessionOptions.branchName);
|
|
41
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Plan ID: `, trainingSessionOptions.planId);
|
|
42
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Application ID: `, trainingSessionOptions.applicationId);
|
|
43
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Environment ID: `, trainingSessionOptions.environmentId);
|
|
44
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Credentials ID: `, trainingSessionOptions.credentialsId);
|
|
45
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Datatable ID(s): `, (_a = trainingSessionOptions.dataTableIds) === null || _a === void 0 ? void 0 : _a.join(', '));
|
|
46
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Test description: `, trainingSessionOptions.testDescription);
|
|
47
|
+
await (0, openUtils_1.openUrlInDesktopApp)(ElectronProtocolUrl.TRAIN_NEW_TEST, trainingSessionOptions);
|
|
48
48
|
}
|
|
49
49
|
exports.trainNewTest = trainNewTest;
|
|
50
50
|
async function editTest(trainingSessionOptions) {
|
|
51
51
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
52
|
-
const apiClient = await util_1.getApiClientFromOptions(trainingSessionOptions, true);
|
|
52
|
+
const apiClient = await (0, util_1.getApiClientFromOptions)(trainingSessionOptions, true);
|
|
53
53
|
let testRunIdConfig = { testId: '', filterHttpRequests: false };
|
|
54
54
|
if (trainingSessionOptions.testRunId) {
|
|
55
|
-
testRunIdConfig = await testsUtil_1.pullDownTestRunConfig(trainingSessionOptions.testRunId, apiClient);
|
|
55
|
+
testRunIdConfig = await (0, testsUtil_1.pullDownTestRunConfig)(trainingSessionOptions.testRunId, apiClient);
|
|
56
56
|
}
|
|
57
57
|
const url = (_a = trainingSessionOptions.url) !== null && _a !== void 0 ? _a : testRunIdConfig.url;
|
|
58
58
|
const credentialsId = (_b = trainingSessionOptions.credentialsId) !== null && _b !== void 0 ? _b : testRunIdConfig.credentialsId;
|
|
@@ -70,19 +70,19 @@ async function editTest(trainingSessionOptions) {
|
|
|
70
70
|
throw new Error(util_2.TEST_INFO_NOT_FOUND);
|
|
71
71
|
}
|
|
72
72
|
if (branchName !== 'master') {
|
|
73
|
-
await branches_1.checkBranchNameAndAutoBranchMaybe(test.organization_id, apiClient, branchName, trainingSessionOptions.autoBranch);
|
|
73
|
+
await (0, branches_1.checkBranchNameAndAutoBranchMaybe)(test.organization_id, apiClient, branchName, trainingSessionOptions.autoBranch);
|
|
74
74
|
}
|
|
75
|
-
const finalUrl = testsUtil_1.getFinalUrl(test, url);
|
|
75
|
+
const finalUrl = (0, testsUtil_1.getFinalUrl)(test, url);
|
|
76
76
|
if (environmentId) {
|
|
77
77
|
await apiClient.getEnvironment(environmentId);
|
|
78
78
|
}
|
|
79
|
-
testsUtil_1.logTestInfoIfPresent(`Editing test in desktop app: `, `${test.name} - ${test.invariant_id}`);
|
|
80
|
-
testsUtil_1.logTestInfoIfPresent(`Test description: `, test.description);
|
|
81
|
-
testsUtil_1.logTestInfoIfPresent(`URL: `, finalUrl);
|
|
82
|
-
testsUtil_1.logTestInfoIfPresent(`Workspace: `, test.organization_id);
|
|
83
|
-
testsUtil_1.logTestInfoIfPresent(`Branch: `, branchName);
|
|
84
|
-
testsUtil_1.logTestInfoIfPresent(`Environment ID: `, environmentId);
|
|
85
|
-
testsUtil_1.logTestInfoIfPresent(`Credentials ID: `, credentialsId);
|
|
79
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Editing test in desktop app: `, `${test.name} - ${test.invariant_id}`);
|
|
80
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Test description: `, test.description);
|
|
81
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`URL: `, finalUrl);
|
|
82
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Workspace: `, test.organization_id);
|
|
83
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Branch: `, branchName);
|
|
84
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Environment ID: `, environmentId);
|
|
85
|
+
(0, testsUtil_1.logTestInfoIfPresent)(`Credentials ID: `, credentialsId);
|
|
86
86
|
const scriptConfig = {
|
|
87
87
|
applicationId: trainingSessionOptions.applicationId,
|
|
88
88
|
branchName,
|
|
@@ -95,6 +95,6 @@ async function editTest(trainingSessionOptions) {
|
|
|
95
95
|
planId: testRunIdConfig.fromPlanId,
|
|
96
96
|
url: finalUrl,
|
|
97
97
|
};
|
|
98
|
-
await openUtils_1.openUrlInDesktopApp(ElectronProtocolUrl.EDIT_TEST, scriptConfig);
|
|
98
|
+
await (0, openUtils_1.openUrlInDesktopApp)(ElectronProtocolUrl.EDIT_TEST, scriptConfig);
|
|
99
99
|
}
|
|
100
100
|
exports.editTest = editTest;
|