@testim/testim-cli 3.253.0 → 3.254.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 (79) hide show
  1. package/OverrideTestDataBuilder.js +1 -1
  2. package/agent/routers/cliJsCode/index.js +4 -4
  3. package/agent/routers/cliJsCode/router.js +46 -42
  4. package/agent/routers/cliJsCode/service.js +18 -13
  5. package/agent/routers/codim/router.js +14 -17
  6. package/agent/routers/codim/router.test.js +15 -14
  7. package/agent/routers/codim/service.js +1 -1
  8. package/agent/routers/general/index.js +4 -8
  9. package/agent/routers/hybrid/registerRoutes.js +18 -18
  10. package/agent/routers/index.js +7 -7
  11. package/agent/routers/playground/router.js +11 -10
  12. package/agent/routers/playground/service.js +19 -18
  13. package/agent/routers/standalone-browser/registerRoutes.js +10 -10
  14. package/cdpTestRunner.js +4 -3
  15. package/chromiumInstaller.js +4 -5
  16. package/cli/onExit.js +2 -2
  17. package/cli.js +7 -6
  18. package/cliAgentMode.js +4 -5
  19. package/codim/codim-cli.js +11 -10
  20. package/codim/hybrid-utils.js +1 -1
  21. package/codim/measure-perf.js +9 -6
  22. package/codim/template.js/tests/examples/01-simple-text-validation.test.js +6 -6
  23. package/codim/template.js/tests/examples/02-using-locators.test.js +13 -15
  24. package/codim/template.js/tests/examples/03-using-hooks.test.js +17 -19
  25. package/codim/template.js/tests/examples/04-skip-and-only.test.js +16 -17
  26. package/codim/template.js/tests/examples/05-multiple-windows.test.js +16 -17
  27. package/codim/template.js/webpack.config.js +1 -1
  28. package/codim/template.ts/webpack.config.js +3 -3
  29. package/commons/AbortError.js +4 -4
  30. package/commons/detectDebugger.js +4 -2
  31. package/commons/lazyRequire.js +10 -9
  32. package/commons/logger.js +4 -4
  33. package/commons/performance-logger.js +14 -8
  34. package/commons/prepareRunnerAndTestimStartUtils.js +6 -7
  35. package/commons/socket/baseSocketServiceSocketIO.js +32 -34
  36. package/commons/socket/realDataService.js +6 -5
  37. package/commons/socket/realDataServiceSocketIO.js +4 -4
  38. package/commons/socket/remoteStepService.js +4 -3
  39. package/commons/socket/remoteStepServiceSocketIO.js +11 -12
  40. package/commons/socket/socketService.js +50 -52
  41. package/commons/socket/testResultServiceSocketIO.js +11 -11
  42. package/commons/testimDesiredCapabilitiesBuilder.js +3 -2
  43. package/commons/testimNgrok.js +2 -2
  44. package/commons/testimNgrok.test.js +1 -1
  45. package/commons/testimServicesApi.js +27 -20
  46. package/commons/xhr2.js +97 -100
  47. package/errors.js +5 -0
  48. package/fixLocalBuild.js +2 -0
  49. package/npm-shrinkwrap.json +2515 -1256
  50. package/package.json +6 -6
  51. package/player/appiumTestPlayer.js +1 -1
  52. package/player/chromeLauncherTestPlayer.js +0 -1
  53. package/player/services/tabServiceMock.js +166 -0
  54. package/player/stepActions/navigationStepAction.js +11 -10
  55. package/player/stepActions/sleepStepAction.js +4 -5
  56. package/player/stepActions/textStepAction.js +4 -11
  57. package/player/utils/windowUtils.js +4 -3
  58. package/player/webdriver.js +1 -1
  59. package/processHandler.js +3 -3
  60. package/processHandler.test.js +1 -1
  61. package/reports/consoleReporter.js +3 -2
  62. package/reports/junitReporter.js +1 -2
  63. package/runOptions.js +6 -6
  64. package/runner.js +13 -0
  65. package/runners/TestPlanRunner.js +142 -74
  66. package/runners/buildCodeTests.js +38 -37
  67. package/runners/runnerUtils.js +3 -3
  68. package/services/lambdatestService.js +3 -5
  69. package/stepPlayers/cliJsStepPlayback.js +22 -17
  70. package/testRunHandler.js +8 -0
  71. package/testRunStatus.js +1 -1
  72. package/{utils.js → utils/index.js} +25 -117
  73. package/utils/promiseUtils.js +78 -0
  74. package/utils/stringUtils.js +96 -0
  75. package/{utils.test.js → utils/utils.test.js} +2 -2
  76. package/workers/BaseWorker.js +16 -14
  77. package/workers/WorkerAppium.js +1 -1
  78. package/workers/WorkerExtensionSingleBrowser.js +4 -4
  79. package/workers/WorkerSelenium.js +5 -2
