@testim/testim-cli 3.266.0 → 3.268.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.
@@ -17,31 +17,39 @@ const { preloadTests } = require('../commons/preloadTests');
17
17
  const NO_NAVIGATION_TIME_LIMIT = 1e9;
18
18
 
19
19
  class WorkerSelenium extends BaseWorker {
20
- constructor(...args) {
21
- super(...args);
22
- this.getBrowserOnce = Promise.method(this.getBrowserOnce);
23
- }
24
-
20
+ /**
21
+ * @override
22
+ * @param {import('../testRunHandler')} testRunHandler
23
+ */
25
24
  initPlayer(testRunHandler) {
26
- return new SeleniumTestPlayer(this.id,
27
- testRunHandler.getRunParams(),
25
+ return new SeleniumTestPlayer(
26
+ this.id,
27
+ testRunHandler.runParams,
28
28
  this.options.shouldMonitorPerformance,
29
- testRunHandler.getAutomationMode(),
29
+ testRunHandler.automationMode,
30
30
  undefined,
31
- testRunHandler.getRetryCount(),
32
- testRunHandler.getPreviousTestResultId());
31
+ testRunHandler.retryCount,
32
+ testRunHandler.previousTestResultId,
33
+ );
33
34
  }
34
35
 
36
+ /**
37
+ * @override
38
+ * @param {import('../testRunHandler')} testRunHandler
39
+ * @param {string=} customExtensionLocalLocation
40
+ * @param {SeleniumTestPlayer} seleniumTestPlayer
41
+ * @param {Awaited<ReturnType<import('../services/gridService')['handleHybridOrVendorIfNeeded']>>} gridInfo
42
+ */
35
43
  async getBrowserOnce(testRunHandler, customExtensionLocalLocation, seleniumTestPlayer, gridInfo) {
36
44
  perf.log('in WorkerSelenium getBrowserOnce');
37
- reporter.onGetSession(this.id, this.testName, testRunHandler.getRunMode());
45
+ reporter.onGetSession(this.id, this.testName, testRunHandler.runMode);
38
46
  const { driver } = seleniumTestPlayer;
39
47
 
40
48
  this.windowUtils = new WindowUtils(this.id, driver);
41
49
  seleniumTestPlayer.clearSessionTabs();
42
50
 
43
51
  const { browserValue } = this.testRunConfig;
44
- const baseUrl = testRunHandler.getBaseUrl();
52
+ const baseUrl = testRunHandler.baseUrl;
45
53
 
46
54
  try {
47
55
  const fastInit = this.options.useLocalChromeDriver;
@@ -81,6 +89,7 @@ class WorkerSelenium extends BaseWorker {
81
89
  }
82
90
 
83
91
  /**
92
+ * @override
84
93
  * @param {import('../testRunHandler')} testRunHandler
85
94
  * @param {import('../player/seleniumTestPlayer')} seleniumTestPlayer
86
95
  */
@@ -92,12 +101,12 @@ class WorkerSelenium extends BaseWorker {
92
101
 
93
102
  setupCliPerformanceMonitoring(sessionPlayer);
94
103
 
95
- sessionPlayer.playbackManager.executionId = testRunHandler.getExecutionId();
96
- sessionPlayer.playbackManager.executionName = testRunHandler.getExecutionName();
104
+ sessionPlayer.playbackManager.executionId = testRunHandler.executionId;
105
+ sessionPlayer.playbackManager.executionName = testRunHandler.executionName;
97
106
 
98
107
  sessionPlayer.setLightweightMode(this.options.lightweightMode);
99
- if (testRunHandler.getSfdcCredential()) {
100
- sessionPlayer.setSfdcCredential(testRunHandler.getSfdcCredential());
108
+ if (testRunHandler.sfdcCredential) {
109
+ sessionPlayer.setSfdcCredential(testRunHandler.sfdcCredential);
101
110
  }
102
111
  if (sessionPlayerInit.localAssetService) {
103
112
  sessionPlayerInit.localAssetService.initialize({ serverUrl: this.options.localRCASaver });
@@ -110,7 +119,7 @@ class WorkerSelenium extends BaseWorker {
110
119
  }
111
120
 
112
121
  async function runSeleniumTest() {
113
- if (testRunHandler.getAutomationMode() === 'codeful') {
122
+ if (testRunHandler.automationMode === 'codeful') {
114
123
  // Testim Development Kit test;
115
124
  if (!sessionPlayer.callOrderScheduler) { // old session player
116
125
  await testRunHandler.waitForExecutionStartedFinished();
@@ -133,8 +142,8 @@ class WorkerSelenium extends BaseWorker {
133
142
  false,
134
143
  this.overrideTestConfigId,
135
144
  this.branch,
136
- testRunHandler.getCode(),
137
- testRunHandler.getTestName()
145
+ testRunHandler.code,
146
+ testRunHandler.testName
138
147
  ).catch(reject))
139
148
  .log('right after playTestByCode')
140
149
  .timeout(this.testRunTimeout, timeoutMessages.TEST_COMPLETE_TIMEOUT_MSG)
@@ -164,7 +173,7 @@ class WorkerSelenium extends BaseWorker {
164
173
  this.overrideTestConfigId,
165
174
  this.branch,
166
175
  INCOGNITO,
167
- testRunHandler.getRemoteRunId(),
176
+ testRunHandler.remoteRunId,
168
177
  undefined,
169
178
  undefined,
170
179
  preloadedTest