@testim/testim-cli 3.254.0 → 3.256.0

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.
Files changed (61) hide show
  1. package/agent/routers/cliJsCode/service.js +11 -8
  2. package/agent/routers/codim/router.test.js +9 -12
  3. package/agent/routers/codim/service.js +16 -16
  4. package/agent/routers/playground/service.js +5 -7
  5. package/cli.js +6 -6
  6. package/cliAgentMode.js +11 -10
  7. package/codim/codim-cli.js +14 -9
  8. package/commons/featureFlags.js +29 -7
  9. package/commons/httpRequest.js +5 -1
  10. package/commons/httpRequestCounters.js +21 -10
  11. package/commons/initializeUserWithAuth.js +7 -4
  12. package/commons/lazyRequire.js +4 -3
  13. package/commons/preloadTests.js +6 -3
  14. package/commons/prepareRunner.js +7 -5
  15. package/commons/prepareRunnerAndTestimStartUtils.js +51 -45
  16. package/commons/runnerFileCache.js +10 -2
  17. package/commons/testimServicesApi.js +36 -5
  18. package/commons/testimTunnel.test.js +2 -1
  19. package/coverage/SummaryToObjectReport.js +0 -1
  20. package/coverage/jsCoverage.js +12 -10
  21. package/inputFileUtils.js +11 -9
  22. package/npm-shrinkwrap.json +214 -471
  23. package/package.json +4 -3
  24. package/player/services/tabService.js +15 -1
  25. package/player/stepActions/apiStepAction.js +49 -43
  26. package/player/stepActions/baseCliJsStepAction.js +19 -14
  27. package/player/stepActions/baseJsStepAction.js +9 -8
  28. package/player/stepActions/dropFileStepAction.js +1 -3
  29. package/player/stepActions/inputFileStepAction.js +10 -8
  30. package/player/stepActions/locateStepAction.js +2 -0
  31. package/player/stepActions/mouseStepAction.js +21 -22
  32. package/player/stepActions/nodePackageStepAction.js +34 -35
  33. package/player/stepActions/stepAction.js +1 -0
  34. package/player/utils/imageCaptureUtils.js +133 -172
  35. package/player/utils/screenshotUtils.js +16 -13
  36. package/player/utils/windowUtils.js +20 -8
  37. package/player/webdriver.js +25 -22
  38. package/processHandler.js +4 -0
  39. package/reports/junitReporter.js +6 -7
  40. package/reports/reporter.js +34 -39
  41. package/runOptions.d.ts +286 -0
  42. package/runOptions.js +60 -45
  43. package/runner.js +64 -24
  44. package/runners/ParallelWorkerManager.js +12 -12
  45. package/runners/TestPlanRunner.js +14 -15
  46. package/runners/buildCodeTests.js +1 -0
  47. package/runners/runnerUtils.js +11 -2
  48. package/services/branchService.js +11 -5
  49. package/services/gridService.js +36 -40
  50. package/services/localRCASaver.js +4 -0
  51. package/testRunStatus.js +8 -5
  52. package/utils/argsUtils.js +86 -0
  53. package/utils/argsUtils.test.js +32 -0
  54. package/utils/fsUtils.js +154 -0
  55. package/utils/index.js +10 -161
  56. package/utils/promiseUtils.js +13 -2
  57. package/utils/stringUtils.js +4 -2
  58. package/utils/stringUtils.test.js +22 -0
  59. package/utils/timeUtils.js +25 -0
  60. package/utils/utils.test.js +0 -41
  61. package/workers/WorkerExtension.js +6 -7
@@ -1,9 +1,9 @@
1
- /* eslint-disable no-var */
1
+ /* eslint-disable arrow-body-style, no-shadow, @typescript-eslint/prefer-optional-chain, comma-spacing, no-empty, padded-blocks, semi, indent, unicorn/no-useless-promise-resolve-reject, default-param-last, comma-dangle, semi-style, consistent-return, radix, prefer-template, prefer-const, object-shorthand, no-trailing-spaces, operator-linebreak, no-else-return, unicorn/prefer-includes, prefer-arrow-callback, max-len, no-var */
2
2
 
