@mablhq/mabl-cli 2.8.25 → 2.12.7

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.
Files changed (37) hide show
  1. package/api/mablApiClient.js +24 -0
  2. package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +2 -2
  3. package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +0 -3
  4. package/commands/environments/environments_cmds/create.js +3 -2
  5. package/commands/environments/environments_cmds/update.js +1 -1
  6. package/commands/tests/testsUtil.js +2 -0
  7. package/core/execution/newman-types.js +2 -1
  8. package/execution/index.js +9 -9
  9. package/execution/index.js.LICENSE.txt +60 -0
  10. package/execution/runAppiumServer.js +16 -4
  11. package/index.d.ts +2 -0
  12. package/mablApi/index.js +1 -1
  13. package/mablscript/importer.js +6 -0
  14. package/mablscript/mobile/steps/EnterTextStep.js +3 -0
  15. package/mablscript/mobile/steps/InstallAppStep.js +22 -0
  16. package/mablscript/mobile/steps/PrepareSessionStep.js +19 -0
  17. package/mablscript/mobile/steps/ScrollStep.js +52 -8
  18. package/mablscript/mobile/steps/UninstallAppStep.js +22 -0
  19. package/mablscript/mobile/steps/stepUtil.js +51 -12
  20. package/mablscript/mobile/tests/TestMobileFindDescriptors.js +72 -1
  21. package/mablscript/mobile/tests/steps/GeneralHumanization.mobiletest.js +144 -7
  22. package/mablscript/mobile/tests/steps/InstallAppStep.mobiletest.js +20 -0
  23. package/mablscript/mobile/tests/steps/ScrollStep.mobiletest.js +289 -78
  24. package/mablscript/mobile/tests/steps/UninstallAppStep.mobiletest.js +20 -0
  25. package/mablscript/steps/AwaitTabStep.js +36 -8
  26. package/mablscript/types/mobile/InstallAppStepDescriptor.js +2 -0
  27. package/mablscript/types/mobile/PrepareSessionStepDescriptor.js +2 -0
  28. package/mablscript/types/mobile/ScrollStepDescriptor.js +14 -0
  29. package/mablscript/types/mobile/UninstallAppStepDescriptor.js +2 -0
  30. package/mablscriptFind/index.js +1 -1
  31. package/package.json +2 -6
  32. package/resources/mablFind.js +1 -1
  33. package/resources/pdf-viewer/embeddedPdfDetection.js +22 -6
  34. package/socketTunnel/index.js +2 -0
  35. package/socketTunnel/index.js.LICENSE.txt +66 -0
  36. package/upload/index.js +1 -1
  37. package/util/downloadUtil.js +1 -1
@@ -926,6 +926,30 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
926
926
  throw toApiError(`Failed to delete mobile app file ${id}`, error);
927
927
  }
928
928
  }
929
+ async createMobileTrainingSession(prototype) {
930
+ try {
931
+ return await this.makePostRequest(`${this.baseApiUrl}/mobile/training/sessions`, prototype);
932
+ }
933
+ catch (error) {
934
+ throw toApiError(`Failed to create mobile training session`, error);
935
+ }
936
+ }
937
+ async getMobileTrainingSession(id) {
938
+ try {
939
+ return await this.makeGetRequest(`${this.baseApiUrl}/mobile/training/session/${id}`);
940
+ }
941
+ catch (error) {
942
+ throw toApiError(`Failed to get mobile training session ${id}`, error);
943
+ }
944
+ }
945
+ async terminateMobileTrainingSession(id, reason) {
946
+ try {
947
+ return await this.makePostRequest(`${this.baseApiUrl}/mobile/training/session/${id}/terminate`, { termination_reason: reason });
948
+ }
949
+ catch (error) {
950
+ throw toApiError(`Failed to terminate mobile training session ${id}`, error);
951
+ }
952
+ }
929
953
  }
930
954
  exports.MablApiClient = MablApiClient;
