@testim/testim-cli 3.237.0 → 3.240.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testim/testim-cli",
3
- "version": "3.237.0",
3
+ "version": "3.240.0",
4
4
  "description": "Command line interface for running Testing on your CI",
5
5
  "author": "Oren Rubin",
6
6
  "contributors": [{
@@ -1,6 +1,13 @@
1
- "use strict";
2
- var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement, isDynamicScroll, expectedX, expectedY, shouldScrollLeft, shouldScrollTop) {
1
+ // Disabling the eslint to keep this in a format which works on IE 11.
2
+ /* eslint-disable no-var */
3
+ /* eslint-disable no-redeclare */
4
+ /* eslint-disable object-shorthand */
5
+ /* eslint-disable one-var */
6
+ /* eslint-disable operator-linebreak */
7
+
8
+ 'use strict';
3
9
 
10
+ var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement, isDynamicScroll, expectedX, expectedY, shouldScrollLeft, shouldScrollTop) {
4
11
  function doScroll(expectedPosition, element) {
5
12
  if (!element) {
6
13
  return { success: false };
@@ -17,7 +24,7 @@ var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement,
17
24
 
18
25
  function getExpectedPosition(parentElement, locatedElement, isScrollToElement, expectedX, expectedY, shouldScrollLeft, shouldScrollTop) {
19
26
  if (!isScrollToElement) {
20
- return {x: expectedX, y: expectedY};
27
+ return { x: expectedX, y: expectedY };
21
28
  }
22
29
 
23
30
  var target = getLocatedElement(locatedElement);
@@ -26,7 +33,7 @@ var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement,
26
33
  return { x: parentElement.scrollWidth, y: parentElement.scrollHeight };
27
34
  }
28
35
 
29
- if(!target) {
36
+ if (!target) {
30
37
  throw new Error('could not find target element');
31
38
  }
32
39
 
@@ -46,7 +53,7 @@ var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement,
46
53
  ? parentElement.scrollLeft + targetRect.left - Math.min(expectedX, MAX_WIDTH)
47
54
  : parentElement.scrollLeft;
48
55
 
49
- return {x: Math.round(xScroll), y: Math.round(yScroll)};
56
+ return { x: Math.round(xScroll), y: Math.round(yScroll) };
50
57
  }
51
58
 
52
59
  var isDocument = !elementToScrollOn;
@@ -55,7 +62,7 @@ var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement,
55
62
  if (!elementToScrollOn) {
56
63
  throw new Error('could not find target to scroll on');
57
64
  }
58
- var positionBeforeScroll = {top: elementToScrollOn.scrollTop, left: elementToScrollOn.scrollLeft};
65
+ var positionBeforeScroll = { top: elementToScrollOn.scrollTop, left: elementToScrollOn.scrollLeft };
59
66
  var expectedPosition = getExpectedPosition(elementToScrollOn, elementToScrollTo, isScrollToElement, expectedX, expectedY, shouldScrollLeft, shouldScrollTop);
60
67
 
61
68
  var result = doScroll(expectedPosition, elementToScrollOn);
@@ -71,7 +78,7 @@ var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement,
71
78
  var actualScrollToElement = getLocatedElement(elementToScrollTo);
72
79
 
73
80
  if (isScrollToElement && isDynamicScroll && !actualScrollToElement) {
74
- return { success: false, expectedPosition };
81
+ return { success: false, expectedPosition: expectedPosition };
75
82
  }
76
83
 
77
84
  if (isScrollToElement) {
@@ -82,7 +89,7 @@ var scroll = function (elementToScrollOn, elementToScrollTo, isScrollToElement,
82
89
  actualXString = rect.left;
83
90
  actualYString = rect.top;
84
91
  }
85
- return {success: result.success, actualX: actualXString, actualY: actualYString};
92
+ return { success: result.success, actualX: actualXString, actualY: actualYString };
86
93
  };
87
94
 
88
95
  module.exports = scroll;
@@ -91,6 +91,7 @@ class ParallelWorkerManager {
91
91
  };
92
92
 
93
93
  const onTestCompleted = async (wid, testId, testResult, sessionId, isRerun) => {
94
+ runningTests--;
94
95
  const update = {};
95
96
  if (lightweightMode && lightweightMode.onlyTestIdsNoSuite) {
96
97
  update.show = true;
@@ -156,9 +157,8 @@ class ParallelWorkerManager {
156
157
  executionQueue.stop();
157
158
  stoppedOnError = true;
158
159
  }
159
- runningTests--;
160
160
  const completedTests = Object.keys(combinedTestResults).length;
161
- if (completedTests === testCount || (stopOnError && runningTests === 0)) {
161
+ if (completedTests === testCount || (stoppedOnError && runningTests === 0)) {
162
162
  resolve(combinedTestResults);
163
163
  return undefined;
164
164
  }
@@ -170,7 +170,7 @@ class ParallelWorkerManager {
170
170
  testStatus.onTestIgnored(wid, testResult.resultId);
171
171
  runningTests--;
172
172
  const completedTests = Object.keys(combinedTestResults).length;
173
- if (completedTests === testCount || (stopOnError && runningTests === 0)) {
173
+ if (completedTests === testCount || (stoppedOnError && runningTests === 0)) {
174
174
  resolve(combinedTestResults);
175
175
  }
176
176
  };
package/testRunHandler.js CHANGED
@@ -248,7 +248,7 @@ class TestRun {
248
248
  if (this._options.mockNetworkRules) {
249
249
  runData.mockNetworkRules = this._options.mockNetworkRules;
250
250
  }
251
- const mustClearPreviousStepResults = !this.isAllowReportTestResultRetries() && (this._timeoutRetryCount > 1 || this._retryCount > 1);
251
+ const mustClearPreviousStepResults = (this._timeoutRetryCount > 1 || this._retryCount > 1);
252
252
 
253
253
  if (this._options.lightweightMode && this._options.lightweightMode.disableResults &&
254
254
  !mustClearPreviousStepResults && canSendRunDataOverUrl(runData)) {