3
3
  'use strict';
4
4
 
5
+ const _ = require('lodash');
5
6
  const logger = require('../commons/logger').getLogger('webdriver');
6
- const Promise = require('bluebird');
7
7
  const parser = require('ua-parser-js');
8
8
  const desiredCapabilitiesBuilder = require('../commons/testimDesiredCapabilitiesBuilder');
9
9
  const { SeleniumError, SeleniumCrashError, IeError } = require('../errors');
@@ -13,7 +13,7 @@ const doubleClick = require('./stepActions/scripts/doubleClick');
13
13
  const dispatchFocus = require('./stepActions/scripts/focusElement');
14
14
  const { isOldProtocol } = require('./webDriverUtils');
15
15
  const featureFlags = require('../commons/featureFlags');
16
- const _ = require('lodash');
16
+ const { W3C_ELEMENT_ID } = require('./constants');
17
17
 
18
18
  const [LEFT, RIGHT] = [0, 2];
19
19
  const { extractElementId, getCdpAddressForHost } = utils;
@@ -202,7 +202,8 @@ class WebDriver extends WebDriverApi {
202
202
  switchToLocatedFrame(locatedElement) {
203
203
  return this.getElement(locatedElement)
204
204
  .then(async el => {
205
- await this.switchToFrame(el.value);
205
+ const elementId = extractElementId(el.value);
206
+ await this.switchToFrame({ ELEMENT: elementId, [W3C_ELEMENT_ID]: elementId });
206
207
  return el;
207
208
  });
208
209
  }
@@ -213,7 +214,7 @@ class WebDriver extends WebDriverApi {
213
214
 
214
215
  switchToTopFrame() {
215
216
  return this.frame().catch(err => {
216
- if (err.message && err.message.includes('ECONNREFUSED')) {
217
+ if (err.message?.includes('ECONNREFUSED')) {
217
218
  throw new SeleniumCrashError();
218
219
  }
219
220
  throw err;
@@ -221,11 +222,11 @@ class WebDriver extends WebDriverApi {
221
222
  }
222
223
 
223
224
  /**
224
- * @returns {Promise<{ value: HTMLElement }>}
225
+ * @returns {Promise<{ value: HTMLElement | { [W3C_ELEMENT_ID]: string } | { ELEMENT: string } }>}
225
226
  */
226
227
  getElement(locatedElement) {
227
228
  const perfId = this.seleniumPerfStats.markStart(SELENIUM_PERF_MARKS.GET_ELEMENT);
228
- if (typeof locatedElement === 'string' || typeof locatedElement === 'number') { // support testimId in the meanwhile for backwards compatability
229
+ if (typeof locatedElement === 'string' || typeof locatedElement === 'number') { // support testimId in the meanwhile for backwards compatibility
229
230
  return this.getElementBySelector(`[testim_dom_element_id='${locatedElement}']`)
230
231
  .finally(() => this.seleniumPerfStats.markEnd(perfId, SELENIUM_PERF_MARKS.GET_ELEMENT));
231
232
  }
@@ -452,10 +453,10 @@ class WebDriver extends WebDriverApi {
452
453
  throw testimInternalError;
453
454
  }
454
455
  return this.executeJS('return navigator.userAgent;')
455
- .catch(() => Promise.reject(testimInternalError))
456
+ .catch(() => { throw testimInternalError; })
456
457
  .then(ua => {
457
458
  const error = this.isUsingUnsupportedCompabilityMode(ua.value) ? this.getIeError('Can’t run test in IE compatibility mode') : testimInternalError;
458
- return Promise.reject(error);
459
+ throw error;
459
460
  });
460
461
  });
461
462
  }
@@ -586,7 +587,7 @@ class WebDriver extends WebDriverApi {
586
587
  userAgent: rawUserAgent,
587
588
  browserVersion: parse.browser.version
588
589
  };
589
- return Promise.resolve(this.browserAndOS);
590
+ return this.browserAndOS;
590
591
  });
591
592
  }
592
593
 
@@ -690,7 +691,7 @@ class WebDriver extends WebDriverApi {
690
691
  this.unsupportedActions.move = true;
691
692
  return this.rightClickWithActionsAPI(element, offsets);
692
693
  }
693
- return Promise.reject(err);
694
+ throw err;
694
695
  });
