@testim/testim-cli 3.193.0 → 3.197.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 (70) hide show
  1. package/README.md +1 -1
  2. package/cli/onExit.js +12 -1
  3. package/cli.js +5 -1
  4. package/codim/codim-npm-package/index.ts +1 -0
  5. package/commons/constants.js +0 -25
  6. package/commons/featureFlags.js +2 -0
  7. package/commons/socket/testResultService.js +4 -14
  8. package/commons/testimAnalytics.js +0 -1
  9. package/commons/testimDesiredCapabilitiesBuilder.js +0 -95
  10. package/commons/testimServicesApi.js +10 -80
  11. package/executionQueue.js +7 -4
  12. package/npm-shrinkwrap.json +956 -520
  13. package/package.json +3 -1
  14. package/player/chromeLauncherTestPlayer.js +5 -2
  15. package/player/stepActions/apiStepAction.js +1 -0
  16. package/player/stepActions/baseJsStepAction.js +5 -1
  17. package/player/stepActions/pixelValidationStepAction.js +28 -0
  18. package/player/stepActions/salesforceAutoLoginStepAction.js +39 -0
  19. package/player/stepActions/scripts/focusElement.js +5 -3
  20. package/player/stepActions/stepActionRegistrar.js +5 -47
  21. package/player/utils/eyeSdkService.js +230 -0
  22. package/reports/consoleReporter.js +0 -20
  23. package/reports/reporter.js +0 -21
  24. package/runOptions.js +13 -89
  25. package/runner.js +9 -46
  26. package/runners/{strategies/LocalStrategy.js → ParallelWorkerManager.js} +60 -66
  27. package/runners/TestPlanRunner.js +286 -67
  28. package/runners/runnerUtils.js +73 -0
  29. package/{runners/strategies/BaseStrategy.js → services/analyticsService.js} +41 -28
  30. package/services/gridService.js +24 -16
  31. package/services/gridService.test.js +21 -21
  32. package/services/lambdatestService.js +1 -1
  33. package/testRunHandler.js +1 -1
  34. package/testRunStatus.js +30 -20
  35. package/utils.js +5 -5
  36. package/workers/BaseWorker.js +38 -39
  37. package/workers/BaseWorker.test.js +1 -1
  38. package/workers/WorkerExtensionSingleBrowser.js +6 -3
  39. package/commons/apkUploader/apkUploader.js +0 -46
  40. package/commons/apkUploader/apkUploaderFactory.js +0 -68
  41. package/commons/apkUploader/deviceFarmApkUploader.js +0 -41
  42. package/commons/apkUploader/saucelabsApkUploader.js +0 -36
  43. package/commons/apkUploader/testObjectApkUploader.js +0 -34
  44. package/player/mobile/mobileTestPlayer.js +0 -80
  45. package/player/mobile/mobileWebDriver.js +0 -155
  46. package/player/mobile/services/frameLocatorMock.js +0 -18
  47. package/player/mobile/services/mobilePortSelector.js +0 -22
  48. package/player/mobile/services/mobileTabService.js +0 -241
  49. package/player/mobile/utils/mobileScreenshotUtils.js +0 -46
  50. package/player/mobile/utils/mobileWindowUtils.js +0 -84
  51. package/player/stepActions/mobile/android/androidLocateStepAction.js +0 -122
  52. package/player/stepActions/mobile/android/androidLongClickStepAction.js +0 -12
  53. package/player/stepActions/mobile/android/androidScrollStepAction.js +0 -134
  54. package/player/stepActions/mobile/android/androidSpecialKeyStepAction.js +0 -22
  55. package/player/stepActions/mobile/android/androidSwipeStepAction.js +0 -32
  56. package/player/stepActions/mobile/androidGlobalActionStepAction.js +0 -12
  57. package/player/stepActions/mobile/androidTapStepAction.js +0 -19
  58. package/player/stepActions/mobile/androidTextChangeStepAction.js +0 -23
  59. package/player/stepActions/mobile/ios/iosLocateStepAction.js +0 -124
  60. package/player/stepActions/mobile/ios/iosScrollStepAction.js +0 -76
  61. package/runners/AnonymousTestPlanRunner.js +0 -106
  62. package/runners/BaseRunner.js +0 -42
  63. package/runners/BaseTestPlanRunner.js +0 -194
  64. package/runners/DeviceFarmRemoteRunner.js +0 -50
  65. package/runners/SchedulerRemoteRunner.js +0 -47
  66. package/runners/strategies/DeviceFarmStrategy.js +0 -195
  67. package/runners/strategies/LocalDeviceFarmStrategy.js +0 -12
  68. package/runners/strategies/LocalTestStrategy.js +0 -14
  69. package/runners/strategies/Strategy.js +0 -17
  70. package/workers/WorkerAppium.js +0 -70