package/commons/xhr2.js CHANGED
@@ -1,23 +1,24 @@
1
- var FormData = require('form-data');
1
+ /* eslint-disable */
2
+ const FormData = require('form-data');
2
3
 
3
4
  (function () {
4
- var InvalidStateError, NetworkError, ProgressEvent, SecurityError, SyntaxError, XMLHttpRequest, XMLHttpRequestEventTarget, XMLHttpRequestUpload, http, https, os, url,
5
- extend = function (child, parent) {
6
- for (var key in parent) {
7
- if (hasProp.call(parent, key)) {
8
- child[key] = parent[key];
9
- }
10
- }
11
- function ctor() {
12
- this.constructor = child;
5
+ let InvalidStateError; let NetworkError; let ProgressEvent; let SecurityError; let SyntaxError; let XMLHttpRequest; let XMLHttpRequestEventTarget; let XMLHttpRequestUpload; let http; let https; let os; let url;
6
+ const extend = function (child, parent) {
7
+ for (const key in parent) {
8
+ if (hasProp.call(parent, key)) {
9
+ child[key] = parent[key];
13
10
  }
11
+ }
12
+ function ctor() {
13
+ this.constructor = child;
14
+ }
14
15
 
15
- ctor.prototype = parent.prototype;
16
- child.prototype = new ctor();
17
- child.__super__ = parent.prototype;
18
- return child;
19
- },
20
- hasProp = {}.hasOwnProperty;
16
+ ctor.prototype = parent.prototype;
17
+ child.prototype = new ctor();
18
+ child.__super__ = parent.prototype;
19
+ return child;
20
+ };
21
+ var hasProp = {}.hasOwnProperty;
21
22
 
22
23
  XMLHttpRequestEventTarget = (function () {
23
24
  function XMLHttpRequestEventTarget() {
@@ -46,7 +47,7 @@ var FormData = require('form-data');
46
47
  XMLHttpRequestEventTarget.prototype.onloadend = null;
47
48
 
48
49
  XMLHttpRequestEventTarget.prototype.addEventListener = function (eventType, listener) {
49
- var base;
50
+ let base;
50
51
  eventType = eventType.toLowerCase();
51
52
  (base = this._listeners)[eventType] || (base[eventType] = []);
52
53
  this._listeners[eventType].push(listener);
@@ -54,7 +55,7 @@ var FormData = require('form-data');
54
55
  };
55
56
 
56
57
  XMLHttpRequestEventTarget.prototype.removeEventListener = function (eventType, listener) {
57
- var index;
58
+ let index;
58
59
  eventType = eventType.toLowerCase();
59
60
  if (this._listeners[eventType]) {
60
61
  index = this._listeners[eventType].indexOf(listener);
@@ -66,7 +67,8 @@ var FormData = require('form-data');
66
67
  };
67
68
 
68
69
  XMLHttpRequestEventTarget.prototype.dispatchEvent = function (event) {
69
- var eventType, j, len, listener, listeners;
70
+ let eventType; let j; let len; let listener; let
71
+ listeners;
70
72
  event.currentTarget = event.target = this;
71
73
  eventType = event.type;
72
74
  if (listeners = this._listeners[eventType]) {
@@ -75,15 +77,14 @@ var FormData = require('form-data');
75
77
  listener.call(this, event);
76
78
  }
77
79
  }
78
- if (listener = this["on" + eventType]) {
80
+ if (listener = this[`on${eventType}`]) {
79
81
  listener.call(this, event);
80
82
  }
81
83
  return void 0;
82
84
  };
83
85
 
84
86
  return XMLHttpRequestEventTarget;
85
-
86
- })();
87
+ }());
87
88
 
88
89
  http = require('http');
89
90
 
@@ -142,10 +143,10 @@ var FormData = require('form-data');
142
143
  XMLHttpRequest.prototype.upload = null;
143
144
 
144
145
  XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
145
- var xhrUrl;
146
+ let xhrUrl;
146
147
  method = method.toUpperCase();
147
148
  if (method in this._restrictedMethods) {
148
- throw new SecurityError("HTTP method " + method + " is not allowed in XHR");
149
+ throw new SecurityError(`HTTP method ${method} is not allowed in XHR`);
149
150
  }
150
151
  xhrUrl = this._parseUrl(url);
151
152
  if (async === void 0) {
@@ -181,9 +182,9 @@ var FormData = require('form-data');
181
182
  };
182
183
 
183
184
  XMLHttpRequest.prototype.setRequestHeader = function (name, value) {
184
- var loweredName;
185
+ let loweredName;
185
186
  if (this.readyState !== XMLHttpRequest.OPENED) {
186
- throw new InvalidStateError("XHR readyState must be OPENED");
187
+ throw new InvalidStateError('XHR readyState must be OPENED');
187
188
  }
188
189
  loweredName = name.toLowerCase();
189
190
  if (this._restrictedHeaders[loweredName] || /^sec\-/.test(loweredName) || /^proxy-/.test(loweredName)) {
@@ -192,7 +193,7 @@ var FormData = require('form-data');
192
193
  value = value.toString();
193
194
  if (loweredName in this._loweredHeaders) {
194
195
  name = this._loweredHeaders[loweredName];
195
- this._headers[name] = this._headers[name] + ', ' + value;
196
+ this._headers[name] = `${this._headers[name]}, ${value}`;
196
197
  } else {
197
198
  this._loweredHeaders[loweredName] = name;
198
199
  this._headers[name] = value;
@@ -202,10 +203,10 @@ var FormData = require('form-data');
202
203
 
203
204
  XMLHttpRequest.prototype.send = function (data) {
204
205
  if (this.readyState !== XMLHttpRequest.OPENED) {
205
- throw new InvalidStateError("XHR readyState must be OPENED");
206
+ throw new InvalidStateError('XHR readyState must be OPENED');
206
207
  }
207
208
  if (this._request) {
208
- throw new InvalidStateError("send() already called");
209
+ throw new InvalidStateError('send() already called');
209
210
  }
210
211
  switch (this._url.protocol) {
211
212
  case 'file:':
@@ -216,7 +217,7 @@ var FormData = require('form-data');
216
217
  this._sendHttp(data);
217
218
  break;
218
219
  default:
219
- throw new NetworkError("Unsupported protocol " + this._url.protocol);
220
+ throw new NetworkError(`Unsupported protocol ${this._url.protocol}`);
220
221
  }
221
222
  return void 0;
222
223
  };
@@ -233,46 +234,48 @@ var FormData = require('form-data');
233
234
  };
234
235
 
235
236
  XMLHttpRequest.prototype.getResponseHeader = function (name) {
236
- var loweredName;
237
+ let loweredName;
237
238
  if (!this._responseHeaders) {
238
239
  return null;
239
240
  }
240
241
  loweredName = name.toLowerCase();
241
242
  if (loweredName in this._responseHeaders) {
242
243
  return this._responseHeaders[loweredName];
243
- } else {
244
- return null;
245
244
  }
245
+ return null;
246
246
  };
247
247
 
248
248
  XMLHttpRequest.prototype.getAllResponseHeaders = function () {
249
- var lines, name, value;
249
+ let lines; let name; let
250
+ value;
250
251
  if (!this._responseHeaders) {
251
252
  return '';
252
253
  }
253
254
  lines = (function () {
254
- var ref, results;
255
+ let ref; let
256
+ results;
255
257
  ref = this._responseHeaders;
256
258
  results = [];
257
259
  for (name in ref) {
258
260
  value = ref[name];
259
- results.push(name + ": " + value);
261
+ results.push(`${name}: ${value}`);
260
262
  }
261
263
  return results;
262
264
  }).call(this);
263
- return lines.join("\r\n");
265
+ return lines.join('\r\n');
264
266
  };
265
267
 
266
268
  XMLHttpRequest.prototype.overrideMimeType = function (newMimeType) {
267
269
  if (this.readyState === XMLHttpRequest.LOADING || this.readyState === XMLHttpRequest.DONE) {
268
- throw new InvalidStateError("overrideMimeType() not allowed in LOADING or DONE");
270
+ throw new InvalidStateError('overrideMimeType() not allowed in LOADING or DONE');
269
271
  }
270
272
  this._mimeOverride = newMimeType.toLowerCase();
271
273
  return void 0;
272
274
  };
273
275
 
274
276
  XMLHttpRequest.prototype.nodejsSet = function (options) {
275
- var baseUrl, parsedUrl;
277
+ let baseUrl; let
278
+ parsedUrl;
276
279
  if ('httpAgent' in options) {
277
280
  this.nodejsHttpAgent = options.httpAgent;
278
281
  }
@@ -284,7 +287,7 @@ var FormData = require('form-data');
284
287
  if (baseUrl !== null) {
285
288
  parsedUrl = url.parse(baseUrl, false, true);
286
289
  if (!parsedUrl.protocol) {
287
- throw new SyntaxError("baseUrl must be an absolute URL");
290
+ throw new SyntaxError('baseUrl must be an absolute URL');
288
291
  }
289
292
  }
290
293
  this.nodejsBaseUrl = baseUrl;
@@ -326,7 +329,7 @@ var FormData = require('form-data');
326
329
  XMLHttpRequest.prototype._restrictedMethods = {
327
330
  CONNECT: true,
328
331
  TRACE: true,
329
- TRACK: true
332
+ TRACK: true,
330
333
  };
331
334
 
332
335
  XMLHttpRequest.prototype._restrictedHeaders = {
@@ -350,18 +353,18 @@ var FormData = require('form-data');
350
353
  'transfer-encoding': true,
351
354
  upgrade: true,
352
355
  'user-agent': true,
353
- via: true
356
+ via: true,
354
357
  };
355
358
 
356
359
  XMLHttpRequest.prototype._privateHeaders = {
357
360
  'set-cookie': false,
358
- 'set-cookie2': false
361
+ 'set-cookie2': false,
359
362
  };
360
363
 
361
- XMLHttpRequest.prototype._userAgent = ("Mozilla/5.0 (" + (os.type()) + " " + (os.arch()) + ") ") + ("node.js/" + process.versions.node + " v8/" + process.versions.v8);
364
+ XMLHttpRequest.prototype._userAgent = `Mozilla/5.0 (${os.type()} ${os.arch()}) ` + `node.js/${process.versions.node} v8/${process.versions.v8}`;
362
365
 
363
366
  XMLHttpRequest.prototype._setReadyState = function (newReadyState) {
364
- var event;
367
+ let event;
365
368
  this.readyState = newReadyState;
366
369
  event = new ProgressEvent('readystatechange');
367
370
  this.dispatchEvent(event);
@@ -372,12 +375,12 @@ var FormData = require('form-data');
372
375
  if (this._url.method !== 'GET') {
373
376
  throw new NetworkError('The file protocol only supports GET');
374
377
  }
375
- throw new Error("Protocol file: not implemented");
378
+ throw new Error('Protocol file: not implemented');
376
379
  };
377
380
 
378
381
  XMLHttpRequest.prototype._sendHttp = function (data) {
379
382
  if (this._sync) {
380
- throw new Error("Synchronous XHR processing not implemented");
383
+ throw new Error('Synchronous XHR processing not implemented');
381
384
  }
382
385
  if ((data != null) && (this._method === 'GET' || this._method === 'HEAD')) {
383
386
  data = null;
@@ -391,7 +394,8 @@ var FormData = require('form-data');
391
394
  };
392
395
 
393
396
  XMLHttpRequest.prototype._sendHxxpRequest = function (data) {
394
- var agent, hxxp, request;
397
+ let agent; let hxxp; let
398
+ request;
395
399
  if (this._url.protocol === 'http:') {
396
400
  hxxp = http;
397
401
  agent = this.nodejsHttpAgent;
@@ -406,7 +410,7 @@ var FormData = require('form-data');
406
410
  auth: this._url.auth,
407
411
  method: this._method,
408
412
  headers: this._headers,
409
- agent: agent
413
+ agent,
410
414
  });
411
415
 
412
416
  if (typeof data === 'object' && data instanceof FormData) {
@@ -419,18 +423,18 @@ var FormData = require('form-data');
419
423
  return function () {
420
424
  return _this._onHttpTimeout(request);
421
425
  };
422
- })(this));
426
+ }(this)));
423
427
  }
424
428
  request.on('response', (function (_this) {
425
429
  return function (response) {
426
430
  return _this._onHttpResponse(request, response);
427
431
  };
428
- })(this));
432
+ }(this)));
429
433
  request.on('error', (function (_this) {
430
434
  return function (error) {
431
435
  return _this._onHttpRequestError(request, error);
432
436
  };
433
- })(this));
437
+ }(this)));
434
438
  this.upload._startUpload(request);
