@mablhq/mabl-cli 2.79.1 → 2.79.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.
- package/api/mablApiClient.js +10 -10
- package/browserLauncher/index.js +1 -1
- package/commands/tests/testsUtil.js +31 -56
- package/execution/index.js +1 -1
- package/package.json +1 -1
|
@@ -408,44 +408,42 @@ function validateRunCommandWithLabels(testId, suppliedLabelsInclude, suppliedLab
|
|
|
408
408
|
}
|
|
409
409
|
return true;
|
|
410
410
|
}
|
|
411
|
-
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
const testDatatablevariables = journeyRun?.journey_parameters?.user_variables &&
|
|
415
|
-
(0, utils_1.variableRowAsScenario)(journeyRun?.journey_parameters?.user_variables);
|
|
416
|
-
const dataTableId = testDatatablevariables?.table_id;
|
|
417
|
-
if (dataTableId) {
|
|
418
|
-
await apiClient.getDataTable(dataTableId);
|
|
419
|
-
}
|
|
411
|
+
function buildTestRunConfig(testRun, filterHttpRequests, planRun) {
|
|
412
|
+
const testDatatablevariables = testRun.journey_parameters?.user_variables &&
|
|
413
|
+
(0, utils_1.variableRowAsScenario)(testRun.journey_parameters?.user_variables);
|
|
420
414
|
return {
|
|
421
|
-
basicAuthCredentialsId:
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
415
|
+
basicAuthCredentialsId: testRun.journey_parameters?.http_auth_credentials_id ??
|
|
416
|
+
(planRun?.run_policy?.http_auth_credentials_required
|
|
417
|
+
? planRun?.run_policy?.http_auth_credentials_id
|
|
418
|
+
: undefined),
|
|
419
|
+
branchName: testRun.journey_parameters?.source_control_tag,
|
|
420
|
+
credentialsId: testRun.journey_parameters?.credentials_id ??
|
|
421
|
+
(planRun?.run_policy?.credentials_required
|
|
422
|
+
? planRun?.run_policy?.credentials_id
|
|
423
|
+
: undefined),
|
|
428
424
|
dataTableVariables: testDatatablevariables,
|
|
429
|
-
deviceEmulation:
|
|
430
|
-
environmentId:
|
|
425
|
+
deviceEmulation: testRun.journey_parameters?.device_emulation,
|
|
426
|
+
environmentId: testRun.journey_parameters?.deployment?.environment_id,
|
|
431
427
|
extraHttpHeaders: planRun?.run_policy?.http_headers_required === true
|
|
432
|
-
? planRun?.run_policy?.http_headers
|
|
433
|
-
...headers,
|
|
434
|
-
[header.name]: header.value ?? '',
|
|
435
|
-
}), {})
|
|
428
|
+
? headerArrayToRecord(planRun?.run_policy?.http_headers)
|
|
436
429
|
: undefined,
|
|
437
|
-
filterHttpRequests
|
|
438
|
-
importedVariables:
|
|
439
|
-
linkCrawlerStartingUrlOverride: getLinkCrawlerUrlOverride(
|
|
440
|
-
localizationOptions:
|
|
441
|
-
pageLoadWait:
|
|
442
|
-
runId:
|
|
443
|
-
testId:
|
|
444
|
-
url:
|
|
430
|
+
filterHttpRequests,
|
|
431
|
+
importedVariables: testRun.journey_parameters?.imported_variables,
|
|
432
|
+
linkCrawlerStartingUrlOverride: getLinkCrawlerUrlOverride(testRun),
|
|
433
|
+
localizationOptions: testRun.localization_options,
|
|
434
|
+
pageLoadWait: testRun.journey_parameters?.page_load_wait,
|
|
435
|
+
runId: testRun.id,
|
|
436
|
+
testId: testRun.journey?.invariant_id,
|
|
437
|
+
url: testRun.journey_parameters?.deployment?.uri,
|
|
445
438
|
};
|
|
446
439
|
}
|
|
440
|
+
async function pullDownTestRunConfig(testRunId, apiClient) {
|
|
441
|
+
const testRun = await apiClient.getTestRun(testRunId);
|
|
442
|
+
const planRun = await apiClient.getPlanRun(testRun.parent_execution);
|
|
443
|
+
return buildTestRunConfig(testRun, false, planRun);
|
|
444
|
+
}
|
|
447
445
|
async function extractTestRunConfig(executionMessage, apiClient) {
|
|
448
|
-
const
|
|
446
|
+
const testRun = executionMessage.journey_run ??
|
|
449
447
|
(await apiClient.getTestRun(executionMessage.journey_run_id));
|
|
450
448
|
const planRun = executionMessage.plan_run;
|
|
451
449
|
const maybeRunnerType = planRun?.run_policy
|
|
@@ -453,31 +451,8 @@ async function extractTestRunConfig(executionMessage, apiClient) {
|
|
|
453
451
|
?
|
|
454
452
|
planRun?.run_policy?.nodejs_runtime_variant
|
|
455
453
|
: undefined;
|
|
456
|
-
const config =
|
|
457
|
-
|
|
458
|
-
? planRun?.run_policy?.http_auth_credentials_id
|
|
459
|
-
: undefined,
|
|
460
|
-
branchName: journeyRun?.journey_parameters?.source_control_tag,
|
|
461
|
-
credentialsId: planRun?.run_policy?.credentials_required
|
|
462
|
-
? planRun?.run_policy?.credentials_id
|
|
463
|
-
: undefined,
|
|
464
|
-
dataTableVariables: journeyRun?.journey_parameters?.user_variables &&
|
|
465
|
-
(0, utils_1.variableRowAsScenario)(journeyRun?.journey_parameters?.user_variables),
|
|
466
|
-
deviceEmulation: journeyRun?.journey_parameters?.device_emulation,
|
|
467
|
-
environmentId: journeyRun?.journey_parameters?.deployment?.environment_id,
|
|
468
|
-
extraHttpHeaders: planRun?.run_policy?.http_headers_required === true
|
|
469
|
-
? headerArrayToRecord(planRun?.run_policy?.http_headers)
|
|
470
|
-
: undefined,
|
|
471
|
-
filterHttpRequests: true,
|
|
472
|
-
importedVariables: journeyRun.journey_parameters?.imported_variables,
|
|
473
|
-
linkCrawlerStartingUrlOverride: getLinkCrawlerUrlOverride(journeyRun),
|
|
474
|
-
localizationOptions: journeyRun.localization_options,
|
|
475
|
-
pageLoadWait: journeyRun.journey_parameters?.page_load_wait,
|
|
476
|
-
runId: journeyRun.id,
|
|
477
|
-
runnerType: maybeRunnerType,
|
|
478
|
-
testId: journeyRun?.journey?.invariant_id,
|
|
479
|
-
url: journeyRun?.journey_parameters?.deployment?.uri,
|
|
480
|
-
};
|
|
454
|
+
const config = buildTestRunConfig(testRun, true, planRun);
|
|
455
|
+
config.runnerType = maybeRunnerType;
|
|
481
456
|
if (executionMessage.test_type === mablApi_1.TestTypeEnum.Mobile) {
|
|
482
457
|
const mobileMessage = executionMessage;
|
|
483
458
|
config.mobileConfig = {
|