@mablhq/mabl-cli 1.61.7 → 1.62.1

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/Globals.js CHANGED
@@ -38,6 +38,15 @@ class Globals {
38
38
  static setPlaywrightInteractionWarningMs(timeout) {
39
39
  Globals.playwrightInteractionWarningMs = timeout;
40
40
  }
41
+ static getSslCaDir() {
42
+ return Globals.sslCaDir;
43
+ }
44
+ static getTestMaxAgeMs() {
45
+ return Globals.testMaxAgeMs;
46
+ }
47
+ static setTestMaxAgeMs(age) {
48
+ Globals.testMaxAgeMs = age;
49
+ }
41
50
  static getUploadDirectory() {
42
51
  return Globals.uploadDirectory;
43
52
  }
@@ -50,16 +59,11 @@ class Globals {
50
59
  static setUploadDirectoryPrefix(prefix) {
51
60
  Globals.uploadDirectoryPrefix = prefix;
52
61
  }
53
- static getTestMaxAgeMs() {
54
- return Globals.testMaxAgeMs;
55
- }
56
- static setTestMaxAgeMs(age) {
57
- Globals.testMaxAgeMs = age;
58
- }
59
62
  }
60
63
  exports.Globals = Globals;
61
64
  Globals.findOverallTimeoutMs = 18.5 * 60 * 1000;
62
65
  Globals.playwrightInteractionWarningMs = 30 * 1000;
66
+ Globals.sslCaDir = '/usr/local/share/http-proxy-certs';
67
+ Globals.testMaxAgeMs = 1000 * 60 * 60 * 24;
63
68
  Globals.uploadDirectory = os.tmpdir();
64
69
  Globals.uploadDirectoryPrefix = `mablTestRunUploads-`;
65
- Globals.testMaxAgeMs = 1000 * 60 * 60 * 24;
@@ -28,6 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.PlaywrightPage = void 0;
30
30
  const events_1 = __importDefault(require("events"));
31
+ const promises_1 = require("fs/promises");
31
32
  const browserLauncher_1 = require("../browserLauncher");
32
33
  const playwright = __importStar(require("@playwright/test"));
33
34
  const playwrightHttpResponse_1 = require("./playwrightHttpResponse");
@@ -352,5 +353,12 @@ class PlaywrightPage extends events_1.default {
352
353
  async getContentAsMhtml() {
353
354
  return this.delegate.getContentAsMhtml();
354
355
  }
356
+ async download(url, destination, encoding = 'binary') {
357
+ const response = await this.page.request.fetch(url);
358
+ const body = await response.body();
359
+ if (body) {
360
+ await (0, promises_1.writeFile)(destination, body, { encoding });
361
+ }
362
+ }
355
363
  }
356
364
  exports.PlaywrightPage = PlaywrightPage;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandArgContentTypes = exports.CommandArgPreview = exports.CommandArgOutputFilePath = exports.CommandArgOutput = exports.CommandArgNoPrompt = exports.CommandArgPrompt = exports.CommandArgPortNumber = exports.CommandArgName = exports.CommandArgMablBranchChangesOnly = exports.CommandArgMablBranch = exports.CommandArgMablAutoLogin = exports.CommandArgMablAutoBranch = exports.CommandArgLinkBypass = exports.CommandArgLinkLabel = exports.CommandArgLimitOutput = exports.CommandArgLabels = exports.CommandArgLabelsInclude = exports.CommandArgLabelsExclude = exports.CommandArgTestInteractionSpeed = exports.CommandArgTestRunId = exports.CommandArgTestFile = exports.CommandArgKeepBrowserOpen = exports.CommandArgInput = exports.CommandArgId = exports.CommandArgUserAgent = exports.CommandArgHttpHeaders = exports.CommandArgHelp = exports.CommandArgHeadless = exports.CommandArgFromPlanId = exports.CommandArgFrom = exports.CommandArgFormat = exports.CommandArgFindPath = exports.CommandArgFastFailure = exports.CommandArgOverrideEnvironmentId = exports.CommandArgExistingReport = exports.CommandArgEnvironmentId = exports.CommandArgEnableLink = exports.CommandArgDetailLevel = exports.CommandArgDescription = exports.CommandArgDeploymentId = exports.CommandArgDecrypt = exports.CommandArgDataTables = exports.CommandArgDataTableId = exports.CommandArgCredentials = exports.CommandArgBasicAuthCredentials = exports.CommandArgBrowsers = exports.CommandArgBrowser = exports.CommandArgApplicationId = exports.CommandArgApiKey = exports.CommandArgABConfigFile = void 0;
4
- exports.SCENARIO_ID_HEADER = exports.SCENARIO_NAME_HEADER = exports.ValidBrowserTypesForLocalRuns = exports.BrowserTypeSelections = exports.DefaultBrowserType = exports.DefaultBranchName = exports.DefaultOutputFormatChoices = exports.DetailLevelFormats = exports.ReporterOptions = exports.OutputFormats = exports.CommandArgAliases = exports.CommandArgBrowserEnableExtensions = exports.CommandArgBrowserIgnoreCertificateErrors = exports.CommandArgBrowserDisableIsolation = exports.ListTimeFormat = exports.CommandArgTimezoneID = exports.CommandArgLocale = exports.CommandArgScenarioId = exports.CommandArgReporterOptions = exports.CommandArgReporter = exports.CommandArgWorkspaceId = exports.CommandArgVersion = exports.CommandArgVariables = exports.CommandArgUrlApi = exports.CommandArgUrlApp = exports.CommandArgUrl = exports.CommandArgTrainerVersion = exports.CommandArgTo = exports.CommandArgSilent = exports.CommandArgRevision = exports.CommandArgMaxHeartbeatAge = exports.CommandArgPlanId = void 0;
3
+ exports.CommandArgPlanId = exports.CommandArgContentTypes = exports.CommandArgPreview = exports.CommandArgOutputFilePath = exports.CommandArgOutput = exports.CommandArgNoPrompt = exports.CommandArgPrompt = exports.CommandArgPortNumber = exports.CommandArgName = exports.CommandArgMablBranchChangesOnly = exports.CommandArgMablBranch = exports.CommandArgMablAutoLogin = exports.CommandArgMablAutoBranch = exports.CommandArgLinkBypass = exports.CommandArgLinkLabel = exports.CommandArgLimitOutput = exports.CommandArgLabels = exports.CommandArgLabelsInclude = exports.CommandArgLabelsExclude = exports.CommandArgTestInteractionSpeed = exports.CommandArgTestRunId = exports.CommandArgTestFile = exports.CommandArgKeepBrowserOpen = exports.CommandArgInput = exports.CommandArgId = exports.CommandArgUserAgent = exports.CommandArgHttpHeaders = exports.CommandArgHelp = exports.CommandArgHeadless = exports.CommandArgFromPlanId = exports.CommandArgFrom = exports.CommandArgFormat = exports.CommandArgFindPath = exports.CommandArgFastFailure = exports.CommandArgOverrideEnvironmentId = exports.CommandArgExistingReport = exports.CommandArgEnvironmentId = exports.CommandArgDetailLevel = exports.CommandArgDescription = exports.CommandArgDeploymentId = exports.CommandArgDecrypt = exports.CommandArgDataTables = exports.CommandArgDataTableId = exports.CommandArgCredentials = exports.CommandArgBasicAuthCredentials = exports.CommandArgBrowsers = exports.CommandArgBrowser = exports.CommandArgApplicationId = exports.CommandArgApiKey = exports.CommandArgABConfigFile = void 0;
4
+ exports.SCENARIO_ID_HEADER = exports.SCENARIO_NAME_HEADER = exports.ValidBrowserTypesForLocalRuns = exports.BrowserTypeSelections = exports.DefaultBrowserType = exports.DefaultBranchName = exports.DefaultOutputFormatChoices = exports.DetailLevelFormats = exports.ReporterOptions = exports.OutputFormats = exports.CommandArgAliases = exports.CommandArgBrowserEnableExtensions = exports.CommandArgBrowserIgnoreCertificateErrors = exports.CommandArgBrowserDisableIsolation = exports.ListTimeFormat = exports.CommandArgTimezoneID = exports.CommandArgLocale = exports.CommandArgUseTestExecutionProxy = exports.CommandArgScenarioId = exports.CommandArgReporterOptions = exports.CommandArgReporter = exports.CommandArgWorkspaceId = exports.CommandArgVersion = exports.CommandArgVariables = exports.CommandArgUrlApi = exports.CommandArgUrlApp = exports.CommandArgUrl = exports.CommandArgTrainerVersion = exports.CommandArgTo = exports.CommandArgSilent = exports.CommandArgRevision = exports.CommandArgMaxHeartbeatAge = void 0;
5
5
  const browserTypes_1 = require("./browserTypes");
6
6
  exports.CommandArgABConfigFile = 'ab-config-file';
7
7
  exports.CommandArgApiKey = 'api-key';
@@ -16,7 +16,6 @@ exports.CommandArgDecrypt = 'decrypt';
16
16
  exports.CommandArgDeploymentId = 'deployment-id';
17
17
  exports.CommandArgDescription = 'description';
18
18
  exports.CommandArgDetailLevel = 'detail-level';
19
- exports.CommandArgEnableLink = 'enable-link';
20
19
  exports.CommandArgEnvironmentId = 'environment-id';
21
20
  exports.CommandArgExistingReport = 'existing-report';
22
21
  exports.CommandArgOverrideEnvironmentId = 'override-environment-id';
@@ -68,6 +67,7 @@ exports.CommandArgWorkspaceId = 'workspace-id';
68
67
  exports.CommandArgReporter = 'reporter';
69
68
  exports.CommandArgReporterOptions = 'reporter-options';
70
69
  exports.CommandArgScenarioId = 'scenario-id';
70
+ exports.CommandArgUseTestExecutionProxy = 'use-test-execution-proxy';
71
71
  exports.CommandArgLocale = 'locale';
72
72
  exports.CommandArgTimezoneID = 'timezone-id';
73
73
  exports.ListTimeFormat = 'MMM Do YYYY, HH:mm:ss';
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.parseBrowserType = exports.toBasicHttpAuthenticationCredentials = exports.logTestInfoIfPresent = exports.milliSecondsToSeconds = exports.calculateTotalTimeSeconds = exports.extractTestRunConfig = exports.pullDownTestRunConfig = exports.validateRunCommandWithLabels = exports.validateRunEditCommand = exports.cleanupTestResources = exports.sleep = exports.editTheTest = exports.runTheTest = exports.prepareTrainerForSplitPlayback = exports.cleanUpInitialPages = exports.getExtensionBackgroundPageWithCliTool = exports.createBrowserForExecutionEngine = exports.createBrowser = exports.getFinalUrl = void 0;
29
+ exports.parseBrowserType = exports.toBasicHttpAuthenticationCredentials = exports.logTestInfoIfPresent = exports.milliSecondsToSeconds = exports.calculateTotalTimeSeconds = exports.headerArrayToRecord = exports.extractTestRunConfig = exports.pullDownTestRunConfig = exports.validateRunCommandWithLabels = exports.validateRunEditCommand = exports.cleanupTestResources = exports.sleep = exports.editTheTest = exports.runTheTest = exports.prepareTrainerForSplitPlayback = exports.cleanUpInitialPages = exports.getExtensionBackgroundPageWithCliTool = exports.createBrowserForExecutionEngine = exports.createBrowser = exports.getFinalUrl = void 0;
30
30
  const cli_table3_1 = __importDefault(require("cli-table3"));
31
31
  const fs = __importStar(require("fs-extra"));
32
32
  const os = __importStar(require("os"));
@@ -398,7 +398,7 @@ function validateRunCommandWithLabels(testId, suppliedLabelsInclude, suppliedLab
398
398
  }
399
399
  exports.validateRunCommandWithLabels = validateRunCommandWithLabels;
400
400
  async function pullDownTestRunConfig(testRunId, apiClient) {
401
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
401
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
402
402
  const journeyRun = await apiClient.getTestRun(testRunId);
403
403
  const planRun = await apiClient.getPlanRun(journeyRun.parent_execution);
404
404
  const testDatatablevariables = ((_a = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey_parameters) === null || _a === void 0 ? void 0 : _a.user_variables) &&
@@ -414,18 +414,27 @@ async function pullDownTestRunConfig(testRunId, apiClient) {
414
414
  dataTableVariables: testDatatablevariables,
415
415
  deviceEmulation: (_h = journeyRun.journey_parameters) === null || _h === void 0 ? void 0 : _h.device_emulation,
416
416
  environmentId: (_k = (_j = journeyRun.journey_parameters) === null || _j === void 0 ? void 0 : _j.deployment) === null || _k === void 0 ? void 0 : _k.environment_id,
417
+ extraHttpHeaders: ((_l = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _l === void 0 ? void 0 : _l.http_headers_required) === true
418
+ ? (_o = (_m = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _m === void 0 ? void 0 : _m.http_headers) === null || _o === void 0 ? void 0 : _o.reduce((headers, header) => {
419
+ var _a;
420
+ return ({
421
+ ...headers,
422
+ [header.name]: (_a = header.value) !== null && _a !== void 0 ? _a : '',
423
+ });
424
+ }, {})
425
+ : undefined,
417
426
  filterHttpRequests: false,
418
- importedVariables: (_l = journeyRun.journey_parameters) === null || _l === void 0 ? void 0 : _l.imported_variables,
427
+ importedVariables: (_p = journeyRun.journey_parameters) === null || _p === void 0 ? void 0 : _p.imported_variables,
419
428
  localizationOptions: journeyRun.localization_options,
420
- pageLoadWait: (_m = journeyRun.journey_parameters) === null || _m === void 0 ? void 0 : _m.page_load_wait,
429
+ pageLoadWait: (_q = journeyRun.journey_parameters) === null || _q === void 0 ? void 0 : _q.page_load_wait,
421
430
  runId: journeyRun.id,
422
- testId: (_o = journeyRun.journey) === null || _o === void 0 ? void 0 : _o.invariant_id,
423
- url: (_q = (_p = journeyRun.journey_parameters) === null || _p === void 0 ? void 0 : _p.deployment) === null || _q === void 0 ? void 0 : _q.uri,
431
+ testId: (_r = journeyRun.journey) === null || _r === void 0 ? void 0 : _r.invariant_id,
432
+ url: (_t = (_s = journeyRun.journey_parameters) === null || _s === void 0 ? void 0 : _s.deployment) === null || _t === void 0 ? void 0 : _t.uri,
424
433
  };
425
434
  }
426
435
  exports.pullDownTestRunConfig = pullDownTestRunConfig;
427
436
  async function extractTestRunConfig(executionMessage, apiClient) {
428
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
437
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
429
438
  const journeyRun = (_a = executionMessage.journey_run) !== null && _a !== void 0 ? _a : (await apiClient.getTestRun(executionMessage.journey_run_id));
430
439
  const planRun = executionMessage.plan_run;
431
440
  const maybeRunnerType = ((_b = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _b === void 0 ? void 0 : _b.nodejs_runtime_variant)
@@ -433,10 +442,10 @@ async function extractTestRunConfig(executionMessage, apiClient) {
433
442
  (_c = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _c === void 0 ? void 0 : _c.nodejs_runtime_variant
434
443
  : undefined;
435
444
  return {
436
- branchName: (_d = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey_parameters) === null || _d === void 0 ? void 0 : _d.source_control_tag,
437
- basicAuthCredentialsId: ((_e = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _e === void 0 ? void 0 : _e.http_auth_credentials_required)
438
- ? (_f = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _f === void 0 ? void 0 : _f.http_auth_credentials_id
445
+ basicAuthCredentialsId: ((_d = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _d === void 0 ? void 0 : _d.http_auth_credentials_required)
446
+ ? (_e = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _e === void 0 ? void 0 : _e.http_auth_credentials_id
439
447
  : undefined,
448
+ branchName: (_f = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey_parameters) === null || _f === void 0 ? void 0 : _f.source_control_tag,
440
449
  credentialsId: ((_g = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _g === void 0 ? void 0 : _g.credentials_required)
441
450
  ? (_h = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _h === void 0 ? void 0 : _h.credentials_id
442
451
  : undefined,
@@ -444,17 +453,30 @@ async function extractTestRunConfig(executionMessage, apiClient) {
444
453
  (0, utils_1.variableRowAsScenario)((_k = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey_parameters) === null || _k === void 0 ? void 0 : _k.user_variables),
445
454
  deviceEmulation: (_l = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey_parameters) === null || _l === void 0 ? void 0 : _l.device_emulation,
446
455
  environmentId: (_o = (_m = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey_parameters) === null || _m === void 0 ? void 0 : _m.deployment) === null || _o === void 0 ? void 0 : _o.environment_id,
456
+ extraHttpHeaders: ((_p = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _p === void 0 ? void 0 : _p.http_headers_required) === true
457
+ ? headerArrayToRecord((_q = planRun === null || planRun === void 0 ? void 0 : planRun.run_policy) === null || _q === void 0 ? void 0 : _q.http_headers)
458
+ : undefined,
447
459
  filterHttpRequests: true,
448
- importedVariables: (_p = journeyRun.journey_parameters) === null || _p === void 0 ? void 0 : _p.imported_variables,
460
+ importedVariables: (_r = journeyRun.journey_parameters) === null || _r === void 0 ? void 0 : _r.imported_variables,
449
461
  localizationOptions: journeyRun.localization_options,
450
- pageLoadWait: (_q = journeyRun.journey_parameters) === null || _q === void 0 ? void 0 : _q.page_load_wait,
462
+ pageLoadWait: (_s = journeyRun.journey_parameters) === null || _s === void 0 ? void 0 : _s.page_load_wait,
451
463
  runId: journeyRun.id,
452
464
  runnerType: maybeRunnerType,
453
- testId: (_r = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey) === null || _r === void 0 ? void 0 : _r.invariant_id,
454
- url: (_t = (_s = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey_parameters) === null || _s === void 0 ? void 0 : _s.deployment) === null || _t === void 0 ? void 0 : _t.uri,
465
+ testId: (_t = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey) === null || _t === void 0 ? void 0 : _t.invariant_id,
466
+ url: (_v = (_u = journeyRun === null || journeyRun === void 0 ? void 0 : journeyRun.journey_parameters) === null || _u === void 0 ? void 0 : _u.deployment) === null || _v === void 0 ? void 0 : _v.uri,
455
467
  };
456
468
  }
457
469
  exports.extractTestRunConfig = extractTestRunConfig;
470
+ function headerArrayToRecord(headers) {
471
+ return headers === null || headers === void 0 ? void 0 : headers.reduce((headers, header) => {
472
+ var _a;
473
+ return ({
474
+ ...headers,
475
+ [header.name]: (_a = header.value) !== null && _a !== void 0 ? _a : '',
476
+ });
477
+ }, {});
478
+ }
479
+ exports.headerArrayToRecord = headerArrayToRecord;
458
480
  function calculateTotalTimeSeconds(startTimeMillis, endTimeMillis) {
459
481
  return (endTimeMillis - startTimeMillis) / 1000;
460
482
  }
@@ -61,11 +61,6 @@ exports.builder = (yargs) => {
61
61
  describe: 'Workspace to run against',
62
62
  nargs: 1,
63
63
  type: 'string',
64
- })
65
- .option(constants_1.CommandArgEnableLink, {
66
- describe: 'Enable usage of mabl Link for test run. For local CLI runs link agent label set in the environment is ignored.',
67
- type: 'boolean',
68
- hidden: true,
69
64
  })
70
65
  .option(constants_1.CommandArgEnvironmentId, {
71
66
  alias: constants_1.CommandArgAliases.EnvironmentId,
@@ -186,11 +181,18 @@ exports.builder = (yargs) => {
186
181
  nargs: 1,
187
182
  choices: constants_1.ValidBrowserTypesForLocalRuns,
188
183
  hidden: true,
184
+ })
185
+ .option(constants_1.CommandArgUseTestExecutionProxy, {
186
+ describe: 'Route test HTTP traffic through a local proxy',
187
+ type: 'boolean',
188
+ hidden: true,
189
189
  })
190
190
  .check((argv) => {
191
191
  (0, 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]);
192
- if (argv[constants_1.CommandArgDataTableId] && !argv[constants_1.CommandArgId]) {
193
- throw new Error(`The ${constants_1.CommandArgDataTableId} option can only be used with the ${constants_1.CommandArgId} option`);
192
+ if (argv[constants_1.CommandArgDataTableId] &&
193
+ !argv[constants_1.CommandArgId] &&
194
+ !argv[constants_1.CommandArgFromPlanId]) {
195
+ throw new Error(`The ${constants_1.CommandArgDataTableId} option can only be used with the ${constants_1.CommandArgId} or the ${constants_1.CommandArgFromPlanId} option`);
194
196
  }
195
197
  if (argv[constants_1.CommandArgDataTableId] && argv[constants_1.CommandArgScenarioId]) {
196
198
  throw new Error(`The ${constants_1.CommandArgScenarioId} option cannot be used with the ${constants_1.CommandArgDataTableId} option`);
@@ -245,7 +247,7 @@ async function run(parsed) {
245
247
  dataTableVariables: scenario,
246
248
  disableIsolation: parsed[constants_1.CommandArgBrowserDisableIsolation],
247
249
  enableExtensions: parsed[constants_1.CommandArgBrowserEnableExtensions],
248
- enableLink: parsed[constants_1.CommandArgEnableLink],
250
+ enableLink: false,
249
251
  environmentId: parsed[constants_1.CommandArgEnvironmentId],
250
252
  extraHttpHeaders,
251
253
  filterHttpRequests: false,
@@ -263,6 +265,7 @@ async function run(parsed) {
263
265
  testFile: parsed[constants_1.CommandArgTestFile],
264
266
  testId: parsed.id,
265
267
  url: parsed.url,
268
+ useTestExecutionProxy: parsed[constants_1.CommandArgUseTestExecutionProxy],
266
269
  userAgent: parsed[constants_1.CommandArgUserAgent],
267
270
  usingDataTableId: parsed[constants_1.CommandArgDataTableId],
268
271
  width: parsed.width,
@@ -280,10 +283,11 @@ async function run(parsed) {
280
283
  });
281
284
  }
282
285
  await (0, runUtils_1.logTestResults)(results, parsed, commandStartTime, generateRunCommandTemplate(parsed, results));
283
- if (!results.success && !testRunnerConfig.keepBrowserOpen) {
284
- process.exit(1);
286
+ if (!testRunnerConfig.keepBrowserOpen) {
287
+ if (!results.success) {
288
+ process.exit(1);
289
+ }
285
290
  }
286
- return 'done';
287
291
  }
288
292
  exports.run = run;
289
293
  function generateRunCommandTemplate(parsed, testResults) {