435
439
  if (this._request === request) {
436
440
  this._dispatchProgress('loadstart');
@@ -442,10 +446,10 @@ var FormData = require('form-data');
442
446
  if (typeof data === 'object' && data instanceof FormData) {
443
447
  Object.assign(this._headers, data.getHeaders());
444
448
  }
445
- this._headers['Connection'] = 'keep-alive';
446
- this._headers['Host'] = this._url.host;
449
+ this._headers.Connection = 'keep-alive';
450
+ this._headers.Host = this._url.host;
447
451
  if (this._anonymous) {
448
- this._headers['Referer'] = 'about:blank';
452
+ this._headers.Referer = 'about:blank';
449
453
  }
450
454
  this._headers['User-Agent'] = this._userAgent;
451
455
  this.upload._finalizeHeaders(this._headers, this._loweredHeaders);
@@ -453,7 +457,7 @@ var FormData = require('form-data');
453
457
  };
454
458
 
455
459
  XMLHttpRequest.prototype._onHttpResponse = function (request, response) {
456
- var lengthString;
460
+ let lengthString;
457
461
  if (this._request !== request) {
458
462
  return;
459
463
  }
@@ -463,7 +467,7 @@ var FormData = require('form-data');
463
467
  case 303:
464
468
  case 307:
465
469
  case 308:
466
- this._url = this._parseUrl(response.headers['location']);
470
+ this._url = this._parseUrl(response.headers.location);
467
471
  this._method = 'GET';
468
472
  if ('content-type' in this._loweredHeaders) {
469
473
  delete this._headers[this._loweredHeaders['content-type']];
@@ -483,17 +487,17 @@ var FormData = require('form-data');
483
487
  return function (data) {
484
488
  return _this._onHttpResponseData(response, data);
485
489
  };
486
- })(this));
490
+ }(this)));
487
491
  this._response.on('end', (function (_this) {
488
492
  return function () {
489
493
  return _this._onHttpResponseEnd(response);
490
494
  };
491
- })(this));
495
+ }(this)));
492
496
  this._response.on('close', (function (_this) {
493
497
  return function () {
494
498
  return _this._onHttpResponseClose(response);
495
499
  };
496
- })(this));
500
+ }(this)));
497
501
  this.status = this._response.statusCode;
