@mablhq/mabl-cli 1.12.24 → 1.12.33
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/playwrightBrowserLauncher/playwrightBrowser.js +2 -2
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +25 -11
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +24 -17
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +19 -19
- package/browserLauncher/playwrightBrowserLauncher/wrappers.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +3 -3
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +6 -6
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerFrame.js +7 -7
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpRequest.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +1 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerJsHandle.js +3 -3
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerPage.js +23 -16
- 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 +10 -17
- 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 +6 -6
- package/commands/tests/tests_cmds/run-legacy.js +2 -2
- package/commands/tests/tests_cmds/run.js +4 -4
- 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/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/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 -5
- package/popupDismissal/index.js +7 -7
- 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/util/RichPromise.js +2 -2
- package/util/actionabilityUtil.js +5 -3
- 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
|
@@ -54,7 +54,7 @@ async function pullJourney(parsed) {
|
|
|
54
54
|
const journey = await apiClient.getJourney(testId, branchName, format);
|
|
55
55
|
const flowArray = await util_1.getJourneyFlowArray(journey, apiClient, branchName);
|
|
56
56
|
if (flowArray
|
|
57
|
-
.map(flow => flow.flow_type === mablApi_1.Flow.FlowTypeEnum.Mablscript ||
|
|
57
|
+
.map((flow) => flow.flow_type === mablApi_1.Flow.FlowTypeEnum.Mablscript ||
|
|
58
58
|
flow.flow_type === mablApi_1.Flow.FlowTypeEnum.Api)
|
|
59
59
|
.includes(false)) {
|
|
60
60
|
loggingProvider_1.logger.info(chalk.red(`Default mabl tests can not be exported`));
|
|
@@ -128,7 +128,7 @@ function getTestName(name) {
|
|
|
128
128
|
validate: nameValidator,
|
|
129
129
|
},
|
|
130
130
|
])
|
|
131
|
-
.then(answers => answers.name);
|
|
131
|
+
.then((answers) => answers.name);
|
|
132
132
|
}
|
|
133
133
|
async function importTests(port, debug, importMultipleTests) {
|
|
134
134
|
const importedTests = [];
|
|
@@ -215,10 +215,10 @@ function saveTests(workspaceId, name, apiClient, importedTests) {
|
|
|
215
215
|
loggingProvider_1.logger.info(`Saving ${pluralize_1.default('test', importedTests.length, true)}...`);
|
|
216
216
|
const savePromises = importedTests.map((steps, index) => apiClient
|
|
217
217
|
.createFlow(stepsToFlow(workspaceId, steps))
|
|
218
|
-
.then(flow => apiClient.createJourney(flowToJourney(importedTests.length === 1
|
|
218
|
+
.then((flow) => apiClient.createJourney(flowToJourney(importedTests.length === 1
|
|
219
219
|
? name
|
|
220
220
|
: `${name} (${index + 1} of ${importedTests.length})`, flow)))
|
|
221
|
-
.then(journey => {
|
|
221
|
+
.then((journey) => {
|
|
222
222
|
loggingProvider_1.logger.info(`Saved test ${journey.invariant_id} : ${env_1.BASE_APP_URL}/workspaces/${journey.organization_id}/train/journeys/${journey.invariant_id}/current`);
|
|
223
223
|
return journey;
|
|
224
224
|
}));
|
|
@@ -229,14 +229,14 @@ function displayTestDescriptions(importedTests) {
|
|
|
229
229
|
if (importedTests.length > 1) {
|
|
230
230
|
loggingProvider_1.logger.info(`Test ${index + 1} of ${importedTests.length}:`);
|
|
231
231
|
}
|
|
232
|
-
loggingProvider_1.logger.info(steps.map(step => step.description).join('\n'));
|
|
232
|
+
loggingProvider_1.logger.info(steps.map((step) => step.description).join('\n'));
|
|
233
233
|
loggingProvider_1.logger.logNewLine();
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
async function runTests(workspaceId, name, importedTests) {
|
|
237
237
|
var _a, _b;
|
|
238
|
-
const flows = importedTests.map(steps => stepsToFlow(workspaceId, steps));
|
|
239
|
-
const firstUrl = (_a = flows.find(flow => flow.url)) === null || _a === void 0 ? void 0 : _a.url;
|
|
238
|
+
const flows = importedTests.map((steps) => stepsToFlow(workspaceId, steps));
|
|
239
|
+
const firstUrl = (_a = flows.find((flow) => flow.url)) === null || _a === void 0 ? void 0 : _a.url;
|
|
240
240
|
for (let flowIndex = 0; flowIndex < flows.length; flowIndex++) {
|
|
241
241
|
loggingProvider_1.logger.info(`Running test ${flowIndex + 1} of ${flows.length}.`);
|
|
242
242
|
const flow = flows[flowIndex];
|
|
@@ -257,13 +257,13 @@ function stepsToFlow(workspaceId, steps) {
|
|
|
257
257
|
organization_id: workspaceId,
|
|
258
258
|
reusable: false,
|
|
259
259
|
selectors: steps
|
|
260
|
-
.map(step => step.selector)
|
|
261
|
-
.map(selector => selector === null || selector === void 0 ? void 0 : selector.toMablscriptSelector())
|
|
262
|
-
.filter(selector => !!selector)
|
|
263
|
-
.map(selector => selector),
|
|
264
|
-
script: steps.map(step => step.mablscript).join('\n'),
|
|
265
|
-
script_description: steps.map(step => step.description).join('\n'),
|
|
266
|
-
url: steps.map(step => step.url).find(url => url),
|
|
260
|
+
.map((step) => step.selector)
|
|
261
|
+
.map((selector) => selector === null || selector === void 0 ? void 0 : selector.toMablscriptSelector())
|
|
262
|
+
.filter((selector) => !!selector)
|
|
263
|
+
.map((selector) => selector),
|
|
264
|
+
script: steps.map((step) => step.mablscript).join('\n'),
|
|
265
|
+
script_description: steps.map((step) => step.description).join('\n'),
|
|
266
|
+
url: steps.map((step) => step.url).find((url) => url),
|
|
267
267
|
};
|
|
268
268
|
return prototype;
|
|
269
269
|
}
|
|
@@ -48,7 +48,7 @@ async function listTests(parsed) {
|
|
|
48
48
|
limit,
|
|
49
49
|
include_labels: labels,
|
|
50
50
|
});
|
|
51
|
-
const outputJourneys = journeys.map(journey => ({
|
|
51
|
+
const outputJourneys = journeys.map((journey) => ({
|
|
52
52
|
created_time: journey.created_time,
|
|
53
53
|
id: journey.invariant_id,
|
|
54
54
|
name: journey.name,
|
|
@@ -76,7 +76,7 @@ function printTestsAsTable(tests) {
|
|
|
76
76
|
head: ['ID', 'Name', 'Created time'],
|
|
77
77
|
wordWrap: true,
|
|
78
78
|
});
|
|
79
|
-
tests.forEach(test => {
|
|
79
|
+
tests.forEach((test) => {
|
|
80
80
|
table.push([
|
|
81
81
|
{ rowSpan: 1, content: test.invariant_id, vAlign: 'center' },
|
|
82
82
|
{ rowSpan: 1, content: test.name, vAlign: 'center' },
|
|
@@ -119,7 +119,7 @@ exports.builder = (yargs) => {
|
|
|
119
119
|
default: false,
|
|
120
120
|
type: 'boolean',
|
|
121
121
|
})
|
|
122
|
-
.check(argv => 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]));
|
|
122
|
+
.check((argv) => 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]));
|
|
123
123
|
};
|
|
124
124
|
const exitCodeOnError = 1;
|
|
125
125
|
exports.handler = util_1.failWrapper(runAlpha, exitCodeOnError);
|
|
@@ -130,7 +130,7 @@ exports.builder = (yargs) => {
|
|
|
130
130
|
type: 'boolean',
|
|
131
131
|
alias: constants_1.CommandArgAliases.NoPrompt,
|
|
132
132
|
})
|
|
133
|
-
.check(argv => testsUtil_1.validateRunCommandWithLabels(argv[constants_1.CommandArgId], argv[constants_1.CommandArgLabelsInclude], argv[constants_1.CommandArgLabelsExclude]));
|
|
133
|
+
.check((argv) => testsUtil_1.validateRunCommandWithLabels(argv[constants_1.CommandArgId], argv[constants_1.CommandArgLabelsInclude], argv[constants_1.CommandArgLabelsExclude]));
|
|
134
134
|
};
|
|
135
135
|
exports.handler = util_1.failWrapper(runInCloud);
|
|
136
136
|
async function runInCloud(parsed) {
|
|
@@ -217,17 +217,17 @@ async function executeRunCloudTest(test, browsers, branchName, apiClient, maybeD
|
|
|
217
217
|
if (applicationId || environmentId) {
|
|
218
218
|
const deploymentsResult = await apiClient.queryDeploymentEntities(workspaceId);
|
|
219
219
|
const foundDeployments = deploymentsResult.deployments
|
|
220
|
-
? deploymentsResult.deployments.filter(deployment => (!applicationId || deployment.application_id === applicationId) &&
|
|
220
|
+
? deploymentsResult.deployments.filter((deployment) => (!applicationId || deployment.application_id === applicationId) &&
|
|
221
221
|
(!environmentId || deployment.environment_id === environmentId))
|
|
222
222
|
: [];
|
|
223
223
|
if (!foundDeployments.length) {
|
|
224
224
|
throw new Error('No configuration was found for the applicationId/environmentId specified');
|
|
225
225
|
}
|
|
226
|
-
deploymentIds = foundDeployments.map(deployment => deployment.id);
|
|
226
|
+
deploymentIds = foundDeployments.map((deployment) => deployment.id);
|
|
227
227
|
}
|
|
228
228
|
const planRun = await apiClient.postPlanRun(workspaceId, testId, branchName, browsers, effectiveAppUrl, apiUrl, maybeDeploymentId, credentialsId, deploymentIds, basicAuthCredentialsId);
|
|
229
229
|
return planRun.scripts
|
|
230
|
-
? planRun.scripts.map(script => `${env_1.BASE_APP_URL}/workspaces/${planRun.organization_id}/test/journey-runs/${script.id}`)
|
|
230
|
+
? planRun.scripts.map((script) => `${env_1.BASE_APP_URL}/workspaces/${planRun.organization_id}/test/journey-runs/${script.id}`)
|
|
231
231
|
: [];
|
|
232
232
|
}
|
|
233
233
|
async function getJourneysForLabels(workspaceId, branchName, branchChangesOnly, labelsInclude, labelsExclude, limit, prompt, apiClient) {
|
|
@@ -262,10 +262,10 @@ async function getJourneysForLabels(workspaceId, branchName, branchChangesOnly,
|
|
|
262
262
|
message: `Run these [${journeys.length}] tests?`,
|
|
263
263
|
pageSize: 20,
|
|
264
264
|
choices: journeyChoices,
|
|
265
|
-
default: journeyChoices.map(choice => choice.value),
|
|
265
|
+
default: journeyChoices.map((choice) => choice.value),
|
|
266
266
|
},
|
|
267
267
|
]);
|
|
268
|
-
const selectedJourneys = (_a = journeys.filter(journey => { var _a; return (_a = testsToRun === null || testsToRun === void 0 ? void 0 : testsToRun.test_selection) === null || _a === void 0 ? void 0 : _a.includes(journey.id); })) !== null && _a !== void 0 ? _a : [];
|
|
268
|
+
const selectedJourneys = (_a = journeys.filter((journey) => { var _a; return (_a = testsToRun === null || testsToRun === void 0 ? void 0 : testsToRun.test_selection) === null || _a === void 0 ? void 0 : _a.includes(journey.id); })) !== null && _a !== void 0 ? _a : [];
|
|
269
269
|
if (selectedJourneys.length === 0) {
|
|
270
270
|
return [];
|
|
271
271
|
}
|
|
@@ -60,7 +60,7 @@ 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) => testsUtil_1.validateRunEditCommand(argv[constants_1.CommandArgId], argv[constants_1.CommandArgTestRunId]));
|
|
64
64
|
};
|
|
65
65
|
exports.handler = util_1.failWrapper(runLegacy);
|
|
66
66
|
async function runLegacy(parsed) {
|
|
@@ -87,7 +87,7 @@ async function runLegacy(parsed) {
|
|
|
87
87
|
const flowArray = await util_1.getJourneyFlowArray(test, apiClient, branchName);
|
|
88
88
|
const finalUrl = testsUtil_1.getFinalUrl(test, url);
|
|
89
89
|
if (flowArray
|
|
90
|
-
.map(flow => flow.flow_type === mablApi_1.Flow.FlowTypeEnum.Mablscript)
|
|
90
|
+
.map((flow) => flow.flow_type === mablApi_1.Flow.FlowTypeEnum.Mablscript)
|
|
91
91
|
.includes(false)) {
|
|
92
92
|
loggingProvider_1.logger.info(chalk_1.default.red('Default mabl tests are not supported for local runs yet including any test with an auto login flow'));
|
|
93
93
|
return 'error';
|
|
@@ -149,7 +149,7 @@ exports.builder = (yargs) => {
|
|
|
149
149
|
.option(constants_1.CommandArgTestInteractionSpeed, {
|
|
150
150
|
describe: 'Set the speed that mabl interacts with webpages. Overrides test run settings if specified.',
|
|
151
151
|
type: 'string',
|
|
152
|
-
choices: Object.keys(mablApi_1.JourneyParameters.PageLoadWaitEnum).map(pageLoadWait => pageLoadWait.toLowerCase()),
|
|
152
|
+
choices: Object.keys(mablApi_1.JourneyParameters.PageLoadWaitEnum).map((pageLoadWait) => pageLoadWait.toLowerCase()),
|
|
153
153
|
})
|
|
154
154
|
.check((argv) => 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]));
|
|
155
155
|
};
|
|
@@ -192,7 +192,7 @@ async function run(parsed) {
|
|
|
192
192
|
loggingProvider_1.logger.info(`Test count: ${results.numTotalTests}`);
|
|
193
193
|
loggingProvider_1.logger.info(`Passed: ${results.numPassedTests}`);
|
|
194
194
|
if (results.numPassedTests) {
|
|
195
|
-
results.testResults.forEach(result => {
|
|
195
|
+
results.testResults.forEach((result) => {
|
|
196
196
|
if (result.status === 'passed') {
|
|
197
197
|
loggingProvider_1.logger.info(` - ${result.testName} (${testsUtil_1.calculateTotalTimeSeconds(result.startTime, result.endTime)}s)`);
|
|
198
198
|
}
|
|
@@ -200,7 +200,7 @@ async function run(parsed) {
|
|
|
200
200
|
}
|
|
201
201
|
loggingProvider_1.logger.info(`Skipped: ${results.numSkippedTests}`);
|
|
202
202
|
if (results.numSkippedTests) {
|
|
203
|
-
results.testResults.forEach(result => {
|
|
203
|
+
results.testResults.forEach((result) => {
|
|
204
204
|
if (result.status === 'skipped') {
|
|
205
205
|
loggingProvider_1.logger.info(chalk.yellow(` - ${result.testName}`));
|
|
206
206
|
}
|
|
@@ -208,7 +208,7 @@ async function run(parsed) {
|
|
|
208
208
|
}
|
|
209
209
|
loggingProvider_1.logger.info(`Failed: ${results.numFailedTests}`);
|
|
210
210
|
if (results.numFailedTests) {
|
|
211
|
-
results.testResults.forEach(result => {
|
|
211
|
+
results.testResults.forEach((result) => {
|
|
212
212
|
if (result.status === 'failed') {
|
|
213
213
|
loggingProvider_1.logger.info(chalk.red(` - ${result.testName} (${testsUtil_1.calculateTotalTimeSeconds(result.startTime, result.endTime)}s)`));
|
|
214
214
|
}
|
|
@@ -33,7 +33,7 @@ function getTimestamp() {
|
|
|
33
33
|
}
|
|
34
34
|
function hasOwnerRoleInWorkspace(user, workspaceId) {
|
|
35
35
|
var _a;
|
|
36
|
-
const hasOwnerRole = (_a = user.roles) === null || _a === void 0 ? void 0 : _a.some(role => role.organization_id === workspaceId &&
|
|
36
|
+
const hasOwnerRole = (_a = user.roles) === null || _a === void 0 ? void 0 : _a.some((role) => role.organization_id === workspaceId &&
|
|
37
37
|
role.role === mablApi_1.UserRole.RoleEnum.Owner);
|
|
38
38
|
if (!hasOwnerRole) {
|
|
39
39
|
loggingProvider_1.logger.warn(chalk_1.default.yellow(`You must be an owner in both workspaces to copy. You do not have owner permissions in workspace: ${workspaceId}`));
|
|
@@ -47,7 +47,7 @@ function printWorkspaces(workspaces, output) {
|
|
|
47
47
|
head: ['ID', 'Name', 'Created time'],
|
|
48
48
|
wordWrap: true,
|
|
49
49
|
});
|
|
50
|
-
workspaces.forEach(workspace => {
|
|
50
|
+
workspaces.forEach((workspace) => {
|
|
51
51
|
table.push([
|
|
52
52
|
{ rowSpan: 1, content: workspace.id, vAlign: 'center' },
|
|
53
53
|
{ rowSpan: 1, content: workspace.name, vAlign: 'center' },
|
|
@@ -19,7 +19,7 @@ class FlowConfig {
|
|
|
19
19
|
flowConfig.workspaceId = this.flow.organization_id;
|
|
20
20
|
flowConfig.reusable = this.flow.reusable;
|
|
21
21
|
const loadedSteps = importer_1.parseMablScriptIntoSteps(this.flow);
|
|
22
|
-
flowConfig.steps = loadedSteps.map(step => step.getFormattedStep(this.includeLocatorInfo));
|
|
22
|
+
flowConfig.steps = loadedSteps.map((step) => step.getFormattedStep(this.includeLocatorInfo));
|
|
23
23
|
return flowConfig;
|
|
24
24
|
}
|
|
25
25
|
generateSimpleFormat() {
|
|
@@ -42,7 +42,7 @@ class FlowConfig {
|
|
|
42
42
|
}
|
|
43
43
|
static generateStepsSimpleFormat(suppliedSteps) {
|
|
44
44
|
const steps = [];
|
|
45
|
-
suppliedSteps.forEach(step => {
|
|
45
|
+
suppliedSteps.forEach((step) => {
|
|
46
46
|
var _a, _b, _c, _d;
|
|
47
47
|
const stepName = Object.keys(step)[0];
|
|
48
48
|
const stepObj = step;
|
|
@@ -72,7 +72,7 @@ class FlowConfig {
|
|
|
72
72
|
' ,Step Number, Step Type, Description, Annotation, Note',
|
|
73
73
|
];
|
|
74
74
|
let count = 0;
|
|
75
|
-
flowConfig.steps.forEach(step => {
|
|
75
|
+
flowConfig.steps.forEach((step) => {
|
|
76
76
|
var _a, _b;
|
|
77
77
|
const stepName = Object.keys(step)[0];
|
|
78
78
|
const stepObj = step;
|
|
@@ -15,7 +15,7 @@ class SelIdeConfig {
|
|
|
15
15
|
selIdeTest.id = 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
|
-
this.flows.forEach(flow => {
|
|
18
|
+
this.flows.forEach((flow) => {
|
|
19
19
|
const loadedSteps = importer_1.parseMablScriptIntoSteps(flow);
|
|
20
20
|
steps = steps.concat(loadedSteps);
|
|
21
21
|
});
|
|
@@ -18,9 +18,9 @@ class JourneyConfig {
|
|
|
18
18
|
journeyConfig.name = this.journey.name;
|
|
19
19
|
journeyConfig.description = this.journey.description;
|
|
20
20
|
journeyConfig.tags = this.journey.tags;
|
|
21
|
-
journeyConfig.labels = (_a = this.journey.labels) === null || _a === void 0 ? void 0 : _a.map(label => label.name);
|
|
21
|
+
journeyConfig.labels = (_a = this.journey.labels) === null || _a === void 0 ? void 0 : _a.map((label) => label.name);
|
|
22
22
|
journeyConfig.dataTables = this.journey.datatables;
|
|
23
|
-
journeyConfig.flows = this.flows.map(flow => {
|
|
23
|
+
journeyConfig.flows = this.flows.map((flow) => {
|
|
24
24
|
const flowConfigGenerator = new flowConfigGenerator_1.FlowConfig(flow, this.includeLocatorInfo);
|
|
25
25
|
return flowConfigGenerator.generateConfigFile();
|
|
26
26
|
});
|
|
@@ -31,7 +31,7 @@ class JourneyConfig {
|
|
|
31
31
|
const config = this.generateConfigFile();
|
|
32
32
|
let steps = [];
|
|
33
33
|
let apiSteps;
|
|
34
|
-
config.flows.forEach(flow => {
|
|
34
|
+
config.flows.forEach((flow) => {
|
|
35
35
|
if (flow.api_steps) {
|
|
36
36
|
apiSteps = flow.api_steps;
|
|
37
37
|
}
|
|
@@ -54,14 +54,13 @@ class JourneyConfig {
|
|
|
54
54
|
' ,Step Number, Step Type, Description, Annotation, Note',
|
|
55
55
|
];
|
|
56
56
|
let count = 0;
|
|
57
|
-
config.flows.forEach(flow => {
|
|
58
|
-
flow.steps.forEach(step => {
|
|
57
|
+
config.flows.forEach((flow) => {
|
|
58
|
+
flow.steps.forEach((step) => {
|
|
59
59
|
var _a, _b;
|
|
60
60
|
const stepName = Object.keys(step)[0];
|
|
61
61
|
const stepObj = step;
|
|
62
62
|
const mablStep = stepObj[stepName];
|
|
63
|
-
output.push(`${count}, ${stepName}, ${mablStep.description}, ${((_a = mablStep === null || mablStep === void 0 ? void 0 : mablStep.annotation) === null || _a === void 0 ? void 0 : _a.note) || '-'}, ${((_b = mablStep === null || mablStep === void 0 ? void 0 : mablStep.annotation) === null || _b === void 0 ? void 0 : _b.description) ||
|
|
64
|
-
'-'}`);
|
|
63
|
+
output.push(`${count}, ${stepName}, ${mablStep.description}, ${((_a = mablStep === null || mablStep === void 0 ? void 0 : mablStep.annotation) === null || _a === void 0 ? void 0 : _a.note) || '-'}, ${((_b = mablStep === null || mablStep === void 0 ? void 0 : mablStep.annotation) === null || _b === void 0 ? void 0 : _b.description) || '-'}`);
|
|
65
64
|
count += 1;
|
|
66
65
|
});
|
|
67
66
|
});
|
|
@@ -70,7 +69,7 @@ class JourneyConfig {
|
|
|
70
69
|
}
|
|
71
70
|
exports.JourneyConfig = JourneyConfig;
|
|
72
71
|
function convertUndefined(mablObjectConfigFile) {
|
|
73
|
-
Object.keys(mablObjectConfigFile).forEach(key => {
|
|
72
|
+
Object.keys(mablObjectConfigFile).forEach((key) => {
|
|
74
73
|
if (mablObjectConfigFile[key] === undefined) {
|
|
75
74
|
mablObjectConfigFile[key] = null;
|
|
76
75
|
}
|
|
@@ -5,14 +5,14 @@ function deduplicateApiTestExecutionResults(postmanResult) {
|
|
|
5
5
|
var _a;
|
|
6
6
|
const executionsById = {};
|
|
7
7
|
const orderedExecutionIds = [];
|
|
8
|
-
(_a = postmanResult.run.executions) === null || _a === void 0 ? void 0 : _a.forEach(execution => {
|
|
8
|
+
(_a = postmanResult.run.executions) === null || _a === void 0 ? void 0 : _a.forEach((execution) => {
|
|
9
9
|
const executionId = execution.id;
|
|
10
10
|
if (!executionsById[executionId]) {
|
|
11
11
|
orderedExecutionIds.push(executionId);
|
|
12
12
|
}
|
|
13
13
|
executionsById[executionId] = execution;
|
|
14
14
|
});
|
|
15
|
-
postmanResult.run.executions = orderedExecutionIds.map(executionId => executionsById[executionId]);
|
|
15
|
+
postmanResult.run.executions = orderedExecutionIds.map((executionId) => executionsById[executionId]);
|
|
16
16
|
return postmanResult;
|
|
17
17
|
}
|
|
18
18
|
exports.deduplicateApiTestExecutionResults = deduplicateApiTestExecutionResults;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.logSessionStarted = exports.openUrlInDesktopApp = void 0;
|
|
7
|
+
const querystring_1 = __importDefault(require("querystring"));
|
|
8
|
+
const open_1 = __importDefault(require("open"));
|
|
9
|
+
const env_1 = require("../../env/env");
|
|
10
|
+
const timers_1 = require("timers");
|
|
11
|
+
const messaging_1 = require("../messaging/messaging");
|
|
12
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
13
|
+
async function openUrlInDesktopApp(url, trainingSessionOptions) {
|
|
14
|
+
const params = querystring_1.default.stringify({ ...trainingSessionOptions });
|
|
15
|
+
const childProcess = await open_1.default(`${env_1.ELECTRON_PROTOCOL}://${url}/${params}`);
|
|
16
|
+
let childProcessExited = false;
|
|
17
|
+
const keepAliveUntilExited = () => {
|
|
18
|
+
if (!childProcessExited) {
|
|
19
|
+
timers_1.setTimeout(keepAliveUntilExited, 1000);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
keepAliveUntilExited();
|
|
23
|
+
const exitCode = await new Promise((resolve) => {
|
|
24
|
+
childProcess.on('error', () => {
|
|
25
|
+
childProcessExited = true;
|
|
26
|
+
resolve(1);
|
|
27
|
+
});
|
|
28
|
+
childProcess.on('exit', function () {
|
|
29
|
+
childProcessExited = true;
|
|
30
|
+
resolve(childProcess.exitCode);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
if (exitCode === 0) {
|
|
34
|
+
logSessionStarted();
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
logInstallDesktopApp();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.openUrlInDesktopApp = openUrlInDesktopApp;
|
|
41
|
+
function logSessionStarted() {
|
|
42
|
+
messaging_1.mablEventEmitter.log(chalk_1.default.yellowBright('Session started in the desktop app'));
|
|
43
|
+
}
|
|
44
|
+
exports.logSessionStarted = logSessionStarted;
|
|
45
|
+
function logInstallDesktopApp() {
|
|
46
|
+
messaging_1.mablEventEmitter.log(chalk_1.default.red(`\nFailed to launch mabl desktop app!`, chalk_1.default.cyan(`\nPlease check your installation or download and install it from`), chalk_1.default.magenta('https://www.mabl.com/desktop-app')));
|
|
47
|
+
}
|
|
@@ -1,50 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.editTest = exports.trainNewTest = void 0;
|
|
4
|
-
const authenticationProvider_1 = require("../../providers/authenticationProvider");
|
|
3
|
+
exports.editTest = exports.trainNewTest = exports.ElectronProtocolUrl = void 0;
|
|
5
4
|
const branches_1 = require("../../commands/commandUtil/branches");
|
|
6
5
|
const testsUtil_1 = require("../../commands/tests/testsUtil");
|
|
7
|
-
const trainerBrowserUtil_1 = require("./trainerBrowserUtil");
|
|
8
|
-
const util_1 = require("../../commands/commandUtil/util");
|
|
9
6
|
const constants_1 = require("../../commands/constants");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
7
|
+
const util_1 = require("../util");
|
|
8
|
+
const openUtils_1 = require("./openUtils");
|
|
9
|
+
const util_2 = require("../../commands/commandUtil/util");
|
|
10
|
+
var ElectronProtocolUrl;
|
|
11
|
+
(function (ElectronProtocolUrl) {
|
|
12
|
+
ElectronProtocolUrl["EDIT_TEST"] = "editTest";
|
|
13
|
+
ElectronProtocolUrl["TRAIN_NEW_TEST"] = "trainNewTest";
|
|
14
|
+
})(ElectronProtocolUrl = exports.ElectronProtocolUrl || (exports.ElectronProtocolUrl = {}));
|
|
12
15
|
async function trainNewTest(trainingSessionOptions) {
|
|
13
|
-
var _a
|
|
14
|
-
|
|
15
|
-
const authConfig = await new authenticationProvider_1.AuthenticationProvider().getAuthConfigWithAutoRenew();
|
|
16
|
-
const apiClient = await util_2.getApiClientFromOptions(trainingSessionOptions, true);
|
|
16
|
+
var _a;
|
|
17
|
+
const apiClient = await util_1.getApiClientFromOptions(trainingSessionOptions, true);
|
|
17
18
|
if (!trainingSessionOptions.branchName) {
|
|
18
19
|
trainingSessionOptions.branchName = constants_1.DefaultBranchName;
|
|
19
20
|
}
|
|
20
21
|
if (trainingSessionOptions.branchName !== 'master') {
|
|
21
22
|
await branches_1.checkBranchNameAndAutoBranchMaybe(trainingSessionOptions.workspaceId, apiClient, trainingSessionOptions.branchName, trainingSessionOptions.autoBranch);
|
|
22
23
|
}
|
|
23
|
-
let environment;
|
|
24
24
|
if (trainingSessionOptions.environmentId) {
|
|
25
|
-
|
|
25
|
+
await apiClient.getEnvironment(trainingSessionOptions.environmentId);
|
|
26
26
|
}
|
|
27
|
-
let plan;
|
|
28
27
|
if (trainingSessionOptions.planId) {
|
|
29
|
-
|
|
28
|
+
await apiClient.getPlan(trainingSessionOptions.planId);
|
|
30
29
|
}
|
|
31
|
-
let deployment;
|
|
32
30
|
if (trainingSessionOptions.deploymentId) {
|
|
33
|
-
|
|
31
|
+
await apiClient.getDeploymentEntity(trainingSessionOptions.deploymentId);
|
|
34
32
|
}
|
|
35
|
-
let application;
|
|
36
33
|
if (trainingSessionOptions.applicationId) {
|
|
37
|
-
|
|
34
|
+
await apiClient.getApplication(trainingSessionOptions.applicationId);
|
|
38
35
|
}
|
|
39
|
-
|
|
40
|
-
if (trainingSessionOptions.autoLogin) {
|
|
41
|
-
autoLoginFlows = await apiClient.getFlows({
|
|
42
|
-
organization_id: trainingSessionOptions.workspaceId,
|
|
43
|
-
flow_type: 'login',
|
|
44
|
-
limit: 1,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
testsUtil_1.logTestInfoIfPresent(`Creating test: `, trainingSessionOptions.testName);
|
|
36
|
+
testsUtil_1.logTestInfoIfPresent(`Creating test in desktop app: `, trainingSessionOptions.testName);
|
|
48
37
|
testsUtil_1.logTestInfoIfPresent(`Add auto login flow: `, trainingSessionOptions.autoLogin);
|
|
49
38
|
testsUtil_1.logTestInfoIfPresent(`URL: `, trainingSessionOptions.url);
|
|
50
39
|
testsUtil_1.logTestInfoIfPresent(`Workspace: `, trainingSessionOptions.workspaceId);
|
|
@@ -55,26 +44,12 @@ async function trainNewTest(trainingSessionOptions) {
|
|
|
55
44
|
testsUtil_1.logTestInfoIfPresent(`Credentials ID: `, trainingSessionOptions.credentialsId);
|
|
56
45
|
testsUtil_1.logTestInfoIfPresent(`Datatable ID(s): `, (_a = trainingSessionOptions.dataTableIds) === null || _a === void 0 ? void 0 : _a.join(', '));
|
|
57
46
|
testsUtil_1.logTestInfoIfPresent(`Test description: `, trainingSessionOptions.testDescription);
|
|
58
|
-
|
|
59
|
-
const browserPreferencesDirectory = await testsUtil_1.prepareChromePreferencesDirectory(browserPreferences);
|
|
60
|
-
const runnerType = await apiClient.getRunnerTypeFromFeatureFlag(trainingSessionOptions.workspaceId);
|
|
61
|
-
const trainingBrowser = await testsUtil_1.createBrowserWithAuthedExtension((_b = trainingSessionOptions.authToken) !== null && _b !== void 0 ? _b : authConfig.accessToken, trainingSessionOptions.width, trainingSessionOptions.height, browserPreferencesDirectory, {
|
|
62
|
-
runnerType,
|
|
63
|
-
});
|
|
64
|
-
trainerBrowserUtil_1.addManualCloseEventWatch(trainingBrowser, trainingSessionActions_1.TrainingEventEmitter.sessionClosed);
|
|
65
|
-
trainerBrowserUtil_1.addClosedAllWindowsEventWatch(trainingBrowser, trainingSessionActions_1.TrainingEventEmitter.sessionClosed);
|
|
66
|
-
const backgroundPage = await testsUtil_1.getExtensionBackgroundPageWithCliTool(trainingBrowser);
|
|
67
|
-
await testsUtil_1.createTrainingSession(backgroundPage, trainingSessionOptions, environment, plan, deployment, application, autoLoginFlows ? autoLoginFlows[0] : undefined);
|
|
68
|
-
trainingSessionActions_1.TrainingEventEmitter.sessionStarted();
|
|
69
|
-
await testsUtil_1.cleanUpInitialPages(trainingBrowser);
|
|
70
|
-
testsUtil_1.logCtlCLine();
|
|
47
|
+
await openUtils_1.openUrlInDesktopApp(ElectronProtocolUrl.TRAIN_NEW_TEST, trainingSessionOptions);
|
|
71
48
|
}
|
|
72
49
|
exports.trainNewTest = trainNewTest;
|
|
73
50
|
async function editTest(trainingSessionOptions) {
|
|
74
51
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
75
|
-
|
|
76
|
-
const authConfig = await new authenticationProvider_1.AuthenticationProvider().getAuthConfigWithAutoRenew();
|
|
77
|
-
const apiClient = await util_2.getApiClientFromOptions(trainingSessionOptions, true);
|
|
52
|
+
const apiClient = await util_1.getApiClientFromOptions(trainingSessionOptions, true);
|
|
78
53
|
let testRunIdConfig = { testId: '', filterHttpRequests: false };
|
|
79
54
|
if (trainingSessionOptions.testRunId) {
|
|
80
55
|
testRunIdConfig = await testsUtil_1.pullDownTestRunConfig(trainingSessionOptions.testRunId, apiClient);
|
|
@@ -91,35 +66,35 @@ async function editTest(trainingSessionOptions) {
|
|
|
91
66
|
if (test.default) {
|
|
92
67
|
throw new Error('Editing of the mabl default supplied tests is not supported');
|
|
93
68
|
}
|
|
69
|
+
if (!((_g = test.flows) === null || _g === void 0 ? void 0 : _g.length)) {
|
|
70
|
+
throw new Error(util_2.TEST_INFO_NOT_FOUND);
|
|
71
|
+
}
|
|
94
72
|
if (branchName !== 'master') {
|
|
95
73
|
await branches_1.checkBranchNameAndAutoBranchMaybe(test.organization_id, apiClient, branchName, trainingSessionOptions.autoBranch);
|
|
96
74
|
}
|
|
97
75
|
const finalUrl = testsUtil_1.getFinalUrl(test, url);
|
|
98
|
-
const flowArray = await util_1.getJourneyFlowArray(test, apiClient, branchName);
|
|
99
|
-
let environment;
|
|
100
76
|
if (environmentId) {
|
|
101
|
-
|
|
77
|
+
await apiClient.getEnvironment(environmentId);
|
|
102
78
|
}
|
|
103
|
-
testsUtil_1.logTestInfoIfPresent(`Editing test: `, `${test.name} - ${test.invariant_id}`);
|
|
79
|
+
testsUtil_1.logTestInfoIfPresent(`Editing test in desktop app: `, `${test.name} - ${test.invariant_id}`);
|
|
104
80
|
testsUtil_1.logTestInfoIfPresent(`Test description: `, test.description);
|
|
105
81
|
testsUtil_1.logTestInfoIfPresent(`URL: `, finalUrl);
|
|
106
82
|
testsUtil_1.logTestInfoIfPresent(`Workspace: `, test.organization_id);
|
|
107
83
|
testsUtil_1.logTestInfoIfPresent(`Branch: `, branchName);
|
|
108
84
|
testsUtil_1.logTestInfoIfPresent(`Environment ID: `, environmentId);
|
|
109
85
|
testsUtil_1.logTestInfoIfPresent(`Credentials ID: `, credentialsId);
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
testsUtil_1.logCtlCLine();
|
|
86
|
+
const scriptConfig = {
|
|
87
|
+
applicationId: trainingSessionOptions.applicationId,
|
|
88
|
+
branchName,
|
|
89
|
+
credentialsId,
|
|
90
|
+
deploymentId: trainingSessionOptions.deploymentId,
|
|
91
|
+
environmentId,
|
|
92
|
+
testId,
|
|
93
|
+
testType: test.test_type,
|
|
94
|
+
workspaceId: test.organization_id,
|
|
95
|
+
planId: testRunIdConfig.fromPlanId,
|
|
96
|
+
url: finalUrl,
|
|
97
|
+
};
|
|
98
|
+
await openUtils_1.openUrlInDesktopApp(ElectronProtocolUrl.EDIT_TEST, scriptConfig);
|
|
124
99
|
}
|
|
125
100
|
exports.editTest = editTest;
|
package/env/defaultEnv.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SCRIPT_NAME = exports.OKTA_URL = exports.OKTA_CLIENT_ID = exports.LOCAL_TRAINER_PATH = exports.EXTENSION_ID = exports.ENV = exports.DEBUG_EVENT_EMITTER = exports.CONSOLE_LOGGING_LEVEL = exports.CONF_FILE_VERSION = exports.CONF_FILE_PROJECT_NAME = exports.BASE_APP_URL = exports.BASE_API_URL = void 0;
|
|
3
|
+
exports.ELECTRON_PROTOCOL = exports.SCRIPT_NAME = exports.OKTA_URL = exports.OKTA_CLIENT_ID = exports.LOCAL_TRAINER_PATH = exports.EXTENSION_ID = exports.ENV = exports.DEBUG_EVENT_EMITTER = exports.CONSOLE_LOGGING_LEVEL = exports.CONF_FILE_VERSION = exports.CONF_FILE_PROJECT_NAME = exports.BASE_APP_URL = exports.BASE_API_URL = void 0;
|
|
4
4
|
exports.BASE_API_URL = 'https://api.mabl.com';
|
|
5
5
|
exports.BASE_APP_URL = 'https://app.mabl.com';
|
|
6
6
|
exports.CONF_FILE_PROJECT_NAME = 'mabl-cli';
|
|
@@ -13,3 +13,4 @@ exports.LOCAL_TRAINER_PATH = '';
|
|
|
13
13
|
exports.OKTA_CLIENT_ID = '0oa1fte4dlVvEr5bb5d7';
|
|
14
14
|
exports.OKTA_URL = 'https://auth2.mabl.com';
|
|
15
15
|
exports.SCRIPT_NAME = 'mabl';
|
|
16
|
+
exports.ELECTRON_PROTOCOL = 'mabl-app';
|
package/env/dev.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SCRIPT_NAME = exports.OKTA_URL = exports.OKTA_CLIENT_ID = exports.LOCAL_TRAINER_PATH = exports.EXTENSION_ID = exports.ENV = exports.DEBUG_EVENT_EMITTER = exports.CONSOLE_LOGGING_LEVEL = exports.CONF_FILE_VERSION = exports.CONF_FILE_PROJECT_NAME = exports.BASE_APP_URL = exports.BASE_API_URL = void 0;
|
|
3
|
+
exports.ELECTRON_PROTOCOL = exports.SCRIPT_NAME = exports.OKTA_URL = exports.OKTA_CLIENT_ID = exports.LOCAL_TRAINER_PATH = exports.EXTENSION_ID = exports.ENV = exports.DEBUG_EVENT_EMITTER = exports.CONSOLE_LOGGING_LEVEL = exports.CONF_FILE_VERSION = exports.CONF_FILE_PROJECT_NAME = exports.BASE_APP_URL = exports.BASE_API_URL = void 0;
|
|
4
4
|
exports.BASE_API_URL = 'https://api-dev.mabl.com';
|
|
5
5
|
exports.BASE_APP_URL = 'https://app-dev.mabl.com';
|
|
6
6
|
exports.CONF_FILE_PROJECT_NAME = 'mabl-cli-dev';
|
|
@@ -13,3 +13,4 @@ exports.LOCAL_TRAINER_PATH = '';
|
|
|
13
13
|
exports.OKTA_CLIENT_ID = '0oamuehnyLZhBbKh91d6';
|
|
14
14
|
exports.OKTA_URL = 'https://auth2-dev.mabl.com';
|
|
15
15
|
exports.SCRIPT_NAME = 'mabl-dev';
|
|
16
|
+
exports.ELECTRON_PROTOCOL = 'mabl-app-dev';
|
package/env/env.js
CHANGED
|
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.setConfigFileProjectName = exports.setGlobalConfigEnv = exports.EnvOption = exports.SCRIPT_NAME = exports.OKTA_URL = exports.OKTA_CLIENT_ID = exports.LOCAL_TRAINER_PATH = exports.EXTENSION_ID = exports.ENV = exports.DEBUG_EVENT_EMITTER = exports.CONSOLE_LOGGING_LEVEL = exports.CONF_FILE_VERSION = exports.CONF_FILE_PROJECT_NAME = exports.BASE_APP_URL = exports.BASE_API_URL = void 0;
|
|
22
|
+
exports.setConfigFileProjectName = exports.setGlobalConfigEnv = exports.EnvOption = exports.ELECTRON_PROTOCOL = exports.SCRIPT_NAME = exports.OKTA_URL = exports.OKTA_CLIENT_ID = exports.LOCAL_TRAINER_PATH = exports.EXTENSION_ID = exports.ENV = exports.DEBUG_EVENT_EMITTER = exports.CONSOLE_LOGGING_LEVEL = exports.CONF_FILE_VERSION = exports.CONF_FILE_PROJECT_NAME = exports.BASE_APP_URL = exports.BASE_API_URL = void 0;
|
|
23
23
|
const localEnv = __importStar(require("./local"));
|
|
24
24
|
const devEnv = __importStar(require("./dev"));
|
|
25
25
|
const prodEnv = __importStar(require("./prod"));
|
|
@@ -36,6 +36,7 @@ exports.LOCAL_TRAINER_PATH = defaultEnv.LOCAL_TRAINER_PATH;
|
|
|
36
36
|
exports.OKTA_CLIENT_ID = defaultEnv.OKTA_CLIENT_ID;
|
|
37
37
|
exports.OKTA_URL = defaultEnv.OKTA_URL;
|
|
38
38
|
exports.SCRIPT_NAME = defaultEnv.SCRIPT_NAME;
|
|
39
|
+
exports.ELECTRON_PROTOCOL = defaultEnv.ELECTRON_PROTOCOL;
|
|
39
40
|
var EnvOption;
|
|
40
41
|
(function (EnvOption) {
|
|
41
42
|
EnvOption["dev"] = "dev";
|
|
@@ -60,6 +61,7 @@ function setGlobalConfigEnv(env) {
|
|
|
60
61
|
exports.OKTA_CLIENT_ID = envMap[env].OKTA_CLIENT_ID;
|
|
61
62
|
exports.OKTA_URL = envMap[env].OKTA_URL;
|
|
62
63
|
exports.SCRIPT_NAME = envMap[env].SCRIPT_NAME;
|
|
64
|
+
exports.ELECTRON_PROTOCOL = envMap[env].ELECTRON_PROTOCOL;
|
|
63
65
|
}
|
|
64
66
|
exports.setGlobalConfigEnv = setGlobalConfigEnv;
|
|
65
67
|
function setConfigFileProjectName(projectName) {
|
package/env/local.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SCRIPT_NAME = exports.OKTA_URL = exports.OKTA_CLIENT_ID = exports.LOCAL_TRAINER_PATH = exports.EXTENSION_ID = exports.ENV = exports.DEBUG_EVENT_EMITTER = exports.CONSOLE_LOGGING_LEVEL = exports.CONF_FILE_VERSION = exports.CONF_FILE_PROJECT_NAME = exports.BASE_APP_URL = exports.BASE_API_URL = void 0;
|
|
3
|
+
exports.ELECTRON_PROTOCOL = exports.SCRIPT_NAME = exports.OKTA_URL = exports.OKTA_CLIENT_ID = exports.LOCAL_TRAINER_PATH = exports.EXTENSION_ID = exports.ENV = exports.DEBUG_EVENT_EMITTER = exports.CONSOLE_LOGGING_LEVEL = exports.CONF_FILE_VERSION = exports.CONF_FILE_PROJECT_NAME = exports.BASE_APP_URL = exports.BASE_API_URL = void 0;
|
|
4
4
|
exports.BASE_API_URL = 'http://localhost:8080';
|
|
5
5
|
exports.BASE_APP_URL = 'https://app-local.mabl.com:3000';
|
|
6
6
|
exports.CONF_FILE_PROJECT_NAME = 'mabl-cli-local';
|
|
@@ -13,3 +13,4 @@ exports.LOCAL_TRAINER_PATH = process.env.LOCAL_TRAINER_PATH;
|
|
|
13
13
|
exports.OKTA_CLIENT_ID = '0oamuehnyLZhBbKh91d6';
|
|
14
14
|
exports.OKTA_URL = 'https://auth2-dev.mabl.com';
|
|
15
15
|
exports.SCRIPT_NAME = 'mabl-local';
|
|
16
|
+
exports.ELECTRON_PROTOCOL = 'mabl-app-local';
|
package/env/prod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SCRIPT_NAME = exports.OKTA_URL = exports.OKTA_CLIENT_ID = exports.LOCAL_TRAINER_PATH = exports.EXTENSION_ID = exports.ENV = exports.DEBUG_EVENT_EMITTER = exports.CONSOLE_LOGGING_LEVEL = exports.CONF_FILE_VERSION = exports.CONF_FILE_PROJECT_NAME = exports.BASE_APP_URL = exports.BASE_API_URL = void 0;
|
|
3
|
+
exports.ELECTRON_PROTOCOL = exports.SCRIPT_NAME = exports.OKTA_URL = exports.OKTA_CLIENT_ID = exports.LOCAL_TRAINER_PATH = exports.EXTENSION_ID = exports.ENV = exports.DEBUG_EVENT_EMITTER = exports.CONSOLE_LOGGING_LEVEL = exports.CONF_FILE_VERSION = exports.CONF_FILE_PROJECT_NAME = exports.BASE_APP_URL = exports.BASE_API_URL = void 0;
|
|
4
4
|
exports.BASE_API_URL = 'https://api.mabl.com';
|
|
5
5
|
exports.BASE_APP_URL = 'https://app.mabl.com';
|
|
6
6
|
exports.CONF_FILE_PROJECT_NAME = 'mabl-cli';
|
|
@@ -13,3 +13,4 @@ exports.LOCAL_TRAINER_PATH = '';
|
|
|
13
13
|
exports.OKTA_CLIENT_ID = '0oa1fte4dlVvEr5bb5d7';
|
|
14
14
|
exports.OKTA_URL = 'https://auth2.mabl.com';
|
|
15
15
|
exports.SCRIPT_NAME = 'mabl';
|
|
16
|
+
exports.ELECTRON_PROTOCOL = 'mabl-app';
|