695
696
  }
696
697
 
@@ -704,7 +705,7 @@ class WebDriver extends WebDriverApi {
704
705
  this.unsupportedActions.move = true;
705
706
  return this.leftClickWithActionsAPI(element, offsets);
706
707
  }
707
- return Promise.reject(err);
708
+ throw err;
708
709
  });
709
710
  }
710
711
 
@@ -826,7 +827,7 @@ class WebDriver extends WebDriverApi {
826
827
  this.unsupportedActions.move = true;
827
828
  return this.dragWithActionsAPI(seleniumElement, xDiff, yDiff, midXRelative, midYRelative);
828
829
  }
829
- return Promise.reject(err);
830
+ throw err;
830
831
  });
831
832
  });
832
833
  }
@@ -857,15 +858,17 @@ class WebDriver extends WebDriverApi {
857
858
  }, [{ x: Math.round(startLeft), y: Math.round(startTop) }]);
858
859
  }
859
860
 
860
- dragAndDropWithGeneratedMoves(sourceSeleniumElement, destinationSeleniumElement, rectsAndOffsets) {
861
+ async dragAndDropWithGeneratedMoves(sourceSeleniumElement, destinationSeleniumElement, rectsAndOffsets) {
861
862
  const { fromRect, fromX, fromY, toRect, toX, toY } = rectsAndOffsets;
862
863
  const moveSequence = this.getMoveRelativeSequence(fromRect.left + fromX, fromRect.top + fromY, toRect.left + toX, toRect.top + toY);
863
864
 
864
- return this.moveTo(extractElementId(sourceSeleniumElement), Math.round(fromX), Math.round(fromY))
865
- .then(() => this.buttonDown())
866
- .then(() => Promise.each(moveSequence, movePosition => this.moveTo(null, movePosition.x, movePosition.y)))
867
- .then(() => this.moveTo(extractElementId(destinationSeleniumElement), Math.round(toX), Math.round(toY)))
868
- .then(() => this.buttonUp());
865
+ await this.moveTo(extractElementId(sourceSeleniumElement), Math.round(fromX), Math.round(fromY));
866
+ await this.buttonDown();
867
+ for (const movePosition of moveSequence) {
868
+ await this.moveTo(null, movePosition.x, movePosition.y);
869
+ }
870
+ await this.moveTo(extractElementId(destinationSeleniumElement), Math.round(toX), Math.round(toY));
871
+ return await this.buttonUp();
869
872
  }
870
873
 
871
874
  dragAndDropWithActionsAPIWithGeneratedMoves(rectsAndOffsets) {
@@ -900,7 +903,7 @@ class WebDriver extends WebDriverApi {
900
903
  this.unsupportedActions.move = true;
901
904
  return this.dragAndDropWithActionsAPIWithGeneratedMoves(rectsAndOffsets);
902
905
  }
903
- return Promise.reject(err);
906
+ throw err;
904
907
  });
905
908
  }
906
909
  if (this.unsupportedActions.move) {
@@ -912,7 +915,7 @@ class WebDriver extends WebDriverApi {
912
915
  this.unsupportedActions.move = true;
913
916
  return this.dragAndDropWithActionsAPI(rectsAndOffsets);
914
917
  }
915
- return Promise.reject(err);
918
+ throw err;
916
919
  });
917
920
  }
918
921
 