498
502
  this.statusText = http.STATUS_CODES[this.status];
499
503
  this._parseResponseHeaders(response);
@@ -531,7 +535,7 @@ var FormData = require('form-data');
531
535
  };
532
536
 
533
537
  XMLHttpRequest.prototype._onHttpResponseClose = function (response) {
534
- var request;
538
+ let request;
535
539
  if (this._response !== response) {
536
540
  return;
537
541
  }
@@ -566,7 +570,7 @@ var FormData = require('form-data');
566
570
  };
567
571
 
568
572
  XMLHttpRequest.prototype._dispatchProgress = function (eventType) {
569
- var event;
573
+ let event;
570
574
  event = new ProgressEvent(eventType);
571
575
  event.lengthComputable = this._lengthComputable;
572
576
  event.loaded = this._loadedBytes;
@@ -584,7 +588,8 @@ var FormData = require('form-data');
584
588
  };
585
589
 
586
590
  XMLHttpRequest.prototype._parseUrl = function (urlString) {
587
- var absoluteUrlString, index, password, user, xhrUrl;
591
+ let absoluteUrlString; let index; let password; let user; let
592
+ xhrUrl;
588
593
  if (this.nodejsBaseUrl === null) {
589
594
  absoluteUrlString = urlString;
590
595
  } else {
@@ -592,7 +597,7 @@ var FormData = require('form-data');
592
597
  }
593
598
  xhrUrl = url.parse(absoluteUrlString, false, true);
594
599
  xhrUrl.hash = null;
595
- if (xhrUrl.auth && ((typeof user !== "undefined" && user !== null) || (typeof password !== "undefined" && password !== null))) {
600
+ if (xhrUrl.auth && ((typeof user !== 'undefined' && user !== null) || (typeof password !== 'undefined' && password !== null))) {
596
601
  index = xhrUrl.auth.indexOf(':');
597
602
  if (index === -1) {
598
603
  if (!user) {
@@ -608,13 +613,14 @@ var FormData = require('form-data');
608
613
  }
609
614
  }
610
615
  if (user || password) {
611
- xhrUrl.auth = user + ":" + password;
616
+ xhrUrl.auth = `${user}:${password}`;
612
617
  }
613
618
  return xhrUrl;
614
619
  };
615
620
 
616
621
  XMLHttpRequest.prototype._parseResponseHeaders = function (response) {
617
- var loweredName, name, ref, value;
622
+ let loweredName; let name; let ref; let
623
+ value;
618
624
  this._responseHeaders = {};
619
625
  ref = response.headers;
620
626
  for (name in ref) {
@@ -635,7 +641,8 @@ var FormData = require('form-data');
635
641
  };
636
642
 
637
643
  XMLHttpRequest.prototype._parseResponse = function () {
638
- var arrayBuffer, buffer, i, j, jsonError, ref, view;
644
+ let arrayBuffer; let buffer; let i; let j; let jsonError; let ref; let
645
+ view;
639
646
  if (Buffer.concat) {
640
647
  buffer = Buffer.concat(this._responseParts);
641
648
  } else {
@@ -667,7 +674,7 @@ var FormData = require('form-data');
667
674
  this.responseText = null;
668
675
  arrayBuffer = new ArrayBuffer(buffer.length);
669
676
  view = new Uint8Array(arrayBuffer);
670
- for (i = j = 0, ref = buffer.length; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
677
+ for (i = j = 0, ref = buffer.length; ref >= 0 ? j < ref : j > ref; i = ref >= 0 ? ++j : --j) {
671
678
  view[i] = buffer[i];
672
679
  }
673
680
  this.response = arrayBuffer;
@@ -679,7 +686,7 @@ var FormData = require('form-data');
679
686
  };
680
687
 
681
688
  XMLHttpRequest.prototype._parseTextResponse = function (buffer) {
682
- var e;
689
+ let e;
683
690
  try {
684
691
  this.responseText = buffer.toString(this._parseResponseEncoding());
685
692
  } catch (_error) {
@@ -691,18 +698,18 @@ var FormData = require('form-data');
691
698
  };
692
699
 
693
700
  XMLHttpRequest.prototype._parseResponseEncoding = function () {
694
- var contentType, encoding, match;
701
+ let contentType; let encoding; let
702
+ match;
695
703
  encoding = null;
696
- if (contentType = this._responseHeaders['content-type']) {
697
- if (match = /\;\s*charset\=(.*)$/.exec(contentType)) {
698
- return match[1];
699
- }
704
+ if ((contentType = this._responseHeaders['content-type']) && (match = /\;\s*charset\=(.*)$/.exec(contentType))) {
705
+ return match[1];
700
706
  }
701
707
  return 'utf-8';
702
708
  };
703
709
 
704
710
  XMLHttpRequest.prototype._concatBuffers = function (buffers) {
705
- var buffer, j, k, len, len1, length, target;
711
+ let buffer; let j; let k; let len; let len1; let length; let
712
+ target;
706
713
  if (buffers.length === 0) {
707
714
  return Buffer.alloc(0);
708
715
  }
@@ -725,8 +732,7 @@ var FormData = require('form-data');
725
732
  };
726
733
 
727
734
  return XMLHttpRequest;
728
-
729
- })(XMLHttpRequestEventTarget);
735
+ }(XMLHttpRequestEventTarget));
730
736
 
731
737
  module.exports = XMLHttpRequest;
732
738
 
@@ -740,8 +746,7 @@ var FormData = require('form-data');
740
746
  }
741
747
 
742
748
  return SecurityError;
743
-
744
- })(Error);
749
+ }(Error));
745
750
 