@@ -1,17 +0,0 @@
1
- const LocalDeviceFarmStrategy = require('./LocalDeviceFarmStrategy');
2
- const LocalTestStrategy = require('./LocalTestStrategy');
3
- const DeviceFarmStrategy = require('./DeviceFarmStrategy');
4
- const {CLI_MODE} = require('../../commons/constants');
5
-
6
- module.exports = (options, customExtensionLocalLocation) => {
7
- const {projectData, gridData, mode} = options;
8
- if (["android", "ios"].includes(projectData.type) && gridData.type === "testimMobile") {
9
- options.mode = CLI_MODE.APPIUM;
10
- return new DeviceFarmStrategy();
11
- }
12
- if (["android", "ios"].includes(projectData.type) && mode === CLI_MODE.DEVICE_FARM_APPIUM) {
13
- return new LocalDeviceFarmStrategy();
14
- }
15
-
16
- return new LocalTestStrategy(customExtensionLocalLocation);
17
- };
@@ -1,70 +0,0 @@
1
- "use strict";
2
-
3
- const {CLI_MODE} = require('../commons/constants');
4
- const BaseWorker = require('./BaseWorker');
5
- const {timeoutMessages} = require('../commons/constants');
6
- const logger = require('../commons/logger').getLogger("worker-selenium");
7
- const Promise = require('bluebird');
8
- const exec = Promise.promisify(require('child_process').exec);
9
- const reporter = require("../reports/reporter");
10
- const MobileTestPlayer = require('../player/mobile/mobileTestPlayer');
11
- const { manifestVersion } = require('../commons/getSessionPlayerRequire');
12
-
13
- class WorkerAppium extends BaseWorker {
14
- initPlayer(testRunHandler) {
15
- const { projectData } = this.options;
16
- return new MobileTestPlayer(this.id, testRunHandler.getRunParams(), projectData.type);
17
- }
18
-
19
- async getBrowserOnce(testRunHandler, customExtensionLocalLocation, player, gridInfo) {
20
- reporter.onGetSession(this.id, this.testName, testRunHandler.getRunMode());
21
- player.clearSessionTabs();
22
- const { driver } = player;
23
-
24
- try {
25
- await driver.init(this.options, gridInfo, testRunHandler.getNativeAppData(), this.testName, this.testResultId);
26
- return player.addTab();
27
- } catch (err) {
28
- logger.error(`failed to get device/app (message=${err.message})`, { err });
29
- throw err;
30
- }
31
- }
32
-
33
- runTestCleanup() {
34
- const { mode } = this.options;
35
-
36
- if(mode === CLI_MODE.DEVICE_FARM_APPIUM) {
37
- return exec("adb shell pm clear $DEVICEFARM_APP_NAME");
38
- }
39
- return Promise.resolve();
40
- }
41
-
42
- runTestOnce(testRunHandler, player) {
43
- const version = manifestVersion || "runner";
44
- let that = this;
45
-
46
- reporter.onWaitToTestComplete(this.id, this.isCodeMode);
47
-
48
- function runSeleniumTest() {
49
- return new Promise(resolve => player.sessionPlayer.playByTestId(that.testId, that.executionId, that.testResultId, that.baseUrl, that.userData, version, resolve, false, that.overrideTestConfigId, that.branch))
50
- .timeout(that.testRunTimeout, timeoutMessages.TEST_COMPLETE_TIMEOUT_MSG)
51
- .catch(Promise.TimeoutError, err => {
52
- player.sessionPlayer.stopPlayingOnTestTimeout && player.sessionPlayer.stopPlayingOnTestTimeout();
53
- throw err;
54
- })
55
- .then(testResult => {
56
- testResult.stepsResults = null;
57
- return Promise.resolve(testResult);
58
- });
59
- }
60
-
61
- return super.runTestOnce(testRunHandler, player)
62
- .then(() => runSeleniumTest())
63
- .catch(err => {
64
- logger.error("failed to run test once", {err: err});
65
- return Promise.reject(err);
66
- });
67
- }
68
- }
69
-
70
- module.exports = WorkerAppium;