@mablhq/mabl-cli 1.45.8 → 1.47.20
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 +6 -0
- package/api/featureSet.js +0 -4
- package/api/mablApiClient.js +8 -0
- package/browserEngines/browserEngine.js +40 -0
- package/browserEngines/browserEngines.js +14 -0
- package/browserEngines/chromiumBrowserEngine.js +175 -0
- package/browserEngines/firefoxBrowserEngine.js +117 -0
- package/browserEngines/unsupportedBrowserEngine.js +26 -0
- package/browserLauncher/frameBase.js +5 -1
- package/browserLauncher/pageEvent.js +1 -0
- package/{api/entities/Plan.js → browserLauncher/playwrightBrowserLauncher/browserDelegate.js} +0 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumBrowserDelegate.js +58 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumElementHandleDelegate.js +65 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumFrameDelegate.js +12 -0
- package/browserLauncher/playwrightBrowserLauncher/chromium/chromiumPageDelegate.js +117 -0
- package/browserLauncher/playwrightBrowserLauncher/elementHandleDelegate.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxBrowserDelegate.js +54 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxElementHandleDelegate.js +61 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxFrameDelegate.js +23 -0
- package/browserLauncher/playwrightBrowserLauncher/firefox/firefoxPageDelegate.js +83 -0
- package/browserLauncher/playwrightBrowserLauncher/frameDelegate.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/pageDelegate.js +2 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +44 -35
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +30 -5
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +33 -64
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +35 -11
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpRequest.js +9 -1
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +28 -50
- package/commands/constants.js +6 -1
- package/commands/tests/testsUtil.js +27 -182
- package/commands/tests/tests_cmds/import.js +2 -2
- package/commands/tests/tests_cmds/run.js +9 -9
- package/commands/workspaces/workspace_cmds/copy.js +1 -2
- package/domUtil/index.js +1 -1
- package/execution/index.js +1 -1
- package/functions/apiTest/utils.js +47 -0
- package/functions/types.js +2 -0
- package/functions/utils.js +12 -0
- package/mablApi/index.js +1 -1
- package/mablscript/importer.js +3 -0
- package/mablscript/types/VariableNamespace.js +3 -3
- package/mablscriptFind/index.js +1 -1
- package/package.json +5 -4
- package/popupDismissal/index.js +7 -20
- package/proxy/index.js +1 -1
- package/resources/mablFind.js +1 -1
- package/resources/pdf-viewer/index.js +1 -1
- package/resources/pdf-viewer/libmablPdfViewer.js +117 -113
- package/resources/pdf-viewer/pdf.worker.0ceac9378bfc3bfcb634.js +81 -0
- package/resources/pdf-viewer/pdf.worker.df20a5600902b0735d4b.js +2 -0
- package/resources/popupDismissal.js +1 -1
- package/util/actionabilityUtil.js +4 -4
- package/util/browserTestUtils.js +18 -0
- package/util/clickUtil.js +7 -2
- package/util/fileUploadUtil.js +1 -1
- package/util/jestUtil.js +21 -0
- package/mablscript/types/VariableDataType.js +0 -28
- package/resources/pdf-viewer/pdf.worker.5953c23fa7251d236190.js +0 -2
- package/resources/pdf-viewer/pdf.worker.5f2736435a8b46d97859.js +0 -81
|
@@ -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.validateApiTestMessage = exports.createFileUploadDirectory = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const Globals_1 = require("../../Globals");
|
|
9
|
+
const mablApi_1 = require("../../mablApi");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
function createFileUploadDirectory(testContext) {
|
|
12
|
+
const dir = Globals_1.Globals.getUploadDirectory();
|
|
13
|
+
const prefix = Globals_1.Globals.getUploadDirectoryPrefix();
|
|
14
|
+
const uploadDirectoryName = `${dir}/${prefix}${Date.now()}-`;
|
|
15
|
+
testContext.addFileUploadDir(uploadDirectoryName);
|
|
16
|
+
return fs_1.default.mkdtempSync(uploadDirectoryName);
|
|
17
|
+
}
|
|
18
|
+
exports.createFileUploadDirectory = createFileUploadDirectory;
|
|
19
|
+
function validateApiTestMessage(request, response) {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
const authorizationHeader = request.get('authorization');
|
|
22
|
+
if (authorizationHeader === undefined) {
|
|
23
|
+
(0, utils_1.handleExecutionFailure)(response, 'Illegal authorization');
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const contentType = request.get('content-type');
|
|
27
|
+
if ((contentType === null || contentType === void 0 ? void 0 : contentType.toLowerCase()) !== 'application/json') {
|
|
28
|
+
(0, utils_1.handleExecutionFailure)(response, 'Illegal content type. Must be application/json');
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
const pubsubMessage = request.body;
|
|
32
|
+
if (typeof ((_a = pubsubMessage === null || pubsubMessage === void 0 ? void 0 : pubsubMessage.message) === null || _a === void 0 ? void 0 : _a.data) !== 'string') {
|
|
33
|
+
(0, utils_1.handleExecutionFailure)(response, 'Illegal message data format');
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
if (typeof (pubsubMessage === null || pubsubMessage === void 0 ? void 0 : pubsubMessage.subscription) !== 'string') {
|
|
37
|
+
(0, utils_1.handleExecutionFailure)(response, 'Illegal message subscription format');
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (((_c = (_b = pubsubMessage === null || pubsubMessage === void 0 ? void 0 : pubsubMessage.message) === null || _b === void 0 ? void 0 : _b.attributes) === null || _c === void 0 ? void 0 : _c.test_type) !==
|
|
41
|
+
mablApi_1.Journey.TestTypeEnum.Api.toString()) {
|
|
42
|
+
(0, utils_1.handleExecutionFailure)(response, 'Illegal test type');
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
exports.validateApiTestMessage = validateApiTestMessage;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleExecutionFailure = exports.base64Decode = void 0;
|
|
4
|
+
function base64Decode(encoded) {
|
|
5
|
+
return Buffer.from(encoded, 'base64').toString();
|
|
6
|
+
}
|
|
7
|
+
exports.base64Decode = base64Decode;
|
|
8
|
+
function handleExecutionFailure(response, message) {
|
|
9
|
+
console.error(new Error(message));
|
|
10
|
+
response.status(200).send(message);
|
|
11
|
+
}
|
|
12
|
+
exports.handleExecutionFailure = handleExecutionFailure;
|