@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
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  # TESTIM.IO
3
- ## Web & Mobile Test Automation Solution. Built for agile teams. Testim is a cloud service that instantly enables Test Automation to make your Continuous Delivery ready.
3
+ ## Web Test Automation Solution. Built for agile teams. Testim is a cloud service that instantly enables Test Automation to make your Continuous Delivery ready.
4
4
 
5
5
  For more information please check out https://testim.io and https://help.testim.io/docs
6
6
 
package/cli/onExit.js CHANGED
@@ -1,16 +1,22 @@
1
1
  'use strict';
2
2
 
3
3
  const constants = require('../commons/constants');
4
- const utils = require('../utils');
5
4
  const { requireWithFallback } = require('../commons/requireWithFallback');
6
5
  const { isCi } = require('./isCiRun');
7
6
  const { writeStackTrace } = require('./writeStackTrace');
8
7
  const logger = require('../commons/logger').getLogger('process-handler');
9
8
 
9
+ let exitCodeIgnoreFailingTests = false;
10
+
10
11
  function getExitCode(result) {
11
12
  if (result instanceof Error) {
12
13
  return 1;
13
14
  }
15
+
16
+ if (exitCodeIgnoreFailingTests) {
17
+ return 0;
18
+ }
19
+
14
20
  result = result || {};
15
21
  const hasFailedTests = Object.values(result).some(
16
22
  ({ runnerStatus, success, testStatus, status }) => {
@@ -32,9 +38,13 @@ function closeChromeDriverIfRunning() {
32
38
  try {
33
39
  const chromedriver = requireWithFallback('chromedriver');
34
40
  chromedriver.stop();
41
+ // eslint-disable-next-line no-empty
35
42
  } catch (err) { }
36
43
  }
37
44
 
45
+ module.exports.ignoreFailingTestsInExitCode = function () {
46
+ exitCodeIgnoreFailingTests = true;
47
+ };
38
48
 
39
49
 
40
50
  module.exports.onExit = async function onExit(exitValue) {
@@ -42,6 +52,7 @@ module.exports.onExit = async function onExit(exitValue) {
42
52
  if (!isCi) {
43
53
  writeStackTrace(exitValue);
44
54
  } else {
55
+ // eslint-disable-next-line no-console
45
56
  console.error(exitValue, exitValue && exitValue.stack);
46
57
  }
47
58
  }
package/cli.js CHANGED
@@ -7,7 +7,7 @@ require('./bluebirdConfig.js');
7
7
  const options = require('./runOptions');
8
8
  const EventEmitter = require('events');
9
9
  const logger = require('./commons/logger').getLogger('cli-entry');
10
- const { onExit } = require('./cli/onExit');
10
+ const { onExit, ignoreFailingTestsInExitCode } = require('./cli/onExit');
11
11
  const testRunner = require('./runner');
12
12
  const prepareRunner = require('./commons/prepareRunner');
13
13
  const { CLI_MODE } = require('./commons/constants');
@@ -92,6 +92,10 @@ function main() {
92
92
  options.localRCASaver = `http://localhost:${port}`;
93
93
  }
94
94
 
95
+ if (options.exitCodeIgnoreFailingTests) {
96
+ ignoreFailingTestsInExitCode();
97
+ }
98
+
95
99
  perf.log('right before testRunner.init/prepareRunner.prepare');
96
100
  return Promise.all([
97
101
  testRunner.init(options),
@@ -119,6 +119,7 @@ type ApiCallOptions = {
119
119
  headers?: Headers;
120
120
  body?: string;
121
121
  sendViaWebApp?: boolean;
122
+ omitCookies?: boolean;
122
123
  }
123
124
 
124
125
  export enum GeneratedValueTypes {
@@ -33,29 +33,6 @@ module.exports = {
33
33
  test: {
34
34
  HIDDEN_PARAM: 'TST_HIDDEN_PARAM',
35
35
  },
36
- deviceFarm: {
37
- status: {
38
- INITIALIZING: 'INITIALIZING',
39
- PENDING: 'PENDING',
40
- PENDING_CONCURRENCY: 'PENDING_CONCURRENCY',
41
- PENDING_DEVICE: 'PENDING_DEVICE',
42
- PROCESSING: 'PROCESSING',
43
- SCHEDULING: 'SCHEDULING',
44
- PREPARING: 'PREPARING',
45
- RUNNING: 'RUNNING',
46
- COMPLETED: 'COMPLETED',
47
- STOPPING: 'STOPPING',
48
- },
49
- result: {
50
- PENDING: 'PENDING',
51
- PASSED: 'PASSED',
52
- WARNED: 'WARNED',
53
- FAILED: 'FAILED',
54
- SKIPPED: 'SKIPPED',
55
- ERRORED: 'ERRORED',
56
- STOPPED: 'STOPPED',
57
- },
58
- },
59
36
  socketEventTypes: {
60
37
  TEST_RESULT_CREATED: 'test-result-created',
61
38
  TEST_RESULT_UPDATED: 'test-result-updated',
@@ -64,8 +41,6 @@ module.exports = {
64
41
  CLI_MODE: {
65
42
  EXTENSION: 'extension',
66
43
  SELENIUM: 'selenium',
67
- APPIUM: 'appium',
68
- DEVICE_FARM_APPIUM: 'device-farm-appium',
69
44
  },
70
45
  sessionType: {
71
46
  CODELESS: 'codeless',
@@ -52,6 +52,8 @@ class FeatureFlagsService {
52
52
  autoSaveDownloadFileFireFox: new Rox.Flag(true),
53
53
  safariSelectOptionDispatchEventOnSelectElement: new Rox.Flag(true),
54
54
  experimentalPreCodeCompilation: new Rox.Flag(false),
55
+ /** Enables using top level await inside custom actions for non-IE browsers */
56
+ experimentalAsyncCustomCode: new Rox.Flag(),
55
57
  useSameBrowserForMultiTests: new LabFeatureFlag('labs'),
56
58
  highSpeedMode: new LabFeatureFlag(),
57
59
  usePortedHtml5DragDrop: new Rox.Flag(),
@@ -2,11 +2,9 @@ const testResultServiceSocketIO = require('./testResultServiceSocketIO');
2
2
  const socketService = require('./socketService');
3
3
 
4
4
  const { EventEmitter } = require('events');
5
-
6
- const testimServicesApi = require('../testimServicesApi');
7
5
  const featureFlags = require('../featureFlags');
8
6
 
9
- const {socketEventTypes} = require('../constants');
7
+ const { socketEventTypes } = require('../constants');
10
8
  const Promise = require('bluebird');
11
9
 
12
10
  class TestResultService extends EventEmitter {
@@ -22,9 +20,9 @@ class TestResultService extends EventEmitter {
22
20
  joinToTestResult(resultId, testId) {
23
21
  //TODO - Consider unifying the joinToTestResult and listenToTestResult flows
24
22
  if (featureFlags.flags.useNewWSCLI.isEnabled()) {
25
- return socketService.addFilter(`${resultId}:testResult`, {resultId, testId}, [
23
+ return socketService.addFilter(`${resultId}:testResult`, { resultId, testId }, [
26
24
  socketEventTypes.TEST_RESULT_UPDATED,
27
- socketEventTypes.TEST_RESULT_CREATED
25
+ socketEventTypes.TEST_RESULT_CREATED,
28
26
  ]);
29
27
  }
30
28
  testResultServiceSocketIO.joinRoom(resultId, testId);
@@ -54,17 +52,9 @@ class TestResultService extends EventEmitter {
54
52
  testResultServiceSocketIO.listenToTestResult(resultId, testId, onTestResultStatus);
55
53
  }
56
54
 
57
- clearTestResult(projectId, resultId, testId, testResult) {
58
- return testimServicesApi.clearTestResult(projectId, resultId, testId, testResult);
59
- }
60
-
61
- updateTestResult(projectId, resultId, testId, testResult, remoteRunId) {
62
- return testimServicesApi.updateTestResult(projectId, resultId, testId, testResult, remoteRunId);
63
- }
64
-
65
55
  getSocket() {
66
56
  if (featureFlags.flags.useNewWSCLI.isEnabled()) {
67
- return;
57
+ return undefined;
68
58
  }
69
59
  return testResultServiceSocketIO.getSocket();
70
60
  }
@@ -5,7 +5,6 @@ const config = require('./config');
5
5
  const Analytics = require('analytics-node');
6
6
 
7
7
  const analytics = new Analytics('sJOSIGKa5x5rJEGsaOlCjrgozAf7FnVY', { flushAt: 1 });
8
- const testimCustomToken = require('./testimCustomToken');
9
8
 
10
9
  function identify(data) {
11
10
  if (config.IS_ON_PREM) {
@@ -9,7 +9,6 @@ const featureFlags = require('./featureFlags');
9
9
  const { CLI_MODE, mobileWeb, gridTypes } = require('./constants');
10
10
  const config = require('./config');
11
11
  const utils = require('../utils');
12
- const { getAppCaps } = require('./apkUploader/apkUploaderFactory');
13
12
  const LambdatestService = require('../services/lambdatestService');
14
13
  const logger = require('./logger').getLogger('testim-desired-capabilities-builder');
15
14
 
@@ -193,7 +192,6 @@ function _buildChromiumOptions(opts, browserOptions, testRunConfig, customExtens
193
192
  }
194
193
 
195
194
  if (isDFGrid(gridInfo) && browserName === 'MicrosoftEdge') {
196
- delete chromiumOptions.prefs['profile.content_settings.exceptions.clipboard']; // for some reason this breaks
197
195
  opts.desiredCapabilities['ms:edgeChromium'] = true;
198
196
  }
199
197
 
@@ -578,99 +576,6 @@ function buildSeleniumOptions(browserOptions, testName, testRunConfig, gridInfo,
578
576
  return opts;
579
577
  }
580
578
 
581
- function buildTestObject(browserOptions, testName, appCaps) {
582
- if (!_.isEmpty(browserOptions.testobjectSauce)) {
583
- return Object.assign({
584
- idleTimeout: 30,
585
- testobject_test_name: testName,
586
- testobject_session_creation_timeout: String(browserOptions.browserTimeout),
587
- deviceName: null,
588
- }, appCaps, browserOptions.testobjectSauce);
589
- }
590
- return {};
591
- }
592
-
593
- function buildSaucelabsMobile(browserOptions, testName, appCaps) {
594
- if (!_.isEmpty(browserOptions.saucelabs)) {
595
- return Object.assign({
596
- deviceName: null,
597
- name: testName,
598
- idleTimeout: 30,
599
- browserName: '',
600
- }, appCaps, browserOptions.saucelabs);
601
- }
602
- return {};
603
- }
604
-
605
- function buildAppiumOptions(browserOptions, gridInfo, nativeAppData, testName) {
606
- const { getSessionTimeout, getSessionRetries, driverRequestTimeout, driverRequestRetries } = browserOptions;
607
- const opts = {
608
- host: gridInfo.host,
609
- port: gridInfo.port || 4444,
610
- path: gridInfo.path || '/wd/hub',
611
- protocol: gridInfo.protocol || 'http',
612
- logLevel: LOG_LEVEL,
613
- connectionRetryTimeout: driverRequestTimeout,
614
- connectionRetryCount: driverRequestRetries,
615
- getSessionTimeout,
616
- getSessionRetries,
617
- desiredCapabilities: {
618
- browserName: '',
619
- noReset: false,
620
- fullReset: false,
621
- },
622
- };
623
-
624
- if (browserOptions.projectData.type === 'android') {
625
- Object.assign(opts.desiredCapabilities, {
626
- appPackage: nativeAppData.packageName,
627
- appActivity: nativeAppData.activity,
628
- platformName: 'Android',
629
- automationName: 'uiautomator2',
630
- autoLaunch: false,
631
- ignoreUnimportantViews: false,
632
- disableWindowAnimation: browserOptions.disableWindowAnimation,
633
- });
634
- } else if (browserOptions.projectData.type === 'ios') {
635
- Object.assign(opts.desiredCapabilities, {
636
- bundleId: nativeAppData.packageName,
637
- platformName: 'iOS',
638
- automationName: 'XCUITest',
639
- });
640
- }
641
-
642
- if (browserOptions.deviceUdid) {
643
- opts.desiredCapabilities.udid = browserOptions.deviceUdid;
644
- }
645
-
646
- if (browserOptions.deviceName) {
647
- opts.desiredCapabilities.deviceName = browserOptions.deviceName;
648
- }
649
-
650
- if (gridInfo.user && gridInfo.key && gridInfo.type === 'saucelabs') {
651
- browserOptions.saucelabs = browserOptions.saucelabs || {};
652
- browserOptions.saucelabs.username = browserOptions.saucelabs.username || gridInfo.user;
653
- browserOptions.saucelabs.accessKey = browserOptions.saucelabs.accessKey || gridInfo.key;
654
- } else if (gridInfo.key && gridInfo.type === 'testobject') {
655
- browserOptions.testobjectSauce = browserOptions.testobjectSauce || {};
656
- browserOptions.testobjectSauce.testobjectApiKey = browserOptions.testobjectSauce.testobjectApiKey || gridInfo.key;
657
- } else if (gridInfo.key && gridInfo.type === 'perfecto') {
658
- browserOptions.perfecto = browserOptions.perfecto || {};
659
- browserOptions.perfecto.securityToken = gridInfo.key;
660
- }
661
-
662
- const appCaps = getAppCaps(gridInfo);
663
-
664
- Object.assign(
665
- opts.desiredCapabilities,
666
- buildTestObject(browserOptions, testName, appCaps),
667
- buildSaucelabsMobile(browserOptions, testName, appCaps)
668
- );
669
-
670
- return opts;
671
- }
672
-
673
579
  module.exports = {
674
580
  buildSeleniumOptions,
675
- buildAppiumOptions,
676
581
  };
@@ -55,11 +55,6 @@ function putAuth(url, body) {
55
55
  .then(headers => httpRequest.put(`${config.SERVICES_HOST}${url || ''}`, body, headers));
56
56
  }
57
57
 
58
- function getTextWithAuth(url, query) {
59
- return getTokenHeader()
60
- .then(headers => httpRequest.getText(`${config.SERVICES_HOST}${url || ''}`, query, headers));
61
- }
62
-
63
58
  function getWithAuth(url, query, options, timeout) {
64
59
  return getTokenHeader()
65
60
  .then(headers => httpRequest.get(`${config.SERVICES_HOST}${url || ''}`, query, headers, timeout, options));
@@ -69,10 +64,6 @@ function getS3Artifact(url, timeout) {
69
64
  return utils.runWithRetries(() => getWithAuth(`/storage${url}`, null, { isBinary: true }, timeout));
70
65
  }
71
66
 
72
- function getS3ArtifactText(url) {
73
- return utils.runWithRetries(() => getTextWithAuth(`/storage${url}`));
74
- }
75
-
76
67
  function getTestPlan(projectId, testPlanNames) {
77
68
  //TODO: need to be checked after 3 months to prevent users from using old version
78
69
  const parseProperty = (dataValue) => (dataValue == null ? [] : (typeof (dataValue) === 'string' && JSON.parse(dataValue)) || dataValue);
@@ -100,22 +91,16 @@ function saveTestPlanResult(projectId, testPlanId, result) {
100
91
  return utils.runWithRetries(() => postAuth({ url: '/testPlan/result', body: { projectId, testPlanId, result } }));
101
92
  }
102
93
 
103
- function updateTestStatus(status, executionId, testId, resultId, startTime, endTime, success, failureReason, config, projectId, remoteRunId, testRetryKey) {
94
+ function updateTestStatus(projectId, executionId, testId, resultId, status, data, apiRetries = DEFAULT_REQUEST_RETRY) {
104
95
  return utils.runWithRetries(() => putAuth('/result/run/test', {
105
96
  runId: executionId,
106
97
  testId,
107
- startTime,
108
- endTime,
109
- success,
110
- failureReason,
111
98
  resultId,
112
99
  status,
113
- config,
114
100
  projectId,
115
101
  runnerVersion,
116
- remoteRunId,
117
- testRetryKey,
118
- }), DEFAULT_REQUEST_RETRY);
102
+ ...data,
103
+ }), apiRetries);
119
104
  }
120
105
 
121
106
  function updateExecutionTests(executionId, runnerStatuses, status, reason, success, startTime, endTime, projectId) {
@@ -182,14 +167,6 @@ function reportExecutionFinished(status, executionId, projectId, success, tmsOpt
182
167
  }), DEFAULT_REQUEST_RETRY);
183
168
  }
184
169
 
185
- function getBranchData(projectId, branchName) {
186
- return utils.runWithRetries(() => getWithAuth(`/branch/branchData/${encodeURIComponent(branchName)}`, { projectId }));
187
- }
188
-
189
- function getUserDetails(userId) {
190
- return utils.runWithRetries(() => getWithAuth(`/user/user/${userId}`));
191
- }
192
-
193
170
  function getTestPlanTestList(projectId, names, planIds, branch) {
194
171
  return utils.runWithRetries(() => postAuth({
195
172
  url: '/testPlan/list',
@@ -243,11 +220,11 @@ function keepAliveGrid(projectId, slots) {
243
220
  });
244
221
  }
245
222
 
246
- function releaseGridSlot(projectId, slotId, gridId, browser) {
223
+ function releaseGridSlot(companyId, projectId, slotId, gridId, browser) {
247
224
  return postAuth({
248
225
  url: `/grid/release?reqId=${utils.guid()}`,
249
226
  body: {
250
- projectId, slotId, gridId, browser,
227
+ companyId, projectId, slotId, gridId, browser,
251
228
  },
252
229
  });
253
230
  }
@@ -259,23 +236,16 @@ function getHybridGridProvider(body) {
259
236
  });
260
237
  }
261
238
 
262
- function getGridByProject(projectId, gridName, browser, executionId) {
239
+ function getGridByName(companyId, projectId, gridName, browser, executionId) {
263
240
  return utils.runWithRetries(() => getWithAuth('/grid/name', {
264
- projectId, name: gridName, browser, executionId, reqId: utils.guid(),
241
+ companyId, projectId, name: gridName, browser, executionId, reqId: utils.guid(),
265
242
  }));
266
243
  }
267
244
 
268
- function getGridById(projectId, gridId, browser, executionId) {
269
- return utils.runWithRetries(() => getWithAuth(`/grid/${gridId}`, { projectId, browser, executionId, reqId: utils.guid() }));
270
- }
271
-
272
- function getCompanyByProjectId(projectId) {
273
- return utils.runWithRetries(() => getWithAuth(`/company/company/${projectId}`));
245
+ function getGridById(companyId, projectId, gridId, browser, executionId) {
246
+ return utils.runWithRetries(() => getWithAuth(`/grid/${gridId}`, { companyId, projectId, browser, executionId, reqId: utils.guid() }));
274
247
  }
275
248
 
276
- function getProject(projectId) {
277
- return utils.runWithRetries(() => getWithAuth(`/v2/project/project?projectId=${projectId}`));
278
- }
279
249
 
280
250
  async function initializeUserWithAuth({ projectId, token, branchName, lightweightMode, localGrid }) {
281
251
  try {
@@ -325,38 +295,6 @@ const fetchLambdatestConfig = async () => utils.runWithRetries(() => getWithAuth
325
295
 
326
296
  const getLabFeaturesByProjectId = async (projectId) => utils.runWithRetries(() => getWithAuth(`/labFeature/v2/project/${projectId}`));
327
297
 
328
- function getAppUploadUrl(projectId, projectArn, appName) {
329
- return utils.runWithRetries(() => postAuth({
330
- url: '/deviceFarm/app',
331
- body: {
332
- projectId,
333
- projectArn,
334
- appName,
335
- },
336
- }));
337
- }
338
-
339
- function createDeviceFarmRun(companyId, projectId, projectArn, appArn, configuration, branch, executionId, env, remoteRunObject) {
340
- return postAuth({
341
- url: '/deviceFarm/run',
342
- body: {
343
- companyId,
344
- projectId,
345
- projectArn,
346
- appArn,
347
- configuration,
348
- branch,
349
- executionId,
350
- env,
351
- remoteRunObject,
352
- },
353
- timeout: 30000,
354
- });
355
- }
356
-
357
- function getDeviceFarmRun(projectId, runArn) {
358
- return getWithAuth(`/deviceFarm/run?projectId=${projectId}&runArn=${runArn}`);
359
- }
360
298
 
361
299
  function getRealData(projectId, channel, query) {
362
300
  return utils.runWithRetries(() => getWithAuth(`/real-data/${channel}?${query}&projectId=${projectId}`));
@@ -492,30 +430,22 @@ function addTestRetry({
492
430
 
493
431
  module.exports = {
494
432
  getS3Artifact,
495
- getS3ArtifactText,
496
433
  getTestPlan,
497
434
  saveTestPlanResult,
498
435
  updateTestStatus,
499
436
  updateExecutionTests,
500
437
  reportExecutionStarted,
501
438
  reportExecutionFinished,
502
- getBranchData,
503
- getUserDetails,
504
439
  getTestPlanTestList,
505
440
  getSuiteTestList,
506
- getCompanyByProjectId,
507
- getProject,
508
441
  getUsageForCurrentBillingPeriod,
509
442
  getTestResults,
510
- getGridByProject,
443
+ getGridByName,
511
444
  releaseGridSlot,
512
445
  keepAliveGrid,
513
446
  getGridById,
514
447
  getAllGrids,
515
448
  fetchLambdatestConfig,
516
- getAppUploadUrl,
517
- createDeviceFarmRun,
518
- getDeviceFarmRun,
519
449
  getRealData,
520
450
  updateTestResult,
521
451
  clearTestResult,
package/executionQueue.js CHANGED
@@ -1,12 +1,10 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
3
  const TestRun = require('./testRunHandler.js');
4
4
 
5
5
  class ExecutionQueue {
6
6
  constructor(executionId, testList, options, branchToUse, testStatus) {
7
- this._waitingTests = testList.map(testInfo => {
8
- return new TestRun(executionId, testInfo, options, branchToUse, testStatus);
9
- });
7
+ this._waitingTests = testList.map(testInfo => new TestRun(executionId, testInfo, options, branchToUse, testStatus));
10
8
  }
11
9
 
12
10
  getNext() {
@@ -14,6 +12,11 @@ class ExecutionQueue {
14
12
  if (nextTestRunHandler) {
15
13
  return nextTestRunHandler;
16
14
  }
15
+ return undefined;
16
+ }
17
+
18
+ hasMoreTests() {
19
+ return Boolean(this._waitingTests.length);
17
20
  }
18
21
  }
19
22