@testim/testim-cli 3.261.0 → 3.263.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/cli.js +11 -5
- package/commons/featureFlags.js +1 -0
- package/commons/testimServicesApi.js +10 -7
- package/executionQueue.js +9 -1
- package/npm-shrinkwrap.json +52 -52
- package/package.json +1 -1
- package/player/stepActions/RefreshStepAction.js +7 -4
- package/player/stepActions/baseJsStepAction.js +45 -46
- package/player/stepActions/dropFileStepAction.js +11 -12
- package/player/stepActions/evaluateExpressionStepAction.js +32 -33
- package/player/stepActions/extensionOnlyStepAction.js +3 -4
- package/player/stepActions/extractTextStepAction.js +8 -10
- package/player/stepActions/hoverStepAction.js +3 -3
- package/player/stepActions/locateStepAction.js +39 -34
- package/player/stepActions/mouseStepAction.js +36 -34
- package/player/stepActions/navigationStepAction.js +7 -8
- package/player/stepActions/scrollStepAction.js +22 -22
- package/player/stepActions/stepAction.js +21 -21
- package/player/stepActions/stepActionRegistrar.js +63 -58
- package/player/stepActions/submitStepAction.js +2 -3
- package/player/stepActions/textStepAction.js +14 -14
- package/player/stepActions/textValidationStepAction.js +50 -38
- package/player/stepActions/wheelStepAction.js +5 -11
- package/polyfills/Array.prototype.at.js +13 -0
- package/polyfills/index.js +1 -0
- package/processHandler.js +2 -0
- package/reports/junitReporter.js +18 -1
- package/runOptions.d.ts +4 -0
- package/runOptions.js +8 -1
- package/runner.js +7 -0
- package/runners/TestPlanRunner.js +20 -19
- package/runners/runnerUtils.js +1 -2
- package/testRunHandler.js +18 -9
- package/testRunStatus.js +209 -157
- package/utils/index.js +9 -2
- package/workers/BaseWorker.js +11 -0
- package/workers/WorkerExtension.js +117 -91
- package/workers/WorkerSelenium.js +8 -3
- package/player/stepActions/scripts/polyfills.js +0 -393
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var polyfills = function () {
|
|
4
|
-
if (!Array.from) {
|
|
5
|
-
Array.from = (function () {
|
|
6
|
-
var toStr = Object.prototype.toString;
|
|
7
|
-
var isCallable = function (fn) {
|
|
8
|
-
return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
|
|
9
|
-
};
|
|
10
|
-
var toInteger = function (value) {
|
|
11
|
-
var number = Number(value);
|
|
12
|
-
if (isNaN(number)) {
|
|
13
|
-
return 0;
|
|
14
|
-
}
|
|
15
|
-
if (number === 0 || !isFinite(number)) {
|
|
16
|
-
return number;
|
|
17
|
-
}
|
|
18
|
-
return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
|
|
19
|
-
};
|
|
20
|
-
var maxSafeInteger = Math.pow(2, 53) - 1;
|
|
21
|
-
var toLength = function (value) {
|
|
22
|
-
var len = toInteger(value);
|
|
23
|
-
return Math.min(Math.max(len, 0), maxSafeInteger);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// The length property of the from method is 1.
|
|
27
|
-
return function from(arrayLike/*, mapFn, thisArg */) {
|
|
28
|
-
// 1. Let C be the this value.
|
|
29
|
-
var C = this;
|
|
30
|
-
|
|
31
|
-
// 2. Let items be ToObject(arrayLike).
|
|
32
|
-
var items = Object(arrayLike);
|
|
33
|
-
|
|
34
|
-
// 3. ReturnIfAbrupt(items).
|
|
35
|
-
if (arrayLike === null) {
|
|
36
|
-
throw new TypeError("Array.from requires an array-like object - not null or undefined");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// 4. If mapfn is undefined, then let mapping be false.
|
|
40
|
-
var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
|
|
41
|
-
var T;
|
|
42
|
-
if (typeof mapFn !== 'undefined') {
|
|
43
|
-
// 5. else
|
|
44
|
-
// 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
|
|
45
|
-
if (!isCallable(mapFn)) {
|
|
46
|
-
throw new TypeError('Array.from: when provided, the second argument must be a function');
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
|
|
50
|
-
if (arguments.length > 2) {
|
|
51
|
-
T = arguments[2];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// 10. Let lenValue be Get(items, "length").
|
|
56
|
-
// 11. Let len be ToLength(lenValue).
|
|
57
|
-
var len = toLength(items.length);
|
|
58
|
-
|
|
59
|
-
// 13. If IsConstructor(C) is true, then
|
|
60
|
-
// 13. a. Let A be the result of calling the [[Construct]] internal method
|
|
61
|
-
// of C with an argument list containing the single item len.
|
|
62
|
-
// 14. a. Else, Let A be ArrayCreate(len).
|
|
63
|
-
var A = isCallable(C) ? Object(new C(len)) : new Array(len);
|
|
64
|
-
|
|
65
|
-
// 16. Let k be 0.
|
|
66
|
-
var k = 0;
|
|
67
|
-
// 17. Repeat, while k < len… (also steps a - h)
|
|
68
|
-
var kValue;
|
|
69
|
-
while (k < len) {
|
|
70
|
-
kValue = items[k];
|
|
71
|
-
if (mapFn) {
|
|
72
|
-
A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
|
|
73
|
-
} else {
|
|
74
|
-
A[k] = kValue;
|
|
75
|
-
}
|
|
76
|
-
k += 1;
|
|
77
|
-
}
|
|
78
|
-
// 18. Let putStatus be Put(A, "length", len, true).
|
|
79
|
-
A.length = len;
|
|
80
|
-
// 20. Return A.
|
|
81
|
-
return A;
|
|
82
|
-
};
|
|
83
|
-
}());
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (!window.JSON) {
|
|
87
|
-
window.JSON = {
|
|
88
|
-
parse: function(sJSON) { return eval('(' + sJSON + ')'); },
|
|
89
|
-
stringify: (function () {
|
|
90
|
-
var toString = Object.prototype.toString;
|
|
91
|
-
var isArray = Array.isArray || function (a) { return toString.call(a) === '[object Array]'; };
|
|
92
|
-
var escMap = {'"': '\\"', '\\': '\\\\', '\b': '\\b', '\f': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t'};
|
|
93
|
-
var escFunc = function (m) { return escMap[m] || '\\u' + (m.charCodeAt(0) + 0x10000).toString(16).substr(1); };
|
|
94
|
-
var escRE = /[\\"\u0000-\u001F\u2028\u2029]/g;
|
|
95
|
-
return function stringify(value) {
|
|
96
|
-
if (value == null) {
|
|
97
|
-
return 'null';
|
|
98
|
-
} else if (typeof value === 'number') {
|
|
99
|
-
return isFinite(value) ? value.toString() : 'null';
|
|
100
|
-
} else if (typeof value === 'boolean') {
|
|
101
|
-
return value.toString();
|
|
102
|
-
} else if (typeof value === 'object') {
|
|
103
|
-
if (typeof value.toJSON === 'function') {
|
|
104
|
-
return stringify(value.toJSON());
|
|
105
|
-
} else if (isArray(value)) {
|
|
106
|
-
var res = '[';
|
|
107
|
-
for (var i = 0; i < value.length; i++)
|
|
108
|
-
res += (i ? ', ' : '') + stringify(value[i]);
|
|
109
|
-
return res + ']';
|
|
110
|
-
} else if (toString.call(value) === '[object Object]') {
|
|
111
|
-
var tmp = [];
|
|
112
|
-
for (var k in value) {
|
|
113
|
-
if (value.hasOwnProperty(k))
|
|
114
|
-
tmp.push(stringify(k) + ': ' + stringify(value[k]));
|
|
115
|
-
}
|
|
116
|
-
return '{' + tmp.join(', ') + '}';
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return '"' + value.toString().replace(escRE, escFunc) + '"';
|
|
120
|
-
};
|
|
121
|
-
})()
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (typeof Object.assign != 'function') {
|
|
126
|
-
Object.assign = function (target, varArgs) { // .length of function is 2
|
|
127
|
-
'use strict';
|
|
128
|
-
if (target == null) { // TypeError if undefined or null
|
|
129
|
-
throw new TypeError('Cannot convert undefined or null to object');
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
var to = Object(target);
|
|
133
|
-
|
|
134
|
-
for (var index = 1; index < arguments.length; index++) {
|
|
135
|
-
var nextSource = arguments[index];
|
|
136
|
-
|
|
137
|
-
if (nextSource != null) { // Skip over if undefined or null
|
|
138
|
-
for (var nextKey in nextSource) {
|
|
139
|
-
// Avoid bugs when hasOwnProperty is shadowed
|
|
140
|
-
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
|
141
|
-
to[nextKey] = nextSource[nextKey];
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return to;
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if(!window.Promise) {
|
|
151
|
-
(function () {
|
|
152
|
-
|
|
153
|
-
// Store setTimeout reference so promise-polyfill will be unaffected by
|
|
154
|
-
// other code modifying setTimeout (like sinon.useFakeTimers())
|
|
155
|
-
var setTimeoutFunc = setTimeout;
|
|
156
|
-
|
|
157
|
-
function noop() {}
|
|
158
|
-
|
|
159
|
-
// Polyfill for Function.prototype.bind
|
|
160
|
-
function bind(fn, thisArg) {
|
|
161
|
-
return function () {
|
|
162
|
-
fn.apply(thisArg, arguments);
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function Promise(fn) {
|
|
167
|
-
if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');
|
|
168
|
-
if (typeof fn !== 'function') throw new TypeError('not a function');
|
|
169
|
-
this._state = 0;
|
|
170
|
-
this._handled = false;
|
|
171
|
-
this._value = undefined;
|
|
172
|
-
this._deferreds = [];
|
|
173
|
-
|
|
174
|
-
doResolve(fn, this);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function handle(self, deferred) {
|
|
178
|
-
while (self._state === 3) {
|
|
179
|
-
self = self._value;
|
|
180
|
-
}
|
|
181
|
-
if (self._state === 0) {
|
|
182
|
-
self._deferreds.push(deferred);
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
self._handled = true;
|
|
186
|
-
Promise._immediateFn(function () {
|
|
187
|
-
var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
|
|
188
|
-
if (cb === null) {
|
|
189
|
-
(self._state === 1 ? resolve : reject)(deferred.promise, self._value);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
var ret;
|
|
193
|
-
try {
|
|
194
|
-
ret = cb(self._value);
|
|
195
|
-
} catch (e) {
|
|
196
|
-
reject(deferred.promise, e);
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
resolve(deferred.promise, ret);
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function resolve(self, newValue) {
|
|
204
|
-
try {
|
|
205
|
-
// Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
|
|
206
|
-
if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
|
|
207
|
-
if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
|
|
208
|
-
var then = newValue.then;
|
|
209
|
-
if (newValue instanceof Promise) {
|
|
210
|
-
self._state = 3;
|
|
211
|
-
self._value = newValue;
|
|
212
|
-
finale(self);
|
|
213
|
-
return;
|
|
214
|
-
} else if (typeof then === 'function') {
|
|
215
|
-
doResolve(bind(then, newValue), self);
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
self._state = 1;
|
|
220
|
-
self._value = newValue;
|
|
221
|
-
finale(self);
|
|
222
|
-
} catch (e) {
|
|
223
|
-
reject(self, e);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function reject(self, newValue) {
|
|
228
|
-
self._state = 2;
|
|
229
|
-
self._value = newValue;
|
|
230
|
-
finale(self);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
function finale(self) {
|
|
234
|
-
if (self._state === 2 && self._deferreds.length === 0) {
|
|
235
|
-
Promise._immediateFn(function() {
|
|
236
|
-
if (!self._handled) {
|
|
237
|
-
Promise._unhandledRejectionFn(self._value);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
for (var i = 0, len = self._deferreds.length; i < len; i++) {
|
|
243
|
-
handle(self, self._deferreds[i]);
|
|
244
|
-
}
|
|
245
|
-
self._deferreds = null;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function Handler(onFulfilled, onRejected, promise) {
|
|
249
|
-
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
|
|
250
|
-
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
|
|
251
|
-
this.promise = promise;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Take a potentially misbehaving resolver function and make sure
|
|
256
|
-
* onFulfilled and onRejected are only called once.
|
|
257
|
-
*
|
|
258
|
-
* Makes no guarantees about asynchrony.
|
|
259
|
-
*/
|
|
260
|
-
function doResolve(fn, self) {
|
|
261
|
-
var done = false;
|
|
262
|
-
try {
|
|
263
|
-
fn(function (value) {
|
|
264
|
-
if (done) return;
|
|
265
|
-
done = true;
|
|
266
|
-
resolve(self, value);
|
|
267
|
-
}, function (reason) {
|
|
268
|
-
if (done) return;
|
|
269
|
-
done = true;
|
|
270
|
-
reject(self, reason);
|
|
271
|
-
});
|
|
272
|
-
} catch (ex) {
|
|
273
|
-
if (done) return;
|
|
274
|
-
done = true;
|
|
275
|
-
reject(self, ex);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
Promise.prototype['catch'] = function (onRejected) {
|
|
280
|
-
return this.then(null, onRejected);
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
Promise.prototype.then = function (onFulfilled, onRejected) {
|
|
284
|
-
var prom = new (this.constructor)(noop);
|
|
285
|
-
|
|
286
|
-
handle(this, new Handler(onFulfilled, onRejected, prom));
|
|
287
|
-
return prom;
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
Promise.all = function (arr) {
|
|
291
|
-
var args = Array.prototype.slice.call(arr);
|
|
292
|
-
|
|
293
|
-
return new Promise(function (resolve, reject) {
|
|
294
|
-
if (args.length === 0) return resolve([]);
|
|
295
|
-
var remaining = args.length;
|
|
296
|
-
|
|
297
|
-
function res(i, val) {
|
|
298
|
-
try {
|
|
299
|
-
if (val && (typeof val === 'object' || typeof val === 'function')) {
|
|
300
|
-
var then = val.then;
|
|
301
|
-
if (typeof then === 'function') {
|
|
302
|
-
then.call(val, function (val) {
|
|
303
|
-
res(i, val);
|
|
304
|
-
}, reject);
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
args[i] = val;
|
|
309
|
-
if (--remaining === 0) {
|
|
310
|
-
resolve(args);
|
|
311
|
-
}
|
|
312
|
-
} catch (ex) {
|
|
313
|
-
reject(ex);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
for (var i = 0; i < args.length; i++) {
|
|
318
|
-
res(i, args[i]);
|
|
319
|
-
}
|
|
320
|
-
});
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
Promise.resolve = function (value) {
|
|
324
|
-
if (value && typeof value === 'object' && value.constructor === Promise) {
|
|
325
|
-
return value;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return new Promise(function (resolve) {
|
|
329
|
-
resolve(value);
|
|
330
|
-
});
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
Promise.reject = function (value) {
|
|
334
|
-
return new Promise(function (resolve, reject) {
|
|
335
|
-
reject(value);
|
|
336
|
-
});
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
Promise.race = function (values) {
|
|
340
|
-
return new Promise(function (resolve, reject) {
|
|
341
|
-
for (var i = 0, len = values.length; i < len; i++) {
|
|
342
|
-
values[i].then(resolve, reject);
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
// Use polyfill for setImmediate for performance gains
|
|
348
|
-
Promise._immediateFn = (typeof setImmediate === 'function' && function (fn) { setImmediate(fn); }) ||
|
|
349
|
-
function (fn) {
|
|
350
|
-
setTimeoutFunc(fn, 0);
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
|
|
354
|
-
if (typeof console !== 'undefined' && console) {
|
|
355
|
-
console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* Set the immediate function to execute callbacks
|
|
361
|
-
* @param fn {function} Function to execute
|
|
362
|
-
* @deprecated
|
|
363
|
-
*/
|
|
364
|
-
Promise._setImmediateFn = function _setImmediateFn(fn) {
|
|
365
|
-
Promise._immediateFn = fn;
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* Change the function to execute on unhandled rejection
|
|
370
|
-
* @param {function} fn Function to execute on unhandled rejection
|
|
371
|
-
* @deprecated
|
|
372
|
-
*/
|
|
373
|
-
Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
|
|
374
|
-
Promise._unhandledRejectionFn = fn;
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
window.Promise = Promise;
|
|
378
|
-
|
|
379
|
-
})(this);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
if(!Element.prototype.remove) {
|
|
383
|
-
(function (arr) {
|
|
384
|
-
arr.forEach(function (item) {
|
|
385
|
-
item.remove = item.remove || function () {
|
|
386
|
-
this.parentNode.removeChild(this);
|
|
387
|
-
};
|
|
388
|
-
});
|
|
389
|
-
})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
module.exports = polyfills;
|