@mablhq/mabl-cli 1.13.17 → 1.13.28

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.
@@ -31,11 +31,12 @@ const async_retry_1 = __importDefault(require("async-retry"));
31
31
  const logUtils_1 = require("../util/logUtils");
32
32
  const asyncUtil_1 = require("../util/asyncUtil");
33
33
  const MABL_ENTITY_VERSION_HEADER = 'x-mabl-entity-version';
34
- const DEFAULT_REQUEST_TIMEOUT_MILLISECONDS = 60000;
35
- const DEFAULT_RETRIES = 5;
36
- const DEFAULT_MAX_TOTAL_RETRY_TIME_MILLISECONDS = DEFAULT_REQUEST_TIMEOUT_MILLISECONDS * DEFAULT_RETRIES;
37
- const DEFAULT_MIN_RETRY_TIMEOUT_MILLISECONDS = 100;
38
- const DEFAULT_MAX_RETRY_TIMEOUT_MILLISECONDS = 1000;
34
+ const DEFAULT_RETRYABLE_REQUEST_TIMEOUT_MILLISECONDS = 60000;
35
+ const DEFAULT_RETRIES = 10;
36
+ const DEFAULT_MAX_TOTAL_RETRY_TIME_MILLISECONDS = DEFAULT_RETRYABLE_REQUEST_TIMEOUT_MILLISECONDS * DEFAULT_RETRIES;
37
+ const DEFAULT_NONRETRYABLE_REQUEST_TIMEOUT_MILLISECONDS = DEFAULT_MAX_TOTAL_RETRY_TIME_MILLISECONDS;
38
+ const DEFAULT_MIN_RETRY_INTERVAL_MILLISECONDS = 1000;
39
+ const DEFAULT_MAX_RETRY_INTERVAL_MILLISECONDS = 10000;
39
40
  var AuthType;
