@mablhq/mabl-cli 2.51.1 → 2.51.4
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/featureSet.js +2 -2
- package/browserLauncher/index.js +8 -0
- package/browserLauncher/index.js.LICENSE.txt +28 -0
- package/commands/tests/testsUtil.js +1 -1
- package/commands/tests/tests_cmds/import_cmds/import_playwright.js +7 -1
- package/core/execution/ApiTestUtils.js +81 -1
- package/execution/index.js +1 -1
- package/package.json +1 -1
- package/browserLauncher/browser.js +0 -2
- package/browserLauncher/browserEvent.js +0 -11
- package/browserLauncher/browserLauncher.js +0 -17
- package/browserLauncher/browserLauncherEventEmitter.js +0 -2
- package/browserLauncher/browserLauncherFactory.js +0 -30
- package/browserLauncher/elementHandle.js +0 -30
- package/browserLauncher/errors.js +0 -26
- package/browserLauncher/frame.js +0 -17
- package/browserLauncher/frameBase.js +0 -10
- package/browserLauncher/httpRequest.js +0 -2
- package/browserLauncher/httpResponse.js +0 -2
- package/browserLauncher/jsHandle.js +0 -2
- package/browserLauncher/page.js +0 -2
- package/browserLauncher/pageEvent.js +0 -17
- package/browserLauncher/playwrightBrowserLauncher/browserDelegate.js +0 -2
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumBrowserDelegate.js +0 -61
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumElementHandleDelegate.js +0 -129
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumFrameDelegate.js +0 -24
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumPageDelegate.js +0 -145
- package/browserLauncher/playwrightBrowserLauncher/elementHandleDelegate.js +0 -2
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxBrowserDelegate.js +0 -50
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxElementHandleDelegate.js +0 -11
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxFrameDelegate.js +0 -26
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxPageDelegate.js +0 -15
- package/browserLauncher/playwrightBrowserLauncher/frameDelegate.js +0 -2
- package/browserLauncher/playwrightBrowserLauncher/internals.js +0 -2
- package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractBrowserDelegate.js +0 -15
- package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractElementHandleDelegate.js +0 -73
- package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractFrameDelegate.js +0 -13
- package/browserLauncher/playwrightBrowserLauncher/nonChromium/nonChromiumAbstractPageDelegate.js +0 -81
- package/browserLauncher/playwrightBrowserLauncher/pageDelegate.js +0 -2
- package/browserLauncher/playwrightBrowserLauncher/playwrightApiResponse.js +0 -18
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +0 -259
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +0 -97
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +0 -319
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +0 -265
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +0 -76
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpResponse.js +0 -26
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +0 -377
- package/browserLauncher/playwrightBrowserLauncher/simplePlaywrightLogger.js +0 -36
- package/browserLauncher/playwrightBrowserLauncher/webkit/webkitBrowserDelegate.js +0 -50
- package/browserLauncher/playwrightBrowserLauncher/webkit/webkitElementHandleDelegate.js +0 -16
- package/browserLauncher/playwrightBrowserLauncher/webkit/webkitFrameDelegate.js +0 -19
- package/browserLauncher/playwrightBrowserLauncher/webkit/webkitPageDelegate.js +0 -15
- package/browserLauncher/playwrightBrowserLauncher/wrappers.js +0 -25
- package/browserLauncher/types.js +0 -28
- package/browserLauncher/utils.js +0 -9
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Tmp
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
|
5
|
+
*
|
|
6
|
+
* MIT Licensed
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*!
|
|
10
|
+
* mime-db
|
|
11
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
12
|
+
* MIT Licensed
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*!
|
|
16
|
+
* mime-types
|
|
17
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
18
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
19
|
+
* MIT Licensed
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
23
|
+
|
|
24
|
+
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
|
|
25
|
+
|
|
26
|
+
//! moment.js
|
|
27
|
+
|
|
28
|
+
//! moment.js locale configuration
|
|
@@ -31,7 +31,7 @@ const cli_table3_1 = __importDefault(require("cli-table3"));
|
|
|
31
31
|
const fs = __importStar(require("fs"));
|
|
32
32
|
const os = __importStar(require("os"));
|
|
33
33
|
const path = __importStar(require("path"));
|
|
34
|
-
const browserLauncher_1 = require("../../browserLauncher
|
|
34
|
+
const browserLauncher_1 = require("../../browserLauncher");
|
|
35
35
|
const trainingSessionActions_1 = require("../../core/messaging/actions/trainingSessionActions");
|
|
36
36
|
const logLineMessaging_1 = require("../../core/messaging/logLineMessaging");
|
|
37
37
|
const messaging_1 = require("../../core/messaging/messaging");
|
|
@@ -366,6 +366,9 @@ async function getProjectInfo(args) {
|
|
|
366
366
|
...process.env,
|
|
367
367
|
},
|
|
368
368
|
};
|
|
369
|
+
if (process.platform === 'win32') {
|
|
370
|
+
options.shell = true;
|
|
371
|
+
}
|
|
369
372
|
const processClosedPromise = new RichPromise_1.default();
|
|
370
373
|
const playwrightProcess = spawn('npx', commandArgs, options);
|
|
371
374
|
playwrightProcess.stdout.on('data', (data) => {
|
|
@@ -411,8 +414,11 @@ async function runPlaywrightProject(args, tracesPath, cwd) {
|
|
|
411
414
|
...process.env,
|
|
412
415
|
},
|
|
413
416
|
};
|
|
417
|
+
if (process.platform === 'win32') {
|
|
418
|
+
options.shell = true;
|
|
419
|
+
}
|
|
414
420
|
loggingProvider_1.logger.info('Checking playwright project...');
|
|
415
|
-
const playwrightProjectFile = path_1.default.join(options.cwd, 'playwright.config.ts');
|
|
421
|
+
const playwrightProjectFile = path_1.default.join(options.cwd.toString(), 'playwright.config.ts');
|
|
416
422
|
if (!fs_1.default.existsSync(playwrightProjectFile)) {
|
|
417
423
|
throw new Error('No playwright project found. Please ensure you are in the root directory of a playwright project.');
|
|
418
424
|
}
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
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.normalizeRegExpExpectedValue = exports.normalizeExpectedValue = exports.normalizeAssertionValue = 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.insertTestConfigurationIntoFlow = 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 = exports.createEmptyRequestEventArray = exports.splitLines = void 0;
|
|
7
|
+
exports.uuid = exports.postmanEventToExecutableSnippets = exports.postmanAuthToApiTestAuth = exports.getValueFromAuthVariables = exports.insertTestConfigurationIntoFlow = 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 = exports.createEmptyRequestEventArray = exports.splitLines = 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");
|
|
@@ -1192,5 +1192,85 @@ function executableSnippetToApiTestSnippet(executableSnippet) {
|
|
|
1192
1192
|
reusable: false,
|
|
1193
1193
|
};
|
|
1194
1194
|
}
|
|
1195
|
+
function getValueFromAuthVariables(authVariables, variableName) {
|
|
1196
|
+
var _a;
|
|
1197
|
+
return (_a = authVariables === null || authVariables === void 0 ? void 0 : authVariables.find((variable) => variable.key === variableName)) === null || _a === void 0 ? void 0 : _a.value;
|
|
1198
|
+
}
|
|
1199
|
+
exports.getValueFromAuthVariables = getValueFromAuthVariables;
|
|
1200
|
+
function postmanAuthToApiTestAuth(auth) {
|
|
1201
|
+
const { type: authType } = auth || {};
|
|
1202
|
+
if (!authType || authType === 'noauth') {
|
|
1203
|
+
return undefined;
|
|
1204
|
+
}
|
|
1205
|
+
const apiTestAuth = {
|
|
1206
|
+
type: authType,
|
|
1207
|
+
};
|
|
1208
|
+
const getValueFromVariablesForAuthType = (variableName) => getValueFromAuthVariables(auth[authType], variableName);
|
|
1209
|
+
switch (authType) {
|
|
1210
|
+
case 'apikey':
|
|
1211
|
+
apiTestAuth.api_key = {
|
|
1212
|
+
location: getValueFromVariablesForAuthType('in'),
|
|
1213
|
+
key: getValueFromVariablesForAuthType('key'),
|
|
1214
|
+
value: getValueFromVariablesForAuthType('value'),
|
|
1215
|
+
};
|
|
1216
|
+
break;
|
|
1217
|
+
case 'basic':
|
|
1218
|
+
apiTestAuth.basic = {
|
|
1219
|
+
username: getValueFromVariablesForAuthType('username'),
|
|
1220
|
+
password: getValueFromVariablesForAuthType('password'),
|
|
1221
|
+
};
|
|
1222
|
+
break;
|
|
1223
|
+
case 'bearer':
|
|
1224
|
+
apiTestAuth.bearer = {
|
|
1225
|
+
token: getValueFromVariablesForAuthType('token'),
|
|
1226
|
+
};
|
|
1227
|
+
break;
|
|
1228
|
+
case 'oauth1':
|
|
1229
|
+
apiTestAuth.oauth1 = {
|
|
1230
|
+
consumer_key: getValueFromVariablesForAuthType('consumerKey'),
|
|
1231
|
+
consumer_secret: getValueFromVariablesForAuthType('consumerSecret'),
|
|
1232
|
+
token: getValueFromVariablesForAuthType('token'),
|
|
1233
|
+
token_secret: getValueFromVariablesForAuthType('tokenSecret'),
|
|
1234
|
+
signature_method: getValueFromVariablesForAuthType('signatureMethod'),
|
|
1235
|
+
nonce: getValueFromVariablesForAuthType('nonce'),
|
|
1236
|
+
timestamp: getValueFromVariablesForAuthType('timestamp'),
|
|
1237
|
+
version: getValueFromVariablesForAuthType('version'),
|
|
1238
|
+
realm: getValueFromVariablesForAuthType('realm'),
|
|
1239
|
+
add_parameters_to_header: getValueFromVariablesForAuthType('addParamsToHeader'),
|
|
1240
|
+
add_empty_parameters_to_signature: getValueFromVariablesForAuthType('addEmptyParamsToSignature'),
|
|
1241
|
+
callback_url: getValueFromVariablesForAuthType('callbackUrl'),
|
|
1242
|
+
include_body_hash: getValueFromVariablesForAuthType('includeBodyHash'),
|
|
1243
|
+
verifier: getValueFromVariablesForAuthType('verifier'),
|
|
1244
|
+
};
|
|
1245
|
+
break;
|
|
1246
|
+
}
|
|
1247
|
+
return apiTestAuth;
|
|
1248
|
+
}
|
|
1249
|
+
exports.postmanAuthToApiTestAuth = postmanAuthToApiTestAuth;
|
|
1250
|
+
function postmanEventToExecutableSnippets(event) {
|
|
1251
|
+
var _a, _b;
|
|
1252
|
+
if (!event) {
|
|
1253
|
+
return [];
|
|
1254
|
+
}
|
|
1255
|
+
return ((_b = (_a = event.mablSnippets) === null || _a === void 0 ? void 0 : _a.map((snippet) => {
|
|
1256
|
+
if (snippet.reusable) {
|
|
1257
|
+
const executableSnippet = {
|
|
1258
|
+
invariant_id: snippet.invariantId,
|
|
1259
|
+
reusable: true,
|
|
1260
|
+
};
|
|
1261
|
+
return executableSnippet;
|
|
1262
|
+
}
|
|
1263
|
+
const executableSnippet = {
|
|
1264
|
+
reusable: false,
|
|
1265
|
+
body: snippet.body,
|
|
1266
|
+
description: snippet.description,
|
|
1267
|
+
name: snippet.name,
|
|
1268
|
+
snippet_type: snippet.snippet_type,
|
|
1269
|
+
workspace_id: snippet.workspace_id,
|
|
1270
|
+
};
|
|
1271
|
+
return executableSnippet;
|
|
1272
|
+
})) !== null && _b !== void 0 ? _b : []);
|
|
1273
|
+
}
|
|
1274
|
+
exports.postmanEventToExecutableSnippets = postmanEventToExecutableSnippets;
|
|
1195
1275
|
const uuid = () => (0, uuid_1.v4)();
|
|
1196
1276
|
exports.uuid = uuid;
|