@mablhq/mabl-cli 2.44.1 → 2.45.2

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.
@@ -579,11 +579,12 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
579
579
  throw toApiError(`Failed to update mailbox ${mailboxId} with error`, error);
580
580
  }
581
581
  }
582
- async evaluateAiAssertion(workspaceId, testRunId, screenshot, userPrompt, metaPrompt, test) {
582
+ async evaluateAiAssertion(workspaceId, testRunId, screenshot, userPrompt, metaPrompt, criteria, test) {
583
583
  try {
584
584
  const body = {
585
585
  test_run_id: testRunId,
586
586
  assertion_prompt: userPrompt,
587
+ assertion_criteria: criteria,
587
588
  screenshot: Buffer.from(screenshot).toString('base64'),
588
589
  test_invariant_id: test === null || test === void 0 ? void 0 : test.invariant_id,
589
590
  test_type: test === null || test === void 0 ? void 0 : test.test_type,
@@ -139,10 +139,6 @@ class ChromiumBrowserEngine {
139
139
  plugins: {
140
140
  always_open_pdf_externally: true,
141
141
  },
142
- safebrowsing: {
143
- enabled: false,
144
- enhanced: false,
145
- },
146
142
  };
147
143
  if (windowPlacement) {
148
144
  preferences.browser = {
@@ -469,6 +469,10 @@ async function extractTestRunConfig(executionMessage, apiClient) {
469
469
  platformName: mobileMessage.mobile_device.platform,
470
470
  mobileAppFileId: mobileMessage.mobile_app_file_id,
471
471
  };
472
+ if (mobileMessage.mobile_device.platform === mablApi_1.MobilePlatformEnum.Ios) {
473
+ config.mobileConfig.platformVersion =
474
+ mobileMessage.mobile_device.os_version;
475
+ }
472
476
  }
473
477
  return config;
474
478
  }
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createEmptyRequestEventArray = exports.splitLines = exports.PRE_REQUEST_LISTEN = exports.convertMablAssertionsToExecArray = exports.convertMablVariableAssignmentsToExecArray = exports.createMablGeneratedScripts = exports.insertMablAssertionScripts = exports.toPostmanScript = exports.replaceVariables = exports.getActualValue = exports.readBody = exports.getResponseContentType = exports.valueToUnquotedString = exports.assertionTypeSupportsCaseSensitivity = exports.assertionTargetSupportsCaseSensitivity = exports.humanizeAssertion = exports.getAssertionTargetArgument = exports.assertionHasTest = exports.isValidMablAssertion = exports.normalizeExpectedValue = exports.assertionRequiresValue = exports.filterValidMablAssertions = exports.filterValidMablVariableAssignments = exports.isValidMablVariableAssignment = exports.removeMablGeneratedScripts = exports.createEmptyRequestEvent = exports.findFirstMatchingEvent = exports.restoreCustomRequestFields = exports.deduplicateApiTestExecutionResults = exports.createEmptyVariable = exports.createEmptyAssertion = exports.humanizeAssertionType = exports.getAssertionTypesForTarget = exports.caseInsensitiveEquals = exports.compareStringsCaseInsensitive = exports.ASSERT_TYPES = exports.ASSERT_TARGETS = exports.COLLECTION_WITH_FOLDERS_ERROR = exports.HMAC_SHA1_SIGNATURE = exports.DEFAULT_ADD_OAUTH1_TO_HEADER_VALUE = exports.DEFAULT_OAUTH1_VERSION = exports.OAUTH1_AUTH = exports.NO_AUTH = exports.BEARER_TOKEN_AUTH = exports.BASIC_AUTH = exports.API_KEY_AUTH = exports.INHERIT_AUTH_FROM_PARENT_VALUE = exports.MABL_GENERATED_COMMENT = exports.MABL_GENERATED_ASSERTION_TOKEN = exports.TEST_LISTEN = void 0;
7
- exports.uuid = exports.createCommentForApiTestSnippet = exports.convertMablSnippetsToExecArray = exports.createPostmanScript = exports.processPostmanItem = exports.replaceRawScriptWithExecArray = exports.removeInvalidHeaders = exports.processItemAuth = exports.mablAuthToPostman = exports.formatContent = exports.getRequestMode = exports.getFormDataArray = exports.isText = exports.isXML = exports.isJson = exports.isSupportedAuthType = exports.isItemDefinition = exports.isCollectionDefinition = exports.isItemGroupDefinition = exports.isFolder = exports.validateCollectionFeaturesForApiTestEditor = exports.generateRawScriptField = exports.processPostmanItems = exports.createEmptyRequest = void 0;
7
+ exports.uuid = exports.createCommentForApiTestSnippet = exports.convertMablSnippetsToExecArray = exports.createPostmanScript = exports.insertMablScriptsIntoCollection = exports.processPostmanItem = exports.replaceRawScriptWithExecArray = exports.removeInvalidHeaders = exports.processItemAuth = exports.mablAuthToPostman = exports.formatContent = exports.getRequestMode = exports.getFormDataArray = exports.isText = exports.isXML = exports.isJson = exports.isSupportedAuthType = exports.isItemDefinition = exports.isCollectionDefinition = exports.isItemGroupDefinition = exports.isFolder = exports.validateCollectionFeaturesForApiTestEditor = exports.generateRawScriptField = exports.processPostmanItems = exports.createEmptyRequest = void 0;
8
8
  const newman_types_1 = require("./newman-types");
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
10
  const uuid_1 = require("uuid");
@@ -960,17 +960,36 @@ function replaceRawScriptWithExecArray(eventsContainer, processingForRepair) {
960
960
  });
961
961
  }
962
962
  exports.replaceRawScriptWithExecArray = replaceRawScriptWithExecArray;
963
- function processPostmanItem(item, processingForRepair) {
963
+ function processPostmanItem(item) {
964
964
  if (!item.id) {
965
965
  item.id = (0, uuid_1.v4)();
966
966
  }
967
967
  processMablProtocolProfileBehavior(item);
968
968
  processItemAuth(item);
969
969
  removeInvalidHeaders(item);
970
- replaceRawScriptWithExecArray(item, processingForRepair);
971
- insertMablAssertionScripts(item);
972
970
  }
973
971
  exports.processPostmanItem = processPostmanItem;
972
+ function insertMablScriptsIntoCollection(collection, getSnippet) {
973
+ var _a, _b;
974
+ (_a = collection.event) === null || _a === void 0 ? void 0 : _a.forEach((event) => insertMablScriptsIntoEvent(event, getSnippet));
975
+ (_b = collection.item) === null || _b === void 0 ? void 0 : _b.forEach((item) => {
976
+ var _a;
977
+ return (_a = item.event) === null || _a === void 0 ? void 0 : _a.forEach((event) => insertMablScriptsIntoEvent(event, getSnippet));
978
+ });
979
+ }
980
+ exports.insertMablScriptsIntoCollection = insertMablScriptsIntoCollection;
981
+ function insertMablScriptsIntoEvent(event, getSnippet) {
982
+ var _a;
983
+ removeMablGeneratedScripts(event);
984
+ const mablScripts = createPostmanScript(convertMablSnippetsToExecArray(event, getSnippet), createMablGeneratedScripts(event));
985
+ if (!((_a = event.mablSnippets) === null || _a === void 0 ? void 0 : _a.length)) {
986
+ mablScripts.exec = [...event.script.exec, ...mablScripts.exec];
987
+ }
988
+ event.script = mablScripts;
989
+ delete event.mablAssertions;
990
+ delete event.mablSnippets;
991
+ delete event.mablVariables;
992
+ }
974
993
  function createPostmanScript(...scripts) {
975
994
  return {
976
995
  id: (0, exports.uuid)(),