40
41
  (function (AuthType) {
41
42
  AuthType[AuthType["Bearer"] = 0] = "Bearer";
@@ -48,7 +49,7 @@ class BasicApiClient {
48
49
  sslVerify: options.sslVerify,
49
50
  proxyHost: options.proxyUrl,
50
51
  });
51
- config.timeout = (_a = options.requestTimeoutMillis) !== null && _a !== void 0 ? _a : DEFAULT_REQUEST_TIMEOUT_MILLISECONDS;
52
+ config.timeout = (_a = options.requestTimeoutMillis) !== null && _a !== void 0 ? _a : DEFAULT_RETRYABLE_REQUEST_TIMEOUT_MILLISECONDS;
52
53
  switch (options.authType) {
53
54
  case AuthType.ApiKey:
54
55
  config.auth = {
@@ -73,10 +74,19 @@ class BasicApiClient {
73
74
  if (options.userAgentOverride) {
74
75
  config.headers[httpUtil_1.USER_AGENT_HEADER] = options.userAgentOverride;
75
76
  }
77
+ this.httpRequestConfig = config;
76
78
  this.httpClient = axios_1.default.create(config);
77
79
  this.retryConfig = options.retryConfig;
78
80
  this.debugLogger = (_b = options.debugLogger) !== null && _b !== void 0 ? _b : logUtils_1.logInternal;
79
81
  }
82
+ getNonRetryableRequestConfig(override) {
83
+ const overrideWithTimeout = { ...(override !== null && override !== void 0 ? override : {}) };
84
+ if (!overrideWithTimeout.timeout) {
85
+ overrideWithTimeout.timeout =
86
+ DEFAULT_NONRETRYABLE_REQUEST_TIMEOUT_MILLISECONDS;
87
+ }
88
+ return { ...this.httpRequestConfig, ...overrideWithTimeout };
89
+ }
80
90
  makeGetRequest(path) {
81
91
  return this.retryWrappedRequest(`makeGetRequest('${path}')`, () => this.getRequest(path));
82
92
  }
@@ -101,12 +111,12 @@ class BasicApiClient {
101
111
  return { ...result, entity_version: versionHeader };
102
112
  }
103
113
  async makePostRequest(path, requestBody, requestConfig) {
104
- const response = await this.debugRequest('POST', path, () => this.httpClient.post(path, requestBody, requestConfig));
114
+ const response = await this.debugRequest('POST', path, () => this.httpClient.post(path, requestBody, this.getNonRetryableRequestConfig(requestConfig)));
105
115
  BasicApiClient.checkResponseStatusCode(response);
106
116
  return response.data;
107
117
  }
108
118
  async makePutRequest(path, requestBody) {
109
- const response = await this.debugRequest('PUT', path, () => this.httpClient.put(path, requestBody));
119
+ const response = await this.debugRequest('PUT', path, () => this.httpClient.put(path, requestBody, this.getNonRetryableRequestConfig()));
110
120
  BasicApiClient.checkResponseStatusCode(response);
111
121
  return response.data;
112
122
  }
@@ -152,8 +162,8 @@ class BasicApiClient {
152
162
  var _a, _b, _c, _d, _e, _f, _g, _h;
153
163
  const retryOptions = {
154
164
  retries: (_b = (_a = this.retryConfig) === null || _a === void 0 ? void 0 : _a.retryCount) !== null && _b !== void 0 ? _b : DEFAULT_RETRIES,
155
- minTimeout: (_d = (_c = this.retryConfig) === null || _c === void 0 ? void 0 : _c.minTimeoutMillis) !== null && _d !== void 0 ? _d : DEFAULT_MIN_RETRY_TIMEOUT_MILLISECONDS,
156
- maxTimeout: (_f = (_e = this.retryConfig) === null || _e === void 0 ? void 0 : _e.maxTimeoutMillis) !== null && _f !== void 0 ? _f : DEFAULT_MAX_RETRY_TIMEOUT_MILLISECONDS,
165
+ minTimeout: (_d = (_c = this.retryConfig) === null || _c === void 0 ? void 0 : _c.minRetryIntervalMillis) !== null && _d !== void 0 ? _d : DEFAULT_MIN_RETRY_INTERVAL_MILLISECONDS,
166
+ maxTimeout: (_f = (_e = this.retryConfig) === null || _e === void 0 ? void 0 : _e.maxRetryIntervalMillis) !== null && _f !== void 0 ? _f : DEFAULT_MAX_RETRY_INTERVAL_MILLISECONDS,
157
167
  maxRetryTime: (_h = (_g = this.retryConfig) === null || _g === void 0 ? void 0 : _g.maxRetryTimeMillis) !== null && _h !== void 0 ? _h : DEFAULT_MAX_TOTAL_RETRY_TIME_MILLISECONDS,
158
168
  onRetry: (error) => {
159
169
  this.debugLogger(`Retrying failed API request "${description}"`, error);
@@ -127,7 +127,7 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
127
127
  }
128
128
  async createDeployment(deployment) {
129
129
  try {
130
- return await this.makePostRequest(`${env_1.BASE_API_URL}/deployments`, deployment);
130
+ return await this.makePostRequest(`${env_1.BASE_API_URL}/deployments`, deployment, { timeout: 0 });
131
131
  }
132
132
  catch (error) {
133
133
  throw toApiError(`Failed to create deployment`, error);
@@ -9,11 +9,6 @@ const authenticationProvider_1 = require("../providers/authenticationProvider");
9
9
  const cliConfigProvider_1 = require("../providers/cliConfigProvider");
10
10
  const basicApiClient_1 = require("./basicApiClient");
11
11
  const chalk_1 = __importDefault(require("chalk"));
12
- const RETRY_CONFIG = {
13
- retryCount: 3,
14
- minTimeoutMillis: 1000,
15
- maxTimeoutMillis: 2000,
16
- };
17
12
  class MablApiClientFactory {
18
13
  static createApiClientFromOptionalApiKey(apiKey) {
19
14
  if (apiKey) {
@@ -44,7 +39,6 @@ class MablApiClientFactory {
44
39
  token: opts.authToken,
45
40
  proxyUrl: httpConfig.proxyHost,
46
41
  sslVerify: httpConfig.sslVerify,
47
- retryConfig: RETRY_CONFIG,
48
42
  userAgentOverride: opts.userAgentOverride,
49
43
  });
50
44
  }
@@ -56,7 +50,6 @@ class MablApiClientFactory {
56
50
  token: authConfig.accessToken,
57
51
  proxyUrl: httpConfig.proxyHost,
58
52
  sslVerify: httpConfig.sslVerify,
59
- retryConfig: RETRY_CONFIG,
60
53
  });
61
54
  }
62
55
  throw new Error('Please supply an API key or authenticate the mabl CLI tool');
@@ -74,7 +67,6 @@ class MablApiClientFactory {
74
67
  token: accessToken,
75
68
  proxyUrl: httpConfig.proxyHost,
76
69
  sslVerify: httpConfig.sslVerify,
77
- retryConfig: RETRY_CONFIG,
78
70
  });
79
71
  }
80
72
  static throwUserAuthTypeError() {
@@ -62,6 +62,9 @@ class PlaywrightBrowser extends events_1.default {
62
62
  disconnect() {
63
63
  return this.close();
64
64
  }
65
+ reconnect() {
66
+ return Promise.resolve(this);
67
+ }
65
68
  async newPage() {
66
69
  return this.getOrCreatePage(await this.defaultContext.newPage());
67
70
  }
@@ -22,6 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.PlaywrightFrame = void 0;
23
23
  const browserLauncher_1 = require("../browserLauncher");
24
24
  const playwright = __importStar(require("@playwright/test"));
25
+ const types_1 = require("../types");
25
26
  const utils_1 = require("../utils");
26
27
  const playwrightHttpResponse_1 = require("./playwrightHttpResponse");
27
28
  const playwrightDom_1 = require("./playwrightDom");
@@ -117,7 +118,16 @@ class PlaywrightFrame extends browserLauncher_1.Frame {
117
118
  }
118
119
  async goto(url, options) {
119
120
  try {
121
+ const waitForNetworkIdle = (options === null || options === void 0 ? void 0 : options.waitUntil) === types_1.LifecycleEvent.NetworkIdle;
122
+ if (options && waitForNetworkIdle) {
123
+ options.waitUntil = types_1.LifecycleEvent.Load;
124
+ }
120
125
  const response = await this.frame.goto(url, options);
126
+ if (waitForNetworkIdle) {
127
+ await this.frame.waitForLoadState('networkidle', {
128
+ timeout: types_1.DefaultTimeouts.quickActionTimeoutMs,
129
+ });
130
+ }
121
131
  return utils_1.mapIfNotNull(response, (response) => new playwrightHttpResponse_1.PlaywrightHttpResponse(this.parentPage, response));
122
132
  }
123
133
  catch (e) {
@@ -53,6 +53,16 @@ class PuppeteerBrowser extends events_1.default {
53
53
  this.browser.disconnect();
54
54
  return Promise.resolve();
55
55
  }
56
+ reconnect() {
57
+ const webSocketEndpoint = this.wsEndpoint();
58
+ if (!webSocketEndpoint) {
59
+ throw new Error(`No browser websocket endpoint configured or supplied for connection`);
60
+ }
61
+ return browserLauncher_1.BrowserLauncherFactory.createRunner(this.getRunnerType()).connect({
62
+ defaultDeviceDescriptor: undefined,
63
+ browserWSEndpoint: webSocketEndpoint,
64
+ }, this.getDownloadDirectory());
65
+ }
56
66
  async newPage() {
57
67
  return this.getOrCreatePage(await this.browser.newPage());
58
68
  }
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const js_yaml_1 = require("js-yaml");
4
7
  const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
5
8
  const util_1 = require("../../commandUtil/util");
6
- const Table = require("cli-table3");
9
+ const cli_table3_1 = __importDefault(require("cli-table3"));
7
10
  const moment = require("moment");
8
11
  const list_1 = require("../../commandUtil/list");
9
12
  const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
@@ -30,7 +33,7 @@ function printApplications(applications, output) {
30
33
  loggingProvider_1.logger.info(js_yaml_1.dump(applications));
31
34
  break;
32
35
  default:
33
- const table = new Table({
36
+ const table = new cli_table3_1.default({
34
37
  head: ['ID', 'Name', 'Created time'],
35
38
  wordWrap: true,
36
39
  });
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const js_yaml_1 = require("js-yaml");
4
- const Table = require("cli-table3");
7
+ const cli_table3_1 = __importDefault(require("cli-table3"));
5
8
  const moment = require("moment");
6
9
  const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
7
10
  const util_1 = require("../../commandUtil/util");
@@ -55,7 +58,7 @@ function printBranches(branches, output) {
55
58
  loggingProvider_1.logger.info(js_yaml_1.dump(branches));
56
59
  break;
57
60
  default:
58
- const table = new Table({
61
+ const table = new cli_table3_1.default({
59
62
  head: ['ID', 'Name', 'Status', 'Created'],
60
63
  });
61
64
  branches.forEach((branch) => {
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const cliConfigProvider_1 = require("../../../providers/cliConfigProvider");
4
7
  const set_1 = require("./set");
5
- const Table = require("cli-table3");
8
+ const cli_table3_1 = __importDefault(require("cli-table3"));
6
9
  const list_1 = require("./list");
7
10
  const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
8
11
  exports.command = `get <${set_1.configKeyCommandArg}>`;
@@ -16,7 +19,7 @@ exports.builder = (yargs) => {
16
19
  exports.handler = getConfig;
17
20
  function getConfig(parsed) {
18
21
  const key = parsed['config-key'];
19
- const table = new Table({
22
+ const table = new cli_table3_1.default({
20
23
  head: ['Config', 'Value', 'Details'],
21
24
  });
22
25
  let value;
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.listConfig = exports.defaultTupleValue = void 0;
4
7
  const cliConfigProvider_1 = require("../../../providers/cliConfigProvider");
5
- const Table = require("cli-table3");
8
+ const cli_table3_1 = __importDefault(require("cli-table3"));
6
9
  const set_1 = require("./set");
7
10
  const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
8
11
  exports.command = `list`;
@@ -10,7 +13,7 @@ exports.describe = 'List all user config values';
10
13
  exports.handler = listConfig;
11
14
  exports.defaultTupleValue = '---';
12
15
  function listConfig() {
13
- const table = new Table({
16
+ const table = new cli_table3_1.default({
14
17
  head: ['Config', 'Value', 'Details'],
15
18
  colWidths: [null, 60],
16
19
  });
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const js_yaml_1 = require("js-yaml");
4
7
  const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
5
8
  const util_1 = require("../../commandUtil/util");
6
- const Table = require("cli-table3");
9
+ const cli_table3_1 = __importDefault(require("cli-table3"));
7
10
  const moment = require("moment");
8
11
  const list_1 = require("../../commandUtil/list");
9
12
  const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
@@ -30,7 +33,7 @@ function printCredentials(credentials, output) {
30
33
  loggingProvider_1.logger.info(js_yaml_1.dump(credentials));
31
34
  break;
32
35
  default:
33
- const table = new Table({
36
+ const table = new cli_table3_1.default({
34
37
  head: ['ID', 'Name', 'Description', 'Created time'],
35
38
  wordWrap: true,
36
39
  });
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.ExecutionResultPresenter = void 0;
4
7
  const change_case_1 = require("change-case");
5
8
  const mablApi_1 = require("../../../mablApi");
6
9
  const moment = require("moment");
7
- const Table = require("cli-table3");
10
+ const cli_table3_1 = __importDefault(require("cli-table3"));
8
11
  const chalk = require('chalk');
9
12
  const momentDurationFormatSetup = require('moment-duration-format');
10
13
  momentDurationFormatSetup(moment);
@@ -25,7 +28,7 @@ class ExecutionResultPresenter {
25
28
  if (columnWidth) {
26
29
  tableConfig.colWidths = Array(columnLabels.length - 1).fill(columnWidth);
27
30
  }
28
- const table = new Table(tableConfig);
31
+ const table = new cli_table3_1.default(tableConfig);
29
32
  const finalExecutions = (_a = results === null || results === void 0 ? void 0 : results.executions) !== null && _a !== void 0 ? _a : [];
30
33
  finalExecutions.forEach((summary) => {
31
34
  var _a, _b, _c, _d, _e;
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const js_yaml_1 = require("js-yaml");
4
- const Table = require("cli-table3");
7
+ const cli_table3_1 = __importDefault(require("cli-table3"));
5
8
  const moment = require("moment");
6
9
  const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
7
10
  const util_1 = require("../../commandUtil/util");
@@ -30,7 +33,7 @@ function printDeployments(deployments, output) {
30
33
  loggingProvider_1.logger.info(js_yaml_1.dump(deployments));
31
34
  break;
32
35
  default:
33
- const table = new Table({
36
+ const table = new cli_table3_1.default({
34
37
  head: ['ID', 'Time', 'Application/Env.', 'Pass', 'Fail', 'Total'],
35
38
  });
36
39
  deployments.forEach((deployment) => {
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const js_yaml_1 = require("js-yaml");
4
7
  const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
5
8
  const util_1 = require("../../commandUtil/util");
6
- const Table = require("cli-table3");
9
+ const cli_table3_1 = __importDefault(require("cli-table3"));
7
10
  const moment = require("moment");
8
11
  const list_1 = require("../../commandUtil/list");
9
12
  const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
@@ -30,7 +33,7 @@ function printEnvironments(environments, output) {
30
33
  loggingProvider_1.logger.info(js_yaml_1.dump(environments));
31
34
  break;
32
35
  default:
33
- const table = new Table({
36
+ const table = new cli_table3_1.default({
34
37
  head: ['ID', 'Name', 'Created time'],
35
38
  wordWrap: true,
36
39
  });
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const Table = require("cli-table3");
6
+ const cli_table3_1 = __importDefault(require("cli-table3"));
4
7
  const moment = require("moment");
5
8
  const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
6
9
  const util_1 = require("../../commandUtil/util");
@@ -42,7 +45,7 @@ async function listFlows(parsed) {
42
45
  return flows.length;
43
46
  }
44
47
  function printFlows(flows) {
45
- const table = new Table({
48
+ const table = new cli_table3_1.default({
46
49
  head: ['ID', 'Description', 'Created time'],
47
50
  wordWrap: true,
48
51
  });
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const constants_1 = require("../../constants");
4
7
  const util_1 = require("../../commandUtil/util");
5
8
  const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
6
- const Table = require("cli-table3");
9
+ const cli_table3_1 = __importDefault(require("cli-table3"));
7
10
  const moment = require("moment");
8
11
  const loggingProvider_1 = require("../../../providers/logging/loggingProvider");
9
12
  exports.command = 'list';
@@ -41,7 +44,7 @@ async function listPlans(parsed) {
41
44
  return plans.length;
42
45
  }
43
46
  function printPlans(plans) {
44
- const table = new Table({
47
+ const table = new cli_table3_1.default({
45
48
  head: ['ID', 'Name', 'Created time'],
46
49
  wordWrap: true,
47
50
  });
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.toBasicHttpAuthenticationCredentials = exports.generateChromiumPreferencesFile = exports.logTestInfoIfPresent = exports.calculateTotalTimeSeconds = exports.extractTestRunConfig = exports.pullDownTestRunConfig = exports.validateRunCommandWithLabels = exports.validateRunEditCommand = exports.downloadUploadFile = exports.sleep = exports.editTheTest = exports.runTheTest = exports.prepareTrainerForSplitPlayback = exports.createTrainingSession = exports.cleanUpInitialPages = exports.getExtensionBackgroundPageWithCliTool = exports.setUpAuthTokenForExtension = exports.connectToExistingBrowserWebsocket = exports.connectToExistingBrowser = exports.createBrowserForExecutionEngine = exports.addExecutionEngineLaunchArgs = exports.createBrowser = exports.prepareChromePreferencesDirectory = exports.createBrowserWithAuthedExtension = exports.findChrome = exports.searchForChrome = exports.getFinalUrl = exports.getTempChromePrefDirectory = void 0;
25
+ exports.toBasicHttpAuthenticationCredentials = exports.generateChromiumPreferencesFile = exports.logTestInfoIfPresent = exports.calculateTotalTimeSeconds = exports.extractTestRunConfig = exports.pullDownTestRunConfig = exports.validateRunCommandWithLabels = exports.validateRunEditCommand = exports.downloadUploadFile = exports.sleep = exports.editTheTest = exports.runTheTest = exports.prepareTrainerForSplitPlayback = exports.createTrainingSession = exports.cleanUpInitialPages = exports.getExtensionBackgroundPageWithCliTool = exports.setUpAuthTokenForExtension = exports.createBrowserForExecutionEngine = exports.addExecutionEngineLaunchArgs = exports.createBrowser = exports.prepareChromePreferencesDirectory = exports.createBrowserWithAuthedExtension = exports.findChrome = exports.searchForChrome = exports.getFinalUrl = exports.getTempChromePrefDirectory = void 0;
26
26
  const os = __importStar(require("os"));
27
27
  const trainerUtil_1 = require("./tests_cmds/trainer_cmds/trainerUtil");
28
28
  const fs = __importStar(require("fs-extra"));
@@ -37,7 +37,7 @@ const env_1 = require("../../env/env");
37
37
  const axios_1 = __importDefault(require("axios"));
38
38
  const httpUtil_1 = require("../../util/httpUtil");
39
39
  const loggingProvider_1 = require("../../providers/logging/loggingProvider");
40
- const Table = require("cli-table3");
40
+ const cli_table3_1 = __importDefault(require("cli-table3"));
41
41
  const logLineMessaging_1 = require("../../core/messaging/logLineMessaging");
42
42
  const resourceUtil_1 = require("../../util/resourceUtil");
43
43
  const mobileEmulationUtil_1 = require("./mobileEmulationUtil");
@@ -282,23 +282,6 @@ async function createBrowserForExecutionEngine(browserWidth, browserHeight, head
282
282
  return maybeBrowser;
283
283
  }
284
284
  exports.createBrowserForExecutionEngine = createBrowserForExecutionEngine;
285
- async function connectToExistingBrowser(port, browserHeight, browserWidth, currentDownloadPath, runnerType) {
286
- const defaultDeviceDescriptor = {
287
- width: browserWidth,
288
- height: browserHeight,
289
- };
290
- const response = await axios_1.default.get(`http://localhost:${port}/json/version`);
291
- const url = response.data.webSocketDebuggerUrl;
292
- return connectToExistingBrowserWebsocket(url, currentDownloadPath, defaultDeviceDescriptor, runnerType);
293
- }
294
- exports.connectToExistingBrowser = connectToExistingBrowser;
295
- function connectToExistingBrowserWebsocket(websocketEndpoint, currentDownloadPath, defaultDeviceDescriptor, runnerType) {
296
- return browserLauncher_1.BrowserLauncherFactory.createRunner(runnerType).connect({
297
- defaultDeviceDescriptor,
298
- browserWSEndpoint: websocketEndpoint,
299
- }, currentDownloadPath);
300
- }
301
- exports.connectToExistingBrowserWebsocket = connectToExistingBrowserWebsocket;
302
285
  async function setUpAuthTokenForExtension(browser, accessToken) {
303
286
  const backgroundPage = await browser.getExtensionBackgroundPage(trainerUtil_1.getTrainerId());
304
287
  await backgroundPage.evaluate((token) => {
@@ -472,7 +455,7 @@ function handleExtensionMessage(message, trainingBrowser) {
472
455
  break;
473
456
  }
474
457
  trainingSessionActions_1.TrainingEventEmitter.sessionSaved(trainedTestInfoMessage.test.id, trainedTestInfoMessage.test.invariant_id, trainedTestInfoMessage.branch, trainedTestInfoMessage.planId);
475
- const table = new Table({
458
+ const table = new cli_table3_1.default({
476
459
  head: [chalk.yellow('Saved Test Info')],
477
460
  wordWrap: true,
478
461
  });
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const Table = require("cli-table3");
6
+ const cli_table3_1 = __importDefault(require("cli-table3"));
4
7
  const moment = require("moment");
5
8
  const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
6
9
  const util_1 = require("../../commandUtil/util");
@@ -72,7 +75,7 @@ async function listTests(parsed) {
72
75
  return journeys.length;
73
76
  }
74
77
  function printTestsAsTable(tests) {
75
- const table = new Table({
78
+ const table = new cli_table3_1.default({
76
79
  head: ['ID', 'Name', 'Created time'],
77
80
  wordWrap: true,
78
81
  });
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.checkForTrainerUpdate = exports.getTrainerVersion = exports.getTrainerId = exports.updateMablTrainer = exports.getMablTrainerExtensionPath = exports.getTrainerZipFile = exports.getTrainerManifestPath = exports.getTrainerUnzippedPath = exports.getTrainerPath = exports.LOCAL_TRAINER_ID = void 0;
7
7
  const env_1 = require("../../../../env/env");
8
- const Table = require("cli-table3");
8
+ const cli_table3_1 = __importDefault(require("cli-table3"));
9
9
  const httpUtil_1 = require("../../../../util/httpUtil");
10
10
  const messaging_1 = require("../../../../core/messaging/messaging");
11
11
  const envPaths = require('env-paths');
@@ -131,7 +131,7 @@ async function checkForTrainerUpdate() {
131
131
  .then((checkSum) => {
132
132
  const checkSumLatest = checkSum.match('md5=([^}]+)');
133
133
  if (checkSumLatest && checkSumLatest[1] !== currentTrainerCheckSum) {
134
- const table = new Table({
134
+ const table = new cli_table3_1.default({
135
135
  head: [chalk.yellow('Trainer Update Available')],
136
136
  wordWrap: true,
137
137
  });
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const js_yaml_1 = require("js-yaml");
4
7
  const mablApiClientFactory_1 = require("../../../api/mablApiClientFactory");
5
- const Table = require("cli-table3");
8
+ const cli_table3_1 = __importDefault(require("cli-table3"));
6
9
  const moment = require("moment");
7
10
  const util_1 = require("../../commandUtil/util");
8
11
  const interfaces_1 = require("../../commandUtil/interfaces");
@@ -43,7 +46,7 @@ function printWorkspaces(workspaces, output) {
43
46
  loggingProvider_1.logger.info(js_yaml_1.dump(workspaces));
44
47
  break;
45
48
  default:
46
- const table = new Table({
49
+ const table = new cli_table3_1.default({
47
50
  head: ['ID', 'Name', 'Created time'],
48
51
  wordWrap: true,
49
52
  });