746
751
  XMLHttpRequest.SecurityError = SecurityError;
747
752
 
@@ -753,8 +758,7 @@ var FormData = require('form-data');
753
758
  }
754
759
 
755
760
  return InvalidStateError;
756
-
757
- })(Error);
761
+ }(Error));
758
762
 
759
763
  InvalidStateError = (function (superClass) {
760
764
  extend(InvalidStateError, superClass);
@@ -764,8 +768,7 @@ var FormData = require('form-data');
764
768
  }
765
769
 
766
770
  return InvalidStateError;
767
-
768
- })(Error);
771
+ }(Error));
769
772
 
770
773
  XMLHttpRequest.InvalidStateError = InvalidStateError;
771
774
 
@@ -777,8 +780,7 @@ var FormData = require('form-data');
777
780
  }
778
781
 
779
782
  return NetworkError;
780
-
781
- })(Error);
783
+ }(Error));
782
784
 
783
785
  XMLHttpRequest.SyntaxError = SyntaxError;
784
786
 
@@ -790,8 +792,7 @@ var FormData = require('form-data');
790
792
  }
791
793
 
792
794
  return SyntaxError;
793
-
794
- })(Error);
795
+ }(Error));
795
796
 
796
797
  ProgressEvent = (function () {
797
798
  function ProgressEvent(type) {
@@ -816,8 +817,7 @@ var FormData = require('form-data');
816
817
  ProgressEvent.prototype.total = null;
817
818
 
818
819
  return ProgressEvent;
819
-
820
- })();
820
+ }());
821
821
 
