@testim/testim-cli 3.289.0 → 3.290.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 (217) hide show
  1. package/cli.js +22390 -122
  2. package/cli.js.map +1 -0
  3. package/npm-shrinkwrap.json +1951 -203
  4. package/package.json +9 -5
  5. package/OverrideTestDataBuilder.js +0 -117
  6. package/agent/routers/cliJsCode/index.js +0 -13
  7. package/agent/routers/cliJsCode/router.js +0 -63
  8. package/agent/routers/cliJsCode/service.js +0 -705
  9. package/agent/routers/codim/router.js +0 -69
  10. package/agent/routers/codim/router.test.js +0 -60
  11. package/agent/routers/codim/service.js +0 -193
  12. package/agent/routers/general/index.js +0 -36
  13. package/agent/routers/hybrid/registerRoutes.js +0 -81
  14. package/agent/routers/index.js +0 -56
  15. package/agent/routers/playground/router.js +0 -77
  16. package/agent/routers/playground/service.js +0 -96
  17. package/agent/routers/standalone-browser/registerRoutes.js +0 -47
  18. package/agent/server.js +0 -150
  19. package/cdpTestRunner.js +0 -86
  20. package/chromiumInstaller.js +0 -91
  21. package/cli/isCiRun.js +0 -10
  22. package/cli/onExit.js +0 -65
  23. package/cli/writeStackTrace.js +0 -27
  24. package/cliAgentMode.js +0 -384
  25. package/codim/codim-cli.js +0 -91
  26. package/codim/codim-npm-package/index.ts +0 -427
  27. package/codim/codim-npm-package/package-lock.json +0 -14
  28. package/codim/codim-npm-package/package.json +0 -14
  29. package/codim/hybrid-utils.js +0 -28
  30. package/codim/measure-perf.js +0 -41
  31. package/codim/template.js/.idea/workspace.xml +0 -57
  32. package/codim/template.js/.vscode/launch.json +0 -53
  33. package/codim/template.ts/.idea/workspace.xml +0 -57
  34. package/codim/template.ts/.vscode/launch.json +0 -55
  35. package/commons/AbortError.js +0 -12
  36. package/commons/SeleniumPerfStats.js +0 -58
  37. package/commons/chrome-launcher.js +0 -15
  38. package/commons/chromedriverWrapper.js +0 -70
  39. package/commons/config.js +0 -39
  40. package/commons/constants.js +0 -67
  41. package/commons/detectDebugger.js +0 -19
  42. package/commons/featureAvailabilityService.js +0 -26
  43. package/commons/featureFlags.js +0 -132
  44. package/commons/getSessionPlayerRequire.js +0 -28
  45. package/commons/httpRequest.js +0 -261
  46. package/commons/httpRequestCounters.js +0 -98
  47. package/commons/httpRequestCounters.test.js +0 -38
  48. package/commons/initializeUserWithAuth.js +0 -55
  49. package/commons/lazyRequire.js +0 -105
  50. package/commons/logUtils.js +0 -15
  51. package/commons/logUtils.test.js +0 -21
  52. package/commons/logger.js +0 -178
  53. package/commons/mockNetworkRuleFileSchema.json +0 -140
  54. package/commons/npmWrapper.js +0 -174
  55. package/commons/npmWrapper.test.js +0 -374
  56. package/commons/performance-logger.js +0 -71
  57. package/commons/preloadTests.js +0 -29
  58. package/commons/prepareRunner.js +0 -85
  59. package/commons/prepareRunner.test.js +0 -144
  60. package/commons/prepareRunnerAndTestimStartUtils.js +0 -198
  61. package/commons/prepareRunnerAndTestimStartUtils.test.js +0 -73
  62. package/commons/requireWithFallback.js +0 -25
  63. package/commons/runnerFileCache.js +0 -204
  64. package/commons/socket/baseSocketServiceSocketIO.js +0 -197
  65. package/commons/socket/realDataService.js +0 -59
  66. package/commons/socket/realDataServiceSocketIO.js +0 -33
  67. package/commons/socket/remoteStepService.js +0 -55
  68. package/commons/socket/remoteStepServiceSocketIO.js +0 -61
  69. package/commons/socket/socketService.js +0 -175
  70. package/commons/socket/testResultService.js +0 -62
  71. package/commons/socket/testResultServiceSocketIO.js +0 -64
  72. package/commons/testimAnalytics.js +0 -40
  73. package/commons/testimCloudflare.js +0 -83
  74. package/commons/testimCloudflare.test.js +0 -185
  75. package/commons/testimCustomToken.js +0 -124
  76. package/commons/testimDesiredCapabilitiesBuilder.js +0 -647
  77. package/commons/testimNgrok.js +0 -90
  78. package/commons/testimNgrok.test.js +0 -140
  79. package/commons/testimServicesApi.js +0 -631
  80. package/commons/testimTunnel.js +0 -73
  81. package/commons/testimTunnel.test.js +0 -172
  82. package/commons/xhr2.js +0 -897
  83. package/coverage/SummaryToObjectReport.js +0 -19
  84. package/coverage/jsCoverage.js +0 -252
  85. package/credentialsManager.js +0 -142
  86. package/errors.js +0 -161
  87. package/executionQueue.js +0 -37
  88. package/fixLocalBuild.js +0 -24
  89. package/inputFileUtils.js +0 -103
  90. package/lib/coralogix-winston.transport.js +0 -99
  91. package/player/SeleniumProtocolError.js +0 -100
  92. package/player/WebDriverHttpRequest.js +0 -177
  93. package/player/WebdriverioWebDriverApi.js +0 -671
  94. package/player/appiumTestPlayer.js +0 -90
  95. package/player/chromeLauncherTestPlayer.js +0 -67
  96. package/player/constants.js +0 -332
  97. package/player/extensionTestPlayer.js +0 -32
  98. package/player/findElementStrategy.js +0 -154
  99. package/player/scripts/isElementDisplayed.js +0 -252
  100. package/player/seleniumTestPlayer.js +0 -140
  101. package/player/services/frameLocator.js +0 -170
  102. package/player/services/mobileFrameLocatorMock.js +0 -32
  103. package/player/services/playbackTimeoutCalculator.js +0 -175
  104. package/player/services/portSelector.js +0 -19
  105. package/player/services/tabService.js +0 -551
  106. package/player/services/tabServiceMock.js +0 -167
  107. package/player/services/windowCreationListener.js +0 -8
  108. package/player/stepActions/RefreshStepAction.js +0 -16
  109. package/player/stepActions/apiStepAction.js +0 -89
  110. package/player/stepActions/baseCliJsStepAction.js +0 -51
  111. package/player/stepActions/baseJsStepAction.js +0 -277
  112. package/player/stepActions/cliConditionStepAction.js +0 -11
  113. package/player/stepActions/cliJsStepAction.js +0 -11
  114. package/player/stepActions/dropFileStepAction.js +0 -34
  115. package/player/stepActions/evaluateExpressionStepAction.js +0 -52
  116. package/player/stepActions/extensionOnlyStepAction.js +0 -12
  117. package/player/stepActions/extractTextStepAction.js +0 -19
  118. package/player/stepActions/hoverStepAction.js +0 -55
  119. package/player/stepActions/inputFileStepAction.js +0 -199
  120. package/player/stepActions/jsCodeStepAction.js +0 -11
  121. package/player/stepActions/jsConditionStepAction.js +0 -11
  122. package/player/stepActions/locateStepAction.js +0 -159
  123. package/player/stepActions/mouseStepAction.js +0 -370
  124. package/player/stepActions/navigationStepAction.js +0 -29
  125. package/player/stepActions/nodePackageStepAction.js +0 -47
  126. package/player/stepActions/pixelValidationStepAction.js +0 -39
  127. package/player/stepActions/scripts/dispatchEvents.js +0 -282
  128. package/player/stepActions/scripts/doClick.js +0 -221
  129. package/player/stepActions/scripts/doDragPath.js +0 -225
  130. package/player/stepActions/scripts/doubleClick.js +0 -119
  131. package/player/stepActions/scripts/dropEvent.js +0 -63
  132. package/player/stepActions/scripts/focusElement.js +0 -46
  133. package/player/stepActions/scripts/html5dragAction.js +0 -56
  134. package/player/stepActions/scripts/html5dragActionV2.js +0 -312
  135. package/player/stepActions/scripts/runCode.js +0 -147
  136. package/player/stepActions/scripts/scroll.js +0 -90
  137. package/player/stepActions/scripts/selectOption.js +0 -51
  138. package/player/stepActions/scripts/setText.js +0 -415
  139. package/player/stepActions/scripts/wheel.js +0 -61
  140. package/player/stepActions/scrollStepAction.js +0 -96
  141. package/player/stepActions/selectOptionStepAction.js +0 -49
  142. package/player/stepActions/sfdcRecordedStepAction.js +0 -24
  143. package/player/stepActions/sfdcStepAction.js +0 -28
  144. package/player/stepActions/sleepStepAction.js +0 -12
  145. package/player/stepActions/specialKeyStepAction.js +0 -52
  146. package/player/stepActions/stepAction.js +0 -73
  147. package/player/stepActions/stepActionRegistrar.js +0 -111
  148. package/player/stepActions/submitStepAction.js +0 -12
  149. package/player/stepActions/tdkHybridStepAction.js +0 -18
  150. package/player/stepActions/textStepAction.js +0 -110
  151. package/player/stepActions/textValidationStepAction.js +0 -64
  152. package/player/stepActions/wheelStepAction.js +0 -41
  153. package/player/utils/cookieUtils.js +0 -39
  154. package/player/utils/eyeSdkService.js +0 -250
  155. package/player/utils/imageCaptureUtils.js +0 -267
  156. package/player/utils/screenshotUtils.js +0 -68
  157. package/player/utils/stepActionUtils.js +0 -90
  158. package/player/utils/windowUtils.js +0 -195
  159. package/player/webDriverUtils.js +0 -40
  160. package/player/webDriverUtils.test.js +0 -116
  161. package/player/webdriver.js +0 -976
  162. package/polyfills/Array.prototype.at.js +0 -13
  163. package/polyfills/index.js +0 -13
  164. package/processHandler.js +0 -79
  165. package/processHandler.test.js +0 -55
  166. package/reports/chromeReporter.js +0 -17
  167. package/reports/consoleReporter.js +0 -190
  168. package/reports/debugReporter.js +0 -82
  169. package/reports/jsonReporter.js +0 -55
  170. package/reports/junitReporter.js +0 -183
  171. package/reports/reporter.js +0 -166
  172. package/reports/reporterUtils.js +0 -54
  173. package/reports/teamCityReporter.js +0 -73
  174. package/runOptions.d.ts +0 -305
  175. package/runOptions.js +0 -1288
  176. package/runOptionsAgentFlow.js +0 -87
  177. package/runOptionsUtils.js +0 -60
  178. package/runner.js +0 -355
  179. package/runners/ParallelWorkerManager.js +0 -284
  180. package/runners/TestPlanRunner.js +0 -419
  181. package/runners/buildCodeTests.js +0 -159
  182. package/runners/runnerUtils.js +0 -81
  183. package/services/analyticsService.js +0 -96
  184. package/services/branchService.js +0 -29
  185. package/services/gridService.js +0 -357
  186. package/services/gridService.test.js +0 -357
  187. package/services/labFeaturesService.js +0 -64
  188. package/services/lambdatestService.js +0 -227
  189. package/services/lambdatestService.test.js +0 -353
  190. package/services/localRCASaver.js +0 -124
  191. package/stepPlayers/cliJsStepPlayback.js +0 -40
  192. package/stepPlayers/hybridStepPlayback.js +0 -140
  193. package/stepPlayers/nodePackageStepPlayback.js +0 -28
  194. package/stepPlayers/playwrightHybridStepPlayback.js +0 -61
  195. package/stepPlayers/puppeteerHybridStepPlayback.js +0 -76
  196. package/stepPlayers/remoteStepPlayback.js +0 -80
  197. package/stepPlayers/seleniumHybridStepPlayback.js +0 -84
  198. package/stepPlayers/tdkHybridStepPlayback.js +0 -112
  199. package/testRunHandler.js +0 -603
  200. package/testRunStatus.js +0 -567
  201. package/testimNpmDriver.js +0 -52
  202. package/utils/argsUtils.js +0 -91
  203. package/utils/argsUtils.test.js +0 -32
  204. package/utils/fsUtils.js +0 -174
  205. package/utils/index.js +0 -197
  206. package/utils/promiseUtils.js +0 -85
  207. package/utils/stringUtils.js +0 -98
  208. package/utils/stringUtils.test.js +0 -22
  209. package/utils/timeUtils.js +0 -25
  210. package/utils/utils.test.js +0 -27
  211. package/workers/BaseWorker.js +0 -498
  212. package/workers/BaseWorker.test.js +0 -186
  213. package/workers/WorkerAppium.js +0 -180
  214. package/workers/WorkerExtension.js +0 -192
  215. package/workers/WorkerExtensionSingleBrowser.js +0 -77
  216. package/workers/WorkerSelenium.js +0 -253
  217. package/workers/workerUtils.js +0 -20
