@mablhq/mabl-cli 1.12.33 → 1.13.19
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 +63 -26
- package/api/mablApiClientFactory.js +1 -0
- package/browserLauncher/browserLauncherFactory.js +7 -3
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowser.js +4 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightBrowserLauncher.js +1 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightDom.js +38 -12
- package/browserLauncher/playwrightBrowserLauncher/playwrightFrame.js +10 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightHttpResponse.js +3 -0
- package/browserLauncher/playwrightBrowserLauncher/playwrightPage.js +61 -57
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerBrowser.js +4 -0
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerElementHandle.js +7 -1
- package/browserLauncher/puppeteerBrowserLauncher/puppeteerHttpResponse.js +3 -0
- package/browserLauncher/types.js +6 -1
- package/commands/tests/testsUtil.js +6 -3
- package/commands/tests/tests_cmds/run-cloud.js +1 -1
- package/commands/tests/tests_cmds/run.js +20 -2
- package/execution/index.js +1 -1
- package/execution/index.js.LICENSE.txt +12 -0
- package/index.d.ts +7 -0
- package/mablscript/steps/SendHttpRequestStep.js +9 -1
- package/package.json +3 -2
- package/popupDismissal/index.js +29 -23
- package/resources/popupDismissal.js +1 -1
- package/util/actionabilityUtil.js +55 -7
- package/util/asyncUtil.js +45 -0
- package/util/logUtils.js +2 -2
- package/util/resourceUtil.js +4 -0
|
@@ -145,20 +145,37 @@ exports.builder = (yargs) => {
|
|
|
145
145
|
describe: 'Enable browser extensions on [Chrome]',
|
|
146
146
|
default: false,
|
|
147
147
|
type: 'boolean',
|
|
148
|
+
})
|
|
149
|
+
.option(constants_1.CommandArgHttpHeaders, {
|
|
150
|
+
describe: 'Space delimited HTTP headers added to browser requests (e.g. "x-header:foo")',
|
|
151
|
+
type: 'array',
|
|
148
152
|
})
|
|
149
153
|
.option(constants_1.CommandArgTestInteractionSpeed, {
|
|
150
154
|
describe: 'Set the speed that mabl interacts with webpages. Overrides test run settings if specified.',
|
|
151
155
|
type: 'string',
|
|
152
156
|
choices: Object.keys(mablApi_1.JourneyParameters.PageLoadWaitEnum).map((pageLoadWait) => pageLoadWait.toLowerCase()),
|
|
153
157
|
})
|
|
154
|
-
.check((argv) =>
|
|
158
|
+
.check((argv) => {
|
|
159
|
+
testsUtil_1.validateRunCommandWithLabels(argv[constants_1.CommandArgId], argv[constants_1.CommandArgLabelsInclude], argv[constants_1.CommandArgLabelsExclude], argv[constants_1.CommandArgTestRunId], argv[constants_1.CommandArgFromPlanId], true, argv[constants_1.CommandArgTestFile]);
|
|
160
|
+
const httpHeaders = argv[constants_1.CommandArgHttpHeaders];
|
|
161
|
+
util_1.validateArrayInputs(httpHeaders, 'HTTP headers must be SPACE delimited, e.g. "--http-headers "foo:bar" "baz:qux"');
|
|
162
|
+
argv[constants_1.CommandArgHttpHeaders] = util_1.validateValuePairInputs('HTTP header', httpHeaders);
|
|
163
|
+
return true;
|
|
164
|
+
});
|
|
155
165
|
};
|
|
156
166
|
const exitCodeOnError = 1;
|
|
157
167
|
exports.handler = util_1.failWrapper(run, exitCodeOnError);
|
|
158
168
|
async function run(parsed) {
|
|
159
|
-
var _a, _b;
|
|
169
|
+
var _a, _b, _c;
|
|
160
170
|
const commandStartTime = Date.now();
|
|
161
171
|
const workspaceId = (_a = parsed['workspace-id']) !== null && _a !== void 0 ? _a : (_b = cliConfigProvider_1.CliConfigProvider.getWorkspace()) === null || _b === void 0 ? void 0 : _b.id;
|
|
172
|
+
const extraHttpHeaders = {};
|
|
173
|
+
((_c = parsed['http-headers']) !== null && _c !== void 0 ? _c : []).forEach((header) => {
|
|
174
|
+
const headerParts = header.split(':');
|
|
175
|
+
if (headerParts.length === 2 && headerParts[0] && headerParts[1]) {
|
|
176
|
+
extraHttpHeaders[headerParts[0].toLowerCase()] = headerParts[1];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
162
179
|
const testRunnerConfig = {
|
|
163
180
|
_cliCreated: true,
|
|
164
181
|
branchName: parsed['mabl-branch'],
|
|
@@ -174,6 +191,7 @@ async function run(parsed) {
|
|
|
174
191
|
ignoreCertificateErrors: parsed[constants_1.CommandArgBrowserIgnoreCertificateErrors],
|
|
175
192
|
interactionSpeed: parsed[constants_1.CommandArgTestInteractionSpeed],
|
|
176
193
|
enableExtensions: parsed[constants_1.CommandArgBrowserEnableExtensions],
|
|
194
|
+
extraHttpHeaders,
|
|
177
195
|
keepBrowserOpen: parsed['keep-browser-open'],
|
|
178
196
|
labelsExclude: parsed['exclude-labels'],
|
|
179
197
|
labelsInclude: parsed.labels,
|