822
822
  XMLHttpRequest.ProgressEvent = ProgressEvent;
823
823
 
@@ -837,7 +837,8 @@ var FormData = require('form-data');
837
837
  };
838
838
 
839
839
  XMLHttpRequestUpload.prototype._setData = function (data) {
840
- var body, i, j, k, offset, ref, ref1, view;
840
+ let body; let i; let j; let k; let offset; let ref; let ref1; let
841
+ view;
841
842
  if (typeof data === 'undefined' || data === null) {
842
843
  return;
843
844
  }
@@ -851,7 +852,7 @@ var FormData = require('form-data');
851
852
  } else if (data instanceof ArrayBuffer) {
852
853
  body = Buffer.alloc(data.byteLength);
853
854
  view = new Uint8Array(data);
854
- for (i = j = 0, ref = data.byteLength; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
855
+ for (i = j = 0, ref = data.byteLength; ref >= 0 ? j < ref : j > ref; i = ref >= 0 ? ++j : --j) {
855
856
  body[i] = view[i];
856
857
  }
857
858
  this._body = body;
@@ -859,23 +860,21 @@ var FormData = require('form-data');
859
860
  body = Buffer.alloc(data.byteLength);
860
861
  offset = data.byteOffset;
861
862
  view = new Uint8Array(data.buffer);
862
- for (i = k = 0, ref1 = data.byteLength; 0 <= ref1 ? k < ref1 : k > ref1; i = 0 <= ref1 ? ++k : --k) {
863
+ for (i = k = 0, ref1 = data.byteLength; ref1 >= 0 ? k < ref1 : k > ref1; i = ref1 >= 0 ? ++k : --k) {
863
864
  body[i] = view[i + offset];
864
865
  }
865
866
  this._body = body;
866
867
  } else if (typeof data === 'object' && data instanceof FormData) {
867
868
  this._body = null;
868
869
  } else {
869
- throw new Error("Unsupported send() data " + data);
870
+ throw new Error(`Unsupported send() data ${data}`);
870
871
  }
871
872
  return void 0;
872
873
  };
873
874
 
874
875
  XMLHttpRequestUpload.prototype._finalizeHeaders = function (headers, loweredHeaders) {
875
- if (this._contentType) {
876
- if (!('content-type' in loweredHeaders)) {
877
- headers['Content-Type'] = this._contentType;
878
- }
876
+ if (this._contentType && !('content-type' in loweredHeaders)) {
877
+ headers['Content-Type'] = this._contentType;
879
878
  }
880
879
  if (this._body) {
881
880
  headers['Content-Length'] = this._body.length.toString();
@@ -892,9 +891,7 @@ var FormData = require('form-data');
892
891
  };
893
892
 
894
893
  return XMLHttpRequestUpload;
895
-
896
- })(XMLHttpRequestEventTarget);
894
+ }(XMLHttpRequestEventTarget));
897
895
 
898
896
  XMLHttpRequest.XMLHttpRequestUpload = XMLHttpRequestUpload;
899
-
900
897
  }).call(this);
package/errors.js CHANGED
@@ -1,4 +1,5 @@
1
1
  const { AbortError } = require('p-retry');
2
+ const { TimeoutError: _TimeoutError } = require('bluebird');
2
3
  /**
3
4
  * NoArgsError - throws when arguments not passed to cli
4
5
  *
@@ -61,6 +62,9 @@ class GetBrowserError extends Error {
61
62
  class PageNotAvailableError extends AbortError {
62
63
  }
63
64
 
65
+ class TimeoutError extends _TimeoutError {
66
+ }
67
+
64
68
  class QuotaDepletedError extends Error { }
65
69
 
66
70
  class GridError extends Error {
@@ -148,4 +152,5 @@ module.exports = {
148
152
  ClientError,
149
153
  PlaygroundCodeError,
150
154
  NotImplementedError,
155
+ TimeoutError,
151
156
  };
package/fixLocalBuild.js CHANGED
@@ -1,3 +1,5 @@
1
+ /* eslint-disable no-console */
2
+
1
3
  'use strict';
2
4
 
3
5
  // fixes the local build if running the runner locally