931
955
  function sortTemporallyAscending(entities) {
@@ -181,8 +181,8 @@ class PlaywrightBrowser extends events_1.default {
181
181
  }
182
182
  async makeApiRequest(url, options) {
183
183
  const { discardRequestBody, method, maxRedirects, runInNewContext, timeout } = options !== null && options !== void 0 ? options : {};
184
+ const requestContext = await this.createRequestContext(runInNewContext);
184
185
  try {
185
- const requestContext = await this.createRequestContext(runInNewContext);
186
186
  const response = await requestContext.fetch(url, {
187
187
  method,
188
188
  ignoreHTTPSErrors: true,
@@ -198,7 +198,7 @@ class PlaywrightBrowser extends events_1.default {
198
198
  finally {
199
199
  if (discardRequestBody) {
200
200
  try {
201
- await this.defaultContext.request.dispose();
201
+ await requestContext.dispose();
202
202
  }
203
203
  catch (error) {
204
204
  loggingProvider_1.logger.warn(`Error caught while attempting to dispose of API requests stored in memory: ${error === null || error === void 0 ? void 0 : error.message}`, error);
@@ -289,9 +289,6 @@ class PlaywrightPage extends events_1.default {
289
289
  return item;
290
290
  }));
291
291
  }
292
- setRequestInterception(_value) {
293
- return Promise.resolve();
294
- }
295
292
  async setViewport(viewport) {
296
293
  try {
297
294
  this.browser.maybeSetDefaultViewportSize(viewport);
@@ -16,7 +16,7 @@ const environmentsValidation_1 = require("../../../core/entityValidation/environ
16
16
  exports.command = 'create';
17
17
  exports.describe = 'Create a new mabl environment';
18
18
  exports.builder = (yargs) => {
19
- addUpdateEnvCommands((0, add_1.addEnvironmentUrlOptions)(yargs))
19
+ addUpdateEnvCommands((0, add_1.addEnvironmentUrlOptions)(yargs), true)
20
20
  .option(constants_1.CommandArgWorkspaceId, {
21
21
  alias: constants_1.CommandArgAliases.WorkspaceId,
22
22
  describe: 'Workspace containing to create environment in',
@@ -38,10 +38,11 @@ exports.builder = (yargs) => {
38
38
  });
39
39
  };
40
40
  exports.handler = (0, util_1.failWrapper)(createEnvironment);
41
- function addUpdateEnvCommands(argv) {
41
+ function addUpdateEnvCommands(argv, isCreate) {
42
42
  return argv
43
43
  .option(constants_1.CommandArgName, {
44
44
  alias: constants_1.CommandArgAliases.Name,
45
+ demandOption: isCreate,
45
46
  describe: 'Name of the environment',
46
47
  nargs: 1,
47
48
  type: 'string',
@@ -12,7 +12,7 @@ const create_1 = require("./create");
12
12
  exports.command = 'update <id>';
13
13
  exports.describe = 'Update a mabl environment';
14
14
  exports.builder = (yargs) => {
15
- (0, create_1.addUpdateEnvCommands)(yargs).positional(constants_1.CommandArgId, {
15
+ (0, create_1.addUpdateEnvCommands)(yargs, false).positional(constants_1.CommandArgId, {
16
16
  describe: 'ID of environment to update',
17
17
  type: 'string',
18
18
  nargs: 1,
@@ -468,6 +468,8 @@ async function extractTestRunConfig(executionMessage, apiClient) {
468
468
  if (executionMessage.test_type === mablApi_1.TestTypeEnum.Mobile) {
469
469
  const mobileMessage = executionMessage;
470
470
  config.mobileConfig = {
471
+ ...config.mobileConfig,
472
+ deviceName: mobileMessage.mobile_device.device_name,
471
473
  platformName: mobileMessage.mobile_device.platform,
472
474
  mobileAppFileId: mobileMessage.mobile_app_file_id,
473
475
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BodyMode = exports.MablSupportedPostmanAuthTypes = exports.AssertionType = exports.AssertionTarget = void 0;
3
+ exports.BodyMode = exports.MablSupportedPostmanAuthTypes = exports.SUPPORTED_COLLECTION_SCHEMA = exports.AssertionType = exports.AssertionTarget = void 0;
4
4
  var AssertionTarget;
5
5
  (function (AssertionTarget) {
6
6
  AssertionTarget["Header"] = "Header";
@@ -17,6 +17,7 @@ var AssertionType;
17
17
  AssertionType["NotPresent"] = "NotPresent";
18
18
  AssertionType["Present"] = "Present";
19
19
  })(AssertionType = exports.AssertionType || (exports.AssertionType = {}));
20
+ exports.SUPPORTED_COLLECTION_SCHEMA = 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json';
20
21
  exports.MablSupportedPostmanAuthTypes = [
21
22
  'apikey',
22
23
  'basic',