@@ -934,7 +937,7 @@ class WebDriver extends WebDriverApi {
934
937
  this.unsupportedActions.move = true;
935
938
  return this.doubleClickFallback(element, eventData, offsets);
936
939
  }
937
- return Promise.reject(err);
940
+ throw err;
938
941
  });
939
942
  }
940
943
 
package/processHandler.js CHANGED
@@ -7,6 +7,10 @@ const logger = require('./commons/logger').getLogger('process-handler');
7
7
 
8
8
  const exitHooks = [];
9
9
 
10
+ /**
11
+ * @param {(e: any) => void} onExit
12
+ * @param {NodeJS.Process=} _process
13
+ */
10
14
  module.exports = function (onExit, _process = process) {
11
15
  async function cleanup(err) {
12
16
  // give cleanup and socket reports a chance to run
@@ -3,8 +3,7 @@
3
3
  'use strict';
4
4
 
5
5
  const xml2js = require('xml2js');
6
- const Promise = require('bluebird');
7
- const fs = Promise.promisifyAll(require('fs'));
6
+ const fsPromises = require('fs/promises');
8
7
  const utils = require('../utils');
9
8
  const {
10
9
  isAbortedTest, isSkippedTest, getFailedTests, isFailedTest, getFailureEvaluatingCount, getSkippedCount, getAbortedTests,
@@ -34,7 +33,7 @@ class JunitReporter {
34
33
  return undefined;
35
34
  }
36
35
  try {
37
- await fs.writeFileAsync(reportFile, reportText);
36
+ await fsPromises.writeFile(reportFile, reportText);
38
37
  console.log('JUnit XML file saved to', reportFile);
39
38
  return testResults;
40
39
  } catch (err) {
@@ -55,7 +54,7 @@ function getPrintName(testResult) {
55
54
  }
56
55
 
57
56
  async function report(editorUrl, testPlanResults, projectId, branch, classname, options) {
58
- function createTestCaseObject(testResult, projectId) {
57
+ function createTestCaseObject(testResult) {
59
58
  const testResultUrl = utils.getTestUrl(editorUrl, projectId, testResult.testId, testResult.resultId, branch);
60
59
  const testResultObject = {
61
60
  $: {
@@ -102,7 +101,7 @@ async function report(editorUrl, testPlanResults, projectId, branch, classname,
102
101
  }
103
102
  return {
104
103
  $: testSuiteAttributes,
105
- testcase: Object.keys(testResults).map(resultId => createTestCaseObject(testResults[resultId], projectId)),
104
+ testcase: Object.keys(testResults).map(resultId => createTestCaseObject(testResults[resultId])),
106
105
  };
107
106
  }
108
107
 
@@ -130,9 +129,9 @@ async function report(editorUrl, testPlanResults, projectId, branch, classname,
130
129
  try {
131
130
  const builder = new xml2js.Builder();
132
131
  const jUnitXmlReporter = builder.buildObject(testResultObject);
133
- return Promise.resolve(jUnitXmlReporter);
132
+ return jUnitXmlReporter;
134
133
  } catch (err) {
135
- return Promise.resolve(createErrorjUnitReporter(err));
134
+ return createErrorjUnitReporter(err);
136
135
  }
137
136
  }
138
137
 
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  const logger = require('../commons/logger').getLogger('reporter');
4
- const Promise = require('bluebird');
5
4
 
6
5
  class Reporter {
7
6
  setOptions(options, branchToUse) {
@@ -46,7 +45,7 @@ class Reporter {
46
45
  }
47
46
  }
48
47
 
49
- onTestPlanFinished(testResults, testPlanName, startTime, executionId, isAnonymous, isCodeMode, childTestResults) {
48
+ async onTestPlanFinished(testResults, testPlanName, startTime, executionId, isAnonymous, isCodeMode, childTestResults) {
50
49
  let results = {};
51
50
 
52
51
  // TODO: remove mutation of testResults from the Reporter
@@ -68,62 +67,55 @@ class Reporter {
68
67
  } else {
69
68
  results = testResults;
70
69
  }
71
-
72
- return Promise.each(this.reporters, reporter => {
70
+ for (const reporter of this.reporters) {
73
71
  if (reporter?.onTestPlanFinished) {
74
72
  const duration = Date.now() - (startTime || 0);
75
- return reporter.onTestPlanFinished(results, testPlanName, duration, executionId, isAnonymous, isCodeMode);
73
+ await reporter.onTestPlanFinished(results, testPlanName, duration, executionId, isAnonymous, isCodeMode);
76
74
  }
77
- return undefined;
78
- });
75
+ }
79
76
  }
80
77
 
81
- onTestPlanStarted(beforeTests, tests, afterTests, testPlanName, executionId, isAnonymous, configName, isCodeMode) {
82
- return Promise.each(this.reporters, reporter => {
78
+ async onTestPlanStarted(beforeTests, tests, afterTests, testPlanName, executionId, isAnonymous, configName, isCodeMode) {
79
+ for (const reporter of this.reporters) {
83
80
  if (reporter?.onTestPlanStarted) {
84
- return reporter.onTestPlanStarted(beforeTests, tests, afterTests, testPlanName, executionId, isAnonymous, configName, isCodeMode);
81
+ await reporter.onTestPlanStarted(beforeTests, tests, afterTests, testPlanName, executionId, isAnonymous, configName, isCodeMode);
85
82
  }
86
- return undefined;
87
- });
83
+ }
88
84
  }
89
85
 
90
- onGetSlot(workerId, browser) {
91
- return Promise.each(this.reporters, reporter => {
86
+ async onGetSlot(workerId, browser) {
87
+ for (const reporter of this.reporters) {
92
88
  if (reporter?.onGetSlot) {
93
- return reporter.onGetSlot(workerId, browser);
89
+ await reporter.onGetSlot(workerId, browser);
94
90
  }
95
- return undefined;
96
- });
91
+ }
97
92
  }
98
93
 
99
- onGetSession(workerId, testName, mode) {
100
- return Promise.each(this.reporters, reporter => {
94
+ async onGetSession(workerId, testName, mode) {
95
+ for (const reporter of this.reporters) {
101
96
  if (reporter?.onGetSession) {
102
- return reporter.onGetSession(workerId, testName, mode);
97
+ await reporter.onGetSession(workerId, testName, mode);
103
98
  }
104
- return undefined;
105
- });
99
+ }
106
100
  }
107
101
 
108
- onWaitToTestComplete(workerId, isCodeMode, debuggerAddress) {
109
- return Promise.each(this.reporters, reporter => {
102
+ async onWaitToTestComplete(workerId, isCodeMode, debuggerAddress) {
103
+ for (const reporter of this.reporters) {
110
104
  if (reporter?.onWaitToTestComplete) {
111
- return reporter.onWaitToTestComplete(workerId, isCodeMode, debuggerAddress);
105
+ await reporter.onWaitToTestComplete(workerId, isCodeMode, debuggerAddress);
112
106
  }
113
- return undefined;
114
- });
107
+ }
115
108
  }
116
109
 
117
- onWaitToTestStart(workerId) {
118
- return Promise.each(this.reporters, reporter => {
110
+ async onWaitToTestStart(workerId) {
111
+ for (const reporter of this.reporters) {
119
112
  if (reporter?.onWaitToTestStart) {
120
- return reporter.onWaitToTestStart(workerId);
113
+ await reporter.onWaitToTestStart(workerId);
121
114
  }
122
- return undefined;
123
- });
115
+ }
124
116
  }
125
117
 
126
- onAllTestPlansFinished(testPlanResults) {
118
+ async onAllTestPlansFinished(testPlanResults) {
127
119
  // TODO: remove mutation of testPlanResults from the Reporter
128
120
  for (const result of testPlanResults) {
129
121
  if (result.childTestResults) {
@@ -140,18 +132,21 @@ class Reporter {
140
132
  }
141
133
  }
142
134
 
143
- return Promise.each(this.reporters, reporter => {
135
+ for (const reporter of this.reporters) {
144
136
  if (reporter?.onAllTestPlansFinished) {
145
- return reporter.onAllTestPlansFinished(testPlanResults);
137
+ await reporter.onAllTestPlansFinished(testPlanResults);
146
138
  }
147
- return undefined;
148
- });
139
+ }
149
140
  }
150
141
  }
151
142
 
152
143
  function addHook(name) {
153
- Reporter.prototype[name] = function (...args) {
154
- return Promise.filter(this.reporters, reporter => reporter?.[name]).each(reporter => reporter[name](...args));
144
+ Reporter.prototype[name] = async function (...args) {
145
+ for (const reporter of this.reporters) {
146
+ if (reporter?.[name]) {
147
+ await reporter[name](...args);
148
+ }
149
+ }
155
150
  };
156
151
  }
157
152
 
@@ -0,0 +1,286 @@
1
+ interface LoginModeOptions {
2
+ loginMode: true;
3
+ }
4
+
5
+ interface InitModeOptions {
6
+ initCodimMode: true;
7
+ initTestProject: string;
8
+ }
9
+
10
+ interface AgentModeOptions {
11
+ agentMode: true;
12
+ project?: string;
13
+ token?: string;
14
+ agentPort: number;
15
+ agentBind?: string;
16
+ openEditor?: boolean;
17
+ installPlaygroundPlaywrightDeps: boolean;
18
+ installPlaygroundPuppeteerDeps: boolean;
19
+ installPlaygroundSeleniumDeps: boolean;
20
+ startTestimBrowser: boolean;
21
+ ext?: string;
22
+ extensionPath?: string;
23
+ playerLocation: string;
24
+ canary?: boolean;
25
+ playerPath?: string;
26
+ playerRequirePath?: string;
27
+ downloadBrowser: boolean;
28
+ }
29
+
30
+ interface TunnelDaemonOptions {
31
+ tunnelOnlyMode: true;
32
+ tunnelRoutes: string[];
33
+ tunnelRoutesOutput: string;
34
+ tunnelHostHeader?: string;
35
+ tunnelRegion?: string;
36
+ }
37
+ interface NgrokTunnelOptions {
38
+ tunnelPort: number;
39
+ tunnelDiagnostics?: boolean;
40
+ }
41
+
42
+ type TunnelOptions = (TunnelDaemonOptions | NgrokTunnelOptions) & {
43
+ tunnel: true;
44
+ tunnelUseHttpAddress?: boolean;
45
+ token: string;
46
+ project: string;
47
+ };
48
+
49
+ type CodeCoverageReporter = 'clover' | 'html' | 'json-summary' | 'json' | 'lcov' | 'lcovonly' | 'teamcity' | 'text-lcov' | 'text-summary' | 'text';
50
+
51
+ interface LightweightSettings {
52
+ type: 'lightweight' | 'turboMode';
53
+ general: boolean;
54
+ disableLabs: boolean;
55
+ disableFeatureFlags: boolean;
56
+ disableAssets: boolean;
57
+ disablePixelValidation: boolean;
58
+ disableResults: boolean;
59
+ disableStepDelay: boolean;
60
+ disableRemoteStep: boolean;
61
+ assumePreloadedSharedSteps: boolean;
62
+ disableVisibilityCheck: boolean;
63
+ disableLocators: boolean;
64
+ bypassSetup: boolean;
65
+ disableAutoImprove: boolean;
66
+ disableQuotaBlocking: boolean;
67
+ onlyTestIdsNoSuite: boolean;
68
+ uploadAssetsAndResultsOnFailure: boolean;
69
+ preloadTests: boolean;
70
+ disableProjectDefaults: boolean;
71
+ }
72
+
73
+ type InitUserWithAuth = Awaited<ReturnType<typeof import('./commons/testimServicesApi')['initializeUserWithAuth']>>;
74
+ interface ProjectData extends Pick<InitUserWithAuth['projectById'], 'type' | 'name' | 'defaults'> {
75
+ projectId: string;
76
+ }
77
+
78
+ // TODO: consider typing better, based on the validations we do (example: must have one of grid/grid-id/host&port/test plan)
79
+ interface RunnerOptions extends Partial<Omit<TunnelOptions, 'tunnelOnlyMode' | 'tunnel'>> {
80
+ token: string;
81
+ project: string;
82
+ user?: string;
83
+ webpackConfig?: string;
84
+ headless?: boolean;
85
+ disableNativeEvents?: boolean;
86
+ baseUrl?: string;
87
+ branch: string;
88
+ autoDetect: boolean;
89
+ userParamsData: object;
90
+ mode: 'selenium' | 'extension';
91
+ isRegressionBaselineRun?: boolean;
92
+ canary?: boolean;
93
+ rerunFailedByRunId?: string;
94
+ disableTimeoutRetry?: boolean;
95
+ resultLabels: string[];
96
+ path?: string;
97
+ protocol?: string;
98
+ testobjectSauce: { testobjectApiKey?: string };
99
+ overrideExecutionName?: string;
100
+ passZeroTests: boolean;
101
+ runQuarantinedTests: boolean;
102
+ downloadBrowser: boolean;
103
+ disableSockets: boolean;
104
+ disableCookiesSameSiteNoneRequiresSecure: boolean;
105
+ shouldMonitorPerformance?: boolean;
106
+ exitCodeIgnoreFailingTests?: boolean;
107
+ seleniumCapsFileContent: object;
108
+ retentionDays?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
109
+ retries?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
110
+
111
+ // #region Data set based on values from server
112
+ company: {
113
+ companyId: string;
114
+ onprem: boolean;
115
+ storageBaseUrl: string;
116
+ storageType: string;
117
+ name: string;
118
+ planType: 'pro' | 'free' | 'trial';
119
+ isPOC: boolean;
120
+ isStartUp: boolean;
121
+ activePlan: import('services/src/commons/mongo/db-dto-definitions/DbCompanyProjects').Plan;
122
+ };
123
+ gridData?: Awaited<ReturnType<typeof import('./services/gridService')['getGridData']>>;
124
+ sfdcCredential?: string;
125
+ editorUrl?: string;
126
+ allGrids?: InitUserWithAuth['allGrids'];
127
+ authData?: InitUserWithAuth['authData'];
128
+ projectData?: ProjectData;
129
+ // #endregion
130
+
131
+ // #region What to execute
132
+ testId: string[];
133
+ name: string[];
134
+ label: string[];
135
+ suites: string[];
136
+ suiteIds: string[];
137
+ testPlan: string[];
138
+ testPlanIds: string[];
139
+ files: string[];
140
+ // #endregion
141
+
142
+ // #region Test config to use
143
+ testConfigNames?: string[];
144
+ testConfigIds?: string[];
145
+ // #endregion
146
+
147
+ // #region Grid details
148
+ grid?: string;
149
+ gridId?: string;
150
+ host?: string;
151
+ port?: number;
152
+ gridUsername?: string;
153
+ gridPassword?: string;
154
+ useLocalChromeDriver?: boolean;
155
+ chromeBinaryLocation?: string;
156
+ useChromeLauncher?: boolean;
157
+
158
+ disableGridCheck: boolean;
159
+ browser?: 'ie11' | 'ie' | 'internet explorer' | 'edge' | 'edge-chromium' | 'firefox' | 'safari' | 'chrome';
160
+
161
+ proxyForGrid: string;
162
+
163
+ experitestToken?: string;
164
+ saucelabs: { username: string; accessKey: string };
165
+ perfecto: { securityToken?: string; location?: string };
166
+ browserstack: { 'browserstack.user': string; 'browserstack.key': string };
167
+ // #endregion
168
+
169
+ // #region Report settings
170
+ reportFile?: string;
171
+ reportFileClassname?: string;
172
+ reporters?: string[];
173
+ // #endregion
174
+
175
+ // #region Parallel settings
176
+ beforeParallel: number;
177
+ parallel: number;
178
+ afterParallel: number;
179
+ //#endregion
180
+
181
+ // #region TMS
182
+ tmsSuppressReporting: boolean;
183
+ tmsRunId?: string;
184
+ tmsCustomFields?: string;
185
+ // #endregion
186
+
187
+ // #region Extension debugging
188
+ ext?: string;
189
+ extensionLocation: string[];
190
+ extensionPath?: string;
191
+ // #endregion
192
+
193
+ // #region Session Player debugging
194
+ playerLocation: string;
195
+ playerPath?: string;
196
+ playerRequirePath?: string;
197
+ // #endregion
198
+
199
+ // #region Tunnel
200
+ tunnel?: boolean;
201
+ externalLambdatestTunnelId?: string;
202
+ externalLambdatestUseWss?: string;
203
+ externalLambdatestDisableAutomationTunneling: boolean;
204
+ externalLambdatestMitm: boolean;
205
+ // #endregion
206
+
207
+ // #region Hooks
208
+ beforeTest?: Function;
209
+ afterTest?: Function;
210
+ beforeSuite?: Function;
211
+ afterSuite?: Function;
212
+ // #endregion
213
+
214
+ // #region Timeouts
215
+ testStartTimeout: number;
216
+ timeout: number;
217
+ timeoutWasGiven: boolean;
218
+ browserTimeout: number;
219
+ newBrowserWaitTimeout: number;
220
+ getBrowserTimeout: number;
221
+ getBrowserRetries: number;
222
+ getSessionTimeout: number;
223
+ getSessionRetries: number;
224
+ driverRequestTimeout: number;
225
+ driverRequestRetries: number;
226
+ // #endregion
227
+
228
+ // #region Mock network
229
+ overrideMappingFile?: string;
230
+ mockNetworkRules?: object;
231
+ disableMockNetwork?: boolean;
232
+ // #endregion
233
+
234
+ // #region Code coverage
235
+ codeCoverageUrlFilter?: string;
236
+ collectCodeCoverage?: boolean;
237
+ codeCoverageReportPath?: string;
238
+ codeCoverageSourceMapPath?: string;
239
+ codeCoverageReporter: CodeCoverageReporter[];
240
+ codeCoverageInclude: string[];
241
+ // #endregion
242
+
243
+ // #region Remote run options
244
+ executionId?: string;
245
+ remoteRunId?: string;
246
+ schedulerId?: string;
247
+ source?: string;
248
+ resultId?: string;
249
+ // #endregion
250
+
251
+ // #region Customer Extension
252
+ installCustomExtension?: string;
253
+ // #endregion
254
+
255
+ // #region Capabilities format
256
+ w3cCapabilities: boolean;
257
+ oldCapabilities: boolean;
258
+ // #endregion
259
+
260
+ // #region Chrome specific settings
261
+ chromeBlockLocation: boolean;
262
+ chromeUserDataDir: false | string;
263
+ chromeExtraPrefs: object;
264
+ chromeExtraArgs: string[];
265
+ // #endregion
266
+
267
+ // #region Lightweight / Turbo Mode
268
+ lightweightMode?: LightweightSettings;
269
+ createPrefechedData?: boolean;
270
+ saveRCALocally?: boolean | string;
271
+ localRCASaver?: string;
272
+ // #endregion
273
+
274
+ // #region intersections
275
+ intersections: { labels?: string[]; suiteNames?: string[]; suiteIds?: string[] };
276
+ // #endregion
277
+ }
278
+
279
+ type Options = |
280
+ LoginModeOptions |
281
+ InitModeOptions |
282
+ AgentModeOptions |
283
+ TunnelOptions |
284
+ RunnerOptions;
285
+
286
+ export function process(): Promise<Options>;