@@ -1,57 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="RunManager">
4
- <configuration default="true" type="js.build_tools.npm">
5
- <package-json value="$PROJECT_DIR$/package.json" />
6
- <command value="run" />
7
- <scripts>
8
- <script value="debug-examples" />
9
- </scripts>
10
- <node-interpreter value="project" />
11
- <envs />
12
- <method v="2" />
13
- </configuration>
14
- <configuration name="run examples" type="js.build_tools.npm" nameIsGenerated="true">
15
- <package-json value="$PROJECT_DIR$/package.json" />
16
- <command value="run" />
17
- <scripts>
18
- <script value="debug-examples" />
19
- </scripts>
20
- <node-interpreter value="project" />
21
- <envs />
22
- <method v="2" />
23
- </configuration>
24
- <configuration name="run tests" type="js.build_tools.npm" nameIsGenerated="true">
25
- <package-json value="$PROJECT_DIR$/package.json" />
26
- <command value="run" />
27
- <scripts>
28
- <script value="debug" />
29
- </scripts>
30
- <node-interpreter value="project" />
31
- <envs />
32
- <method v="2" />
33
- </configuration>
34
- <configuration name="run open file" type="js.build_tools.npm" nameIsGenerated="true">
35
- <package-json value="$PROJECT_DIR$/package.json" />
36
- <command value="run" />
37
- <scripts>
38
- <script value="debug-file" />
39
- </scripts>
40
- <arguments value="$FilePath$" />
41
- <node-interpreter value="project" />
42
- <envs />
43
- <method v="2" />
44
- </configuration>
45
- <configuration name="run headless" type="js.build_tools.npm" nameIsGenerated="true">
46
- <package-json value="$PROJECT_DIR$/package.json" />
47
- <command value="run" />
48
- <scripts>
49
- <script value="headless" />
50
- </scripts>
51
- <node-interpreter value="project" />
52
- <envs />
53
- <method v="2" />
54
- </configuration>
55
-
56
- </component>
57
- </project>
@@ -1,55 +0,0 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "type": "node",
9
- "request": "launch",
10
- "name": "Run Examples",
11
- "runtimeExecutable": "npm",
12
- "runtimeArgs": [
13
- "run-script",
14
- "debug-examples"
15
- ],
16
- "port": 9229
17
- },
18
- {
19
- "type": "node",
20
- "request": "launch",
21
- "name": "Run Tests",
22
- "runtimeExecutable": "npm",
23
- "outputCapture": "std",
24
- "runtimeArgs": [
25
- "run-script",
26
- "debug"
27
- ],
28
- "port": 9229
29
- },
30
- {
31
- "type": "node",
32
- "request": "launch",
33
- "name": "Run Open File",
34
- "runtimeExecutable": "npm",
35
- "outputCapture": "std",
36
- "runtimeArgs": [
37
- "run-script",
38
- "debug-file",
39
- "${file}"
40
- ],
41
- "port": 9229
42
- },
43
- {
44
- "type": "node",
45
- "request": "launch",
46
- "name": "Run Headless",
47
- "runtimeExecutable": "npm",
48
- "runtimeArgs": [
49
- "run-script",
50
- "headless"
51
- ],
52
- "port": 9229
53
- }
54
- ]
55
- }
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- class AbortError extends Error {
4
- constructor(message = 'aborted') {
5
- super(message);
6
- this.name = 'AbortError';
7
- }
8
- }
9
-
10
- module.exports = {
11
- AbortError,
12
- };
@@ -1,58 +0,0 @@
1
- 'use strict';
2
-
3
- const _ = require('lodash');
4
- const { guid, calcPercentile } = require('../utils');
5
-
6
- const SELENIUM_PERF_MARKS = {
7
- GET_BROWSER: 'GET_BROWSER',
8
- GET_HTML: 'GET_HTML',
9
- GET_ELEMENT: 'GET_ELEMENT',
10
- GET_SCREENSHOT: 'GET_SCREENSHOT',
11
- };
12
-
13
- class SeleniumPerfStats {
14
- constructor() {
15
- this.marks = _.mapValues(SELENIUM_PERF_MARKS, () => []);
16
- this.marks.ALL = [];
17
- this.startTimes = {};
18
- }
19
-
20
- markStart(mark) {
21
- const id = guid();
22
- this.startTimes[`${mark}:${id}`] = Date.now();
23
- return id;
24
- }
25
-
26
- markEnd(id, mark) {
27
- const markDuration = Date.now() - this.startTimes[`${mark}:${id}`];
28
- delete this.startTimes[`${mark}:${id}`];
29
-
30
- if (!this.marks[mark]) {
31
- this.marks.ALL.push(markDuration);
32
- return;
33
- }
34
- this.marks[mark].push(markDuration);
35
- }
36
-
37
- getStats() {
38
- return {
39
- seleniumPerfMarks: this.marks,
40
- seleniumStats: _.chain(this.marks).transform(
41
- (result, samples, key) => {
42
- if (_.isEmpty(samples)) {
43
- return;
44
- }
45
- result[`${key}_COUNT`] = samples.length;
46
- result[`${key}_P50`] = calcPercentile(samples, 50);
47
- result[`${key}_P95`] = calcPercentile(samples, 95);
48
- },
49
- {}
50
- ).value(),
51
- };
52
- }
53
- }
54
-
55
- module.exports = {
56
- SELENIUM_PERF_MARKS,
57
- SeleniumPerfStats,
58
- };
@@ -1,15 +0,0 @@
1
- 'use strict';
2
-
3
- const { exec } = require('child_process');
4
-
5
- module.exports.launchChrome = function (url) {
6
- const { platform } = process;
7
-
8
- if (platform === 'win32') {
9
- exec(`start chrome ${url}`);
10
- } else if (platform === 'darwin') {
11
- exec(`open -a "Google Chrome" ${url}`);
12
- } else if (platform === 'linux') {
13
- exec(`google-chrome ${url}`);
14
- }
15
- };
@@ -1,70 +0,0 @@
1
- /* eslint-disable no-console */
2
-
3
- const fkill = require('fkill');
4
- const pRetry = require('p-retry');
5
-
6
- const httpRequest = require('./httpRequest');
7
- const npmWrapper = require('./npmWrapper');
8
- const { getCliLocation } = require('../utils');
9
- const { requireWithFallback } = require('./requireWithFallback');
10
-
11
- const PACKAGE_NAME = 'chromedriver';
12
- const DRIVER_PORT = 9515;
13
- const DRIVER_BASE_URL = `http://localhost:${DRIVER_PORT}/wd/hub`;
14
- const DEFAULT_DRIVER_ARGS = [
15
- // webdriverio expects a wd/hub (selenium-server like server endpoint)
16
- '--url-base=/wd/hub',
17
- // don't complain about driver version
18
- '--disable-build-check',
19
- // allow any ip to connect chrome driver
20
- '--whitelisted-ips=0.0.0.0',
21
- '--log-level=OFF', // instead we could try to log it somehow or at least have a flag to enable this
22
- ];
23
-
24
- // [NOTE] This is a "smart installation":
25
- // By default chromedriver package, when installed, will search for an existing binary in the configured temp directory.
26
- // If found, and it is the correct version, it will simply copy it to your node_modules directory, and if not it will download the newer version.
27
- const install = async () => {
28
- await npmWrapper.installPackageLocally(getCliLocation(), `${PACKAGE_NAME} --detect_chromedriver_version`);
29
- };
30
-
31
- const start = async () => {
32
- // remove --inspect before starting chromedriver
33
- process.env.NODE_OPTIONS = '';
34
-
35
- // kill any localhost running chromedriver instance
36
- await fkill(`:${DRIVER_PORT}`, { silent: true });
37
-
38
- const chromedriver = requireWithFallback(PACKAGE_NAME);
39
- await chromedriver.start(DEFAULT_DRIVER_ARGS, true);
40
- };
41
-
42
- const isReady = async ({ chromeBinaryLocation }) => {
43
- // 100 tries, every 30ms
44
- await pRetry(async () => {
45
- const statusResponse = await httpRequest.get(`${DRIVER_BASE_URL}/status`);
46
- if (!statusResponse || !statusResponse.value || !statusResponse.value.ready) {
47
- throw new Error('status failed');
48
- }
49
-
50
- const chromeOptions = {};
51
- if (chromeBinaryLocation) {
52
- chromeOptions.binary = chromeBinaryLocation;
53
- }
54
- const sessionResponse = await httpRequest.post({
55
- url: `${DRIVER_BASE_URL}/session`,
56
- body: { desiredCapabilities: { browserName: 'chrome', chromeOptions } },
57
- headers: { 'Content-Type': 'application/json' },
58
- });
59
- if (!sessionResponse || sessionResponse.status !== 0 || !sessionResponse.sessionId) {
60
- throw new Error('create session failed');
61
- }
62
- await httpRequest.delete(`${DRIVER_BASE_URL}/session/${sessionResponse.sessionId}`);
63
- }, { retries: 100, minTimeout: 30 });
64
- };
65
-
66
- module.exports = {
67
- install,
68
- start,
69
- isReady,
70
- };
package/commons/config.js DELETED
@@ -1,39 +0,0 @@
1
- 'use strict';
2
-
3
- let SERVICES_HOST = process.env.SERVICES_HOST || 'https://services.testim.io';
4
- const canonicalBlobURL = 'https://testimstatic.blob.core.windows.net';
5
- const canonicalEdgeUrl = 'https://tstresultfiles.azureedge.net';
6
- if (process.env.GATEWAY_URL) {
7
- process.env.CORALOGIX_URL = `${process.env.GATEWAY_URL}/testim/coralogix/api/v1/logs`;
8
- process.env.SERVICES_HOST = `${process.env.GATEWAY_URL}/testim/services`;
9
- // set the services for the extension
10
- process.env.EXTENSION_SERVICES_HOST = process.env.TUNNEL_GATEWAY ? process.env.SERVICES_HOST : SERVICES_HOST;
11
- SERVICES_HOST = process.env.SERVICES_HOST;
12
- }
13
-
14
- module.exports = {
15
- DISABLE_AGENT_ORIGIN_CHECK: parseInt(process.env.DISABLE_AGENT_ORIGIN_CHECK || '0'),
16
- DISABLE_DEBUGGER_INFINITE_TIMEOUT: parseInt(process.env.DISABLE_DEBUGGER_INFINITE_TIMEOUT || '0'),
17
- OVERRIDE_TIMEOUTS: parseInt(process.env.OVERRIDE_TIMEOUTS || '0'),
18
- EDITOR_URL: process.env.EDITOR_URL,
19
- WEBSOCKET_HOST: process.env.WEBSOCKET_HOST || `${SERVICES_HOST}/ws`,
20
- SERVICES_HOST,
21
- LOGGER_CONSOLE: parseInt(process.env.LOGGER_CONSOLE || '0'),
22
- LOGGER_DEBUG: parseInt(process.env.LOGGER_DEBUG || '0'),
23
- WEBDRIVER_DEBUG: parseInt(process.env.WEBDRIVER_DEBUG || '0'),
24
- IS_ON_PREM: parseInt(process.env.IS_ON_PREM || '0'),
25
- REQUESTS_QUEUE_SIZE: process.env.REQUESTS_QUEUE_SIZE ? parseInt(process.env.REQUESTS_QUEUE_SIZE) : undefined,
26
- DEBUG_MODE: parseInt(process.env.DEBUG_MODE || '0'),
27
- TESTIM_CONCURRENT_WORKER_COUNT: process.env.TESTIM_CONCURRENT_WORKER_COUNT ? parseInt(process.env.TESTIM_CONCURRENT_WORKER_COUNT) : null,
28
- ROLLOUT_KEY: process.env.ROLLOUT_KEY || '5b5560729601aa6484276518',
29
- DF_ENABLE_VIDEO: parseInt(process.env.DF_ENABLE_VIDEO || '0'),
30
- START_WORKER_DELAY_MS: parseInt(process.env.START_WORKER_DELAY_MS || 1500),
31
- APPIUM_VERSION: process.env.APPIUM_VERSION || '1.10.1',
32
-
33
- GATEWAY_URL: process.env.GATEWAY_URL,
34
- EXTENSION_SERVICES_HOST: process.env.EXTENSION_SERVICES_HOST || SERVICES_HOST,
35
- BLOB_URL: process.env.GATEWAY_URL ? `${process.env.GATEWAY_URL}/testim/blob` : canonicalBlobURL,
36
- EDGE_URL: process.env.GATEWAY_URL ? `${process.env.GATEWAY_URL}/testim/edge` : canonicalEdgeUrl,
37
- CANONICAL_BLOB_URL: canonicalBlobURL,
38
- CANONICAL_EDGE_URL: canonicalEdgeUrl,
39
- };
@@ -1,67 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- timeoutMessages: {
5
- GET_BROWSER_TIMEOUT_MSG: 'get-browser-timeout',
6
- TEST_START_TIMEOUT_MSG: 'test-start-timeout',
7
- TEST_COMPLETE_TIMEOUT_MSG: 'test-complete-timeout',
8
- },
9
- testRunStatus: {
10
- COMPLETED: 'completed',
11
- RUNNING: 'running',
12
- },
13
- runnerTestStatus: {
14
- PASSED: 'PASSED',
15
- FAILED: 'FAILED',
16
- ABORTED: 'ABORTED',
17
- SKIPPED: 'SKIPPED',
18
- QUEUED: 'QUEUED',
19
- },
20
- testStatus: {
21
- DRAFT: 'draft',
22
- EVALUATING: 'evaluating',
23
- ACTIVE: 'active',
24
- QUARANTINE: 'quarantine',
25
- },
26
- gridMessages: {
27
- NOT_FOUND: 'The specified grid is not available',
28
- UNKNOWN: "Test couldn't get browser - unknown error",
29
- },
30
- mobileWeb: {
31
- MOBILE_WEB_REMOTE_RUN_HEADER_SPACING: 50,
32
- },
33
- test: {
34
- HIDDEN_PARAM: 'TST_HIDDEN_PARAM',
35
- },
36
- socketEventTypes: {
37
- TEST_RESULT_CREATED: 'test-result-created',
38
- TEST_RESULT_UPDATED: 'test-result-updated',
39
- REMOTE_STEP_SAVED: 'remote-step-saved',
40
- },
41
- CLI_MODE: {
42
- EXTENSION: 'extension',
43
- SELENIUM: 'selenium',
44
- APPIUM: 'appium',
45
- },
46
- sessionType: {
47
- CODELESS: 'codeless',
48
- CODEFUL: 'codeful',
49
- },
50
- gridTypes: {
51
- TESTIM_ENTERPRISE: 'testimEnterprise',
52
- TESTIM: 'testim',
53
- LAMBDATEST: 'testimLambdaTest',
54
- DEVICE_FARM: 'testimDF',
55
- HYBRID: 'testimHybrid',
56
- BROWSERSTACK: 'browserstack',
57
- SAUCELABS: 'saucelabs',
58
- TESTIM_HEADSPIN: 'testimHeadspin',
59
- },
60
- stepResult: {
61
- SETUP_TIMEOUT: 'setup-timeout',
62
- NETWORK_ERROR: 'network-error',
63
- GRID_ERROR: 'grid-error',
64
- SELENIUM_ERROR: 'selenium-error',
65
- BROWSER_CLOSED: 'browser-closed',
66
- },
67
- };
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- const { DISABLE_DEBUGGER_INFINITE_TIMEOUT } = require('./config');
4
-
5
- module.exports.isDebuggerConnected = () => {
6
- try {
7
- if (DISABLE_DEBUGGER_INFINITE_TIMEOUT) {
8
- return false;
9
- }
10
- const inspector = require('inspector');
11
- //https://github.com/GoogleChrome/puppeteer/blob/14fb3e38db7c97fc3ea76c65e6f219b0ddb3b54f/utils/testrunner/TestRunner.js#L279
12
- if (inspector.url()) {
13
- return true;
14
- }
15
- } catch (e) {
16
- /* empty */
17
- }
18
- return false;
19
- };
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- const { gridTypes } = require('./constants');
4
-
5
- class FeatureAvailabilityService {
6
- constructor() {
7
- /**
8
- * @type {'free'|'trial'|'pro'}
9
- */
10
- this._planType = 'free';
11
- }
12
-
13
- setPlanType(planType) {
14
- this._planType = planType;
15
- }
16
-
17
- get isTestStatusEnabled() {
18
- return ['pro', 'trial'].includes(this._planType);
19
- }
20
-
21
- shouldShowFreeGridRunWarning(gridType) {
22
- return this._planType !== 'pro' && gridType === gridTypes.DEVICE_FARM;
23
- }
24
- }
25
-
26
- module.exports = new FeatureAvailabilityService();
@@ -1,132 +0,0 @@
1
- 'use strict';
2
-
3
- const Rox = require('rox-node');
4
- const { getLogger } = require('./logger');
5
- const { promiseTimeout } = require('../utils');
6
- const { ROLLOUT_KEY, IS_ON_PREM, GATEWAY_URL } = require('./config');
7
-
8
- const logger = getLogger('FeatureFlagsService');
9
-
10
- // IS_UNIT_TEST = disable rollout if code run in unit test mode to ignore mocha process stuck on running
11
- const USE_FEATURE_FLAGS = !IS_ON_PREM && !process.env.IS_UNIT_TEST && !GATEWAY_URL;
12
-
13
- const FORCE_FETCH_TIMEOUT_MS = 20000; // rollout sometimes takes up to 15 seconds to load
14
- const SEC_IN_DAY = 60 * 60 * 24;
15
-
16
- /** @type {['labs', 'disabled', 'enabled'] as const} */
17
- const LAB_FEATURE_FLAG_VALUES = ['labs', 'disabled', 'enabled'];
18
-
19
- class LabFeatureFlag extends Rox.Variant {
20
- constructor(initialValue = 'disabled') {
21
- super(initialValue, LAB_FEATURE_FLAG_VALUES);
22
- }
23
-
24
- /** @returns {(typeof LAB_FEATURE_FLAG_VALUES)[number]} */
25
- getValue() {
26
- const value = super.getValue();
27
- if (!LAB_FEATURE_FLAG_VALUES.includes(value)) {
28
- logger.warn('unexpected value for lab feature flag. Falling back to value "labs"', { featureFlagName: this.name, value });
29
- return 'labs';
30
- }
31
-
32
- return value;
33
- }
34
- }
35
-
36
- class FeatureFlagsService {
37
- constructor() {
38
- this.flags = {
39
- useNewWSCLI: new Rox.Flag(),
40
- useSafariWebdriverVisibilityChecks: new Rox.Flag(),
41
- useClickimVisibilityChecks: new Rox.Flag(),
42
- runGetElementCodeInAut: new Rox.Flag(),
43
- enableFrameSwitchOptimization: new Rox.Flag(),
44
- maximumJsResultSize: new Rox.Configuration(2000 * 1024),
45
- skipFileInputClicks: new Rox.Flag(),
46
- errorMessageOnBadNetwork: new Rox.Flag(true),
47
- warnOnBadNetwork: new Rox.Flag(false),
48
- overrideAzureStorageUrl: new Rox.Flag(),
49
- useJsInputCodeInSafari: new Rox.Flag(),
50
- useJsInputCodeInFirefox: new Rox.Flag(),
51
- autoSaveDownloadFileFireFox: new Rox.Flag(true),
52
- safariSelectOptionDispatchEventOnSelectElement: new Rox.Flag(true),
53
- experimentalPreCodeCompilation: new Rox.Flag(true),
54
- /** Enables using top level await inside custom actions */
55
- experimentalAsyncCustomCode: new Rox.Flag(),
56
- useSameBrowserForMultiTests: new LabFeatureFlag('labs'),
57
- highSpeedMode: new LabFeatureFlag(),
58
- usePortedHtml5DragDrop: new Rox.Flag(),
59
- testNamesToBeforeSuiteHook: new Rox.Flag(),
60
- addCustomCapabilities: new Rox.Variant('{}'),
61
- enableWorkerThreadsCliCodeExecution: new Rox.Flag(true),
62
- LTNetworkCapabilities: new Rox.Flag(),
63
- downloadToBase64: new Rox.Flag(),
64
- dec2022eolBrowsers: new Rox.Flag(),
65
- publicGridURL: new Rox.Configuration('public-grid.testim.io'),
66
- };
67
- Rox.register('default', this.flags);
68
- }
69
-
70
- /** @param {string} projectId */
71
- setProjectId(projectId) {
72
- Rox.setCustomStringProperty('projectId', projectId);
73
- }
74
-
75
- /** @param {string} projectType */
76
- setProjectType(projectType) {
77
- Rox.setCustomStringProperty('projectType', projectType);
78
- }
79
-
80
- /** @param {string} productType */
81
- setCompanyProductType(productType) {
82
- Rox.setCustomStringProperty('productType', productType);
83
- }
84
-
85
- /** @param {string} companyId */
86
- setCompanyId(companyId) {
87
- Rox.setCustomStringProperty('companyId', companyId);
88
- }
89
-
90
- /** @param {string} planType */
91
- setPlanType(planType) {
92
- Rox.setCustomStringProperty('planType', planType);
93
- }
94
-
95
- /** @param {boolean} isPOC */
96
- setIsPOC(isPOC) {
97
- Rox.setCustomBooleanProperty('isPOC', isPOC);
98
- }
99
-
100
- /** @param {boolean} isStartUp */
101
- setIsStartUp(isStartUp) {
102
- Rox.setCustomBooleanProperty('isStartUp', isStartUp);
103
- }
104
-
105
- /** @param {string} mode */
106
- setRunnerMode(mode) {
107
- Rox.setCustomStringProperty('runnerMode', mode);
108
- }
109
-
110
- async fetch() {
111
- if (!USE_FEATURE_FLAGS) {
112
- return undefined;
113
- }
114
- /** @type {Rox.RoxSetupOptions} */
115
- const opts = {
116
- fetchIntervalInSec: SEC_IN_DAY, // we don't actually want to refresh feature flags in the CLI,
117
- disableNetworkFetch: false,
118
- };
119
-
120
-
121
- if (global.ProxyAgent) {
122
- const agent = new global.ProxyAgent(global.proxyUri);
123
- opts.httpsAgent = agent;
124
- opts.httpAgent = agent;
125
- }
126
-
127
- return promiseTimeout(Rox.setup(ROLLOUT_KEY, opts), FORCE_FETCH_TIMEOUT_MS)
128
- .catch(err => logger.error('failed to get feature flag status', err));
129
- }
130
- }
131
-
132
- module.exports = new FeatureFlagsService();
@@ -1,28 +0,0 @@
1
- 'use strict';
2
-
3
- const { join, resolve } = require('path');
4
-
5
- /** @type {{ playerPath: string | undefined }} */ module.exports.options = { playerPath: undefined };
6
-
7
- /** @type {import('clickim/src/background/sessionPlayerInit').SessionPlayerInit | undefined} */ let sessionPlayerInit;
8
-
9
- module.exports.getSessionPlayer = () => {
10
- if (sessionPlayerInit) {
11
- return sessionPlayerInit;
12
- }
13
- const perf = require('./performance-logger');
14
-
15
- perf.log('getSessionPlayerRequire start');
16
- const { getSessionPlayerFolder } = require('./prepareRunnerAndTestimStartUtils');
17
-
18
- const testimAppDataFolder = getSessionPlayerFolder();
19
- const { options } = module.exports;
20
- const path = options.playerPath ? resolve(options.playerPath, 'src/background/sessionPlayerInit.ts') : join(testimAppDataFolder, 'sessionPlayer.js');
21
-
22
- /** @type {import('clickim/src/background/sessionPlayerInit').SessionPlayerInit} */
23
- const sessionPlayer = require(path); // eslint-disable-line import/no-dynamic-require
24
-
25
- perf.log('getSessionPlayerRequire end');
26
- sessionPlayerInit = sessionPlayer;
27
- return sessionPlayer;
28
- };