@mablhq/mabl-cli 1.43.1 → 1.43.10
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/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +4 -3
- package/commands/tests/testsUtil.js +1 -35
- package/core/trainer/trainingSessions.js +3 -2
- package/execution/index.js +1 -1
- package/package.json +4 -3
- package/providers/exportRequestProvider.js +19 -3
- package/util/clickUtil.js +53 -0
- package/util/javaScriptStepMigration.js +114 -0
|
@@ -324,10 +324,11 @@ class PlaywrightPage extends events_1.default {
|
|
|
324
324
|
title() {
|
|
325
325
|
return this.page.title();
|
|
326
326
|
}
|
|
327
|
-
async
|
|
327
|
+
async waitForLoadState(options) {
|
|
328
328
|
try {
|
|
329
|
-
|
|
330
|
-
|
|
329
|
+
await this.page.waitForLoadState(options === null || options === void 0 ? void 0 : options.waitUntil, {
|
|
330
|
+
timeout: options.timeout,
|
|
331
|
+
});
|
|
331
332
|
}
|
|
332
333
|
catch (e) {
|
|
333
334
|
if (e instanceof playwright.errors.TimeoutError) {
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.toBasicHttpAuthenticationCredentials = exports.generateChromiumPreferencesFile = exports.logTestInfoIfPresent = exports.milliSecondsToSeconds = exports.calculateTotalTimeSeconds = exports.extractTestRunConfig = exports.pullDownTestRunConfig = exports.validateRunCommandWithLabels = exports.validateRunEditCommand = exports.cleanupTestResources = exports.sleep = exports.editTheTest = exports.runTheTest = exports.prepareTrainerForSplitPlayback = exports.
|
|
29
|
+
exports.toBasicHttpAuthenticationCredentials = exports.generateChromiumPreferencesFile = exports.logTestInfoIfPresent = exports.milliSecondsToSeconds = exports.calculateTotalTimeSeconds = exports.extractTestRunConfig = exports.pullDownTestRunConfig = exports.validateRunCommandWithLabels = exports.validateRunEditCommand = exports.cleanupTestResources = exports.sleep = exports.editTheTest = exports.runTheTest = exports.prepareTrainerForSplitPlayback = exports.cleanUpInitialPages = exports.getExtensionBackgroundPageWithCliTool = exports.createBrowserForExecutionEngine = exports.addExecutionEngineLaunchArgs = exports.createBrowser = exports.prepareChromePreferencesDirectory = exports.findChrome = exports.searchForChrome = exports.getFinalUrl = exports.getTempChromePrefDirectory = void 0;
|
|
30
30
|
const async_retry_1 = __importDefault(require("async-retry"));
|
|
31
31
|
const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
32
32
|
const fs = __importStar(require("fs-extra"));
|
|
@@ -308,40 +308,6 @@ async function exposeMessagingFunctionToTrainer(backgroundPage, browser) {
|
|
|
308
308
|
.exposeFunction('postMessageToCli', (message) => handleExtensionMessage(message, browser))
|
|
309
309
|
.catch((error) => messaging_1.mablEventEmitter.log('Error on the handle' + error));
|
|
310
310
|
}
|
|
311
|
-
async function createTrainingSession(backgroundPage, trainingSessionOptions, environment, plan, deployment, application, autoLoginFlow) {
|
|
312
|
-
var _a;
|
|
313
|
-
const journey = {
|
|
314
|
-
autoLogin: trainingSessionOptions.autoLogin,
|
|
315
|
-
datatables: trainingSessionOptions.dataTableIds,
|
|
316
|
-
flowIndexToTrain: 0,
|
|
317
|
-
labels: (_a = trainingSessionOptions.labels) === null || _a === void 0 ? void 0 : _a.map((label) => ({ name: label })),
|
|
318
|
-
description: trainingSessionOptions.testDescription,
|
|
319
|
-
name: trainingSessionOptions.testName,
|
|
320
|
-
flows: autoLoginFlow ? [autoLoginFlow.id] : [],
|
|
321
|
-
journeyFlows: autoLoginFlow ? [autoLoginFlow] : [],
|
|
322
|
-
};
|
|
323
|
-
const newTestPayload = JSON.stringify({
|
|
324
|
-
url: trainingSessionOptions.url,
|
|
325
|
-
testName: trainingSessionOptions.testName,
|
|
326
|
-
testDescription: trainingSessionOptions.testDescription,
|
|
327
|
-
workspaceId: trainingSessionOptions.workspaceId,
|
|
328
|
-
branchName: trainingSessionOptions.branchName,
|
|
329
|
-
credentialsId: trainingSessionOptions.credentialsId,
|
|
330
|
-
journey,
|
|
331
|
-
environment,
|
|
332
|
-
plan,
|
|
333
|
-
deployment,
|
|
334
|
-
application,
|
|
335
|
-
});
|
|
336
|
-
const script = `window.mablCli.createTest(${newTestPayload});`;
|
|
337
|
-
try {
|
|
338
|
-
await backgroundPage.evaluate(script);
|
|
339
|
-
}
|
|
340
|
-
catch (error) {
|
|
341
|
-
messaging_1.mablEventEmitter.log(chalk.red(error));
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
exports.createTrainingSession = createTrainingSession;
|
|
345
311
|
function createRunLocalTestObject(test, flows, branchName, url, credentialsId, environment) {
|
|
346
312
|
return {
|
|
347
313
|
test,
|
|
@@ -20,8 +20,8 @@ async function trainNewTest(trainingSessionOptions) {
|
|
|
20
20
|
var _a;
|
|
21
21
|
const apiClient = await (0, util_1.getApiClientFromOptions)(trainingSessionOptions, true);
|
|
22
22
|
const branchName = (_a = trainingSessionOptions.branchName) !== null && _a !== void 0 ? _a : constants_1.DefaultBranchName;
|
|
23
|
-
const { authToken, autoBranch, ...passThroughFields } = trainingSessionOptions;
|
|
24
|
-
const { applicationId, autoLogin, credentialsId,
|
|
23
|
+
const { authToken, autoBranch, dataTableIds, ...passThroughFields } = trainingSessionOptions;
|
|
24
|
+
const { applicationId, autoLogin, credentialsId, environmentId, height, planId, testDescription, testName, url, width, workspaceId, } = passThroughFields;
|
|
25
25
|
if (branchName !== 'master') {
|
|
26
26
|
await (0, branches_1.checkBranchNameAndAutoBranchMaybe)(workspaceId, apiClient, branchName, autoBranch);
|
|
27
27
|
}
|
|
@@ -51,6 +51,7 @@ async function trainNewTest(trainingSessionOptions) {
|
|
|
51
51
|
...passThroughFields,
|
|
52
52
|
accountId: account.id,
|
|
53
53
|
branchName,
|
|
54
|
+
dataTables: dataTableIds,
|
|
54
55
|
height: height !== null && height !== void 0 ? height : exports.DEFAULT_HEIGHT,
|
|
55
56
|
sender: exports.SENDER,
|
|
56
57
|
width: width !== null && width !== void 0 ? width : exports.DEFAULT_WIDTH,
|