@telefonica/acceptance-testing 2.15.0 → 2.17.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.
@@ -5,6 +5,307 @@ import { queries, getDocument } from 'pptr-testing-library';
5
5
  import { configureToMatchImageSnapshot } from 'jest-image-snapshot';
6
6
  import globToRegExp from 'glob-to-regexp';
7
7
 
8
+ function _regeneratorRuntime() {
9
+ _regeneratorRuntime = function () {
10
+ return exports;
11
+ };
12
+ var exports = {},
13
+ Op = Object.prototype,
14
+ hasOwn = Op.hasOwnProperty,
15
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
16
+ obj[key] = desc.value;
17
+ },
18
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
19
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
20
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
21
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
22
+ function define(obj, key, value) {
23
+ return Object.defineProperty(obj, key, {
24
+ value: value,
25
+ enumerable: !0,
26
+ configurable: !0,
27
+ writable: !0
28
+ }), obj[key];
29
+ }
30
+ try {
31
+ define({}, "");
32
+ } catch (err) {
33
+ define = function (obj, key, value) {
34
+ return obj[key] = value;
35
+ };
36
+ }
37
+ function wrap(innerFn, outerFn, self, tryLocsList) {
38
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
39
+ generator = Object.create(protoGenerator.prototype),
40
+ context = new Context(tryLocsList || []);
41
+ return defineProperty(generator, "_invoke", {
42
+ value: makeInvokeMethod(innerFn, self, context)
43
+ }), generator;
44
+ }
45
+ function tryCatch(fn, obj, arg) {
46
+ try {
47
+ return {
48
+ type: "normal",
49
+ arg: fn.call(obj, arg)
50
+ };
51
+ } catch (err) {
52
+ return {
53
+ type: "throw",
54
+ arg: err
55
+ };
56
+ }
57
+ }
58
+ exports.wrap = wrap;
59
+ var ContinueSentinel = {};
60
+ function Generator() {}
61
+ function GeneratorFunction() {}
62
+ function GeneratorFunctionPrototype() {}
63
+ var IteratorPrototype = {};
64
+ define(IteratorPrototype, iteratorSymbol, function () {
65
+ return this;
66
+ });
67
+ var getProto = Object.getPrototypeOf,
68
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
69
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
70
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
71
+ function defineIteratorMethods(prototype) {
72
+ ["next", "throw", "return"].forEach(function (method) {
73
+ define(prototype, method, function (arg) {
74
+ return this._invoke(method, arg);
75
+ });
76
+ });
77
+ }
78
+ function AsyncIterator(generator, PromiseImpl) {
79
+ function invoke(method, arg, resolve, reject) {
80
+ var record = tryCatch(generator[method], generator, arg);
81
+ if ("throw" !== record.type) {
82
+ var result = record.arg,
83
+ value = result.value;
84
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
85
+ invoke("next", value, resolve, reject);
86
+ }, function (err) {
87
+ invoke("throw", err, resolve, reject);
88
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
89
+ result.value = unwrapped, resolve(result);
90
+ }, function (error) {
91
+ return invoke("throw", error, resolve, reject);
92
+ });
93
+ }
94
+ reject(record.arg);
95
+ }
96
+ var previousPromise;
97
+ defineProperty(this, "_invoke", {
98
+ value: function (method, arg) {
99
+ function callInvokeWithMethodAndArg() {
100
+ return new PromiseImpl(function (resolve, reject) {
101
+ invoke(method, arg, resolve, reject);
102
+ });
103
+ }
104
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
105
+ }
106
+ });
107
+ }
108
+ function makeInvokeMethod(innerFn, self, context) {
109
+ var state = "suspendedStart";
110
+ return function (method, arg) {
111
+ if ("executing" === state) throw new Error("Generator is already running");
112
+ if ("completed" === state) {
113
+ if ("throw" === method) throw arg;
114
+ return doneResult();
115
+ }
116
+ for (context.method = method, context.arg = arg;;) {
117
+ var delegate = context.delegate;
118
+ if (delegate) {
119
+ var delegateResult = maybeInvokeDelegate(delegate, context);
120
+ if (delegateResult) {
121
+ if (delegateResult === ContinueSentinel) continue;
122
+ return delegateResult;
123
+ }
124
+ }
125
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
126
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
127
+ context.dispatchException(context.arg);
128
+ } else "return" === context.method && context.abrupt("return", context.arg);
129
+ state = "executing";
130
+ var record = tryCatch(innerFn, self, context);
131
+ if ("normal" === record.type) {
132
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
133
+ return {
134
+ value: record.arg,
135
+ done: context.done
136
+ };
137
+ }
138
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
139
+ }
140
+ };
141
+ }
142
+ function maybeInvokeDelegate(delegate, context) {
143
+ var methodName = context.method,
144
+ method = delegate.iterator[methodName];
145
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
146
+ var record = tryCatch(method, delegate.iterator, context.arg);
147
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
148
+ var info = record.arg;
149
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
150
+ }
151
+ function pushTryEntry(locs) {
152
+ var entry = {
153
+ tryLoc: locs[0]
154
+ };
155
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
156
+ }
157
+ function resetTryEntry(entry) {
158
+ var record = entry.completion || {};
159
+ record.type = "normal", delete record.arg, entry.completion = record;
160
+ }
161
+ function Context(tryLocsList) {
162
+ this.tryEntries = [{
163
+ tryLoc: "root"
164
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
165
+ }
166
+ function values(iterable) {
167
+ if (iterable) {
168
+ var iteratorMethod = iterable[iteratorSymbol];
169
+ if (iteratorMethod) return iteratorMethod.call(iterable);
170
+ if ("function" == typeof iterable.next) return iterable;
171
+ if (!isNaN(iterable.length)) {
172
+ var i = -1,
173
+ next = function next() {
174
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
175
+ return next.value = undefined, next.done = !0, next;
176
+ };
177
+ return next.next = next;
178
+ }
179
+ }
180
+ return {
181
+ next: doneResult
182
+ };
183
+ }
184
+ function doneResult() {
185
+ return {
186
+ value: undefined,
187
+ done: !0
188
+ };
189
+ }
190
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
191
+ value: GeneratorFunctionPrototype,
192
+ configurable: !0
193
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
194
+ value: GeneratorFunction,
195
+ configurable: !0
196
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
197
+ var ctor = "function" == typeof genFun && genFun.constructor;
198
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
199
+ }, exports.mark = function (genFun) {
200
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
201
+ }, exports.awrap = function (arg) {
202
+ return {
203
+ __await: arg
204
+ };
205
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
206
+ return this;
207
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
208
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
209
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
210
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
211
+ return result.done ? result.value : iter.next();
212
+ });
213
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
214
+ return this;
215
+ }), define(Gp, "toString", function () {
216
+ return "[object Generator]";
217
+ }), exports.keys = function (val) {
218
+ var object = Object(val),
219
+ keys = [];
220
+ for (var key in object) keys.push(key);
221
+ return keys.reverse(), function next() {
222
+ for (; keys.length;) {
223
+ var key = keys.pop();
224
+ if (key in object) return next.value = key, next.done = !1, next;
225
+ }
226
+ return next.done = !0, next;
227
+ };
228
+ }, exports.values = values, Context.prototype = {
229
+ constructor: Context,
230
+ reset: function (skipTempReset) {
231
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
232
+ },
233
+ stop: function () {
234
+ this.done = !0;
235
+ var rootRecord = this.tryEntries[0].completion;
236
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
237
+ return this.rval;
238
+ },
239
+ dispatchException: function (exception) {
240
+ if (this.done) throw exception;
241
+ var context = this;
242
+ function handle(loc, caught) {
243
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
244
+ }
245
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
246
+ var entry = this.tryEntries[i],
247
+ record = entry.completion;
248
+ if ("root" === entry.tryLoc) return handle("end");
249
+ if (entry.tryLoc <= this.prev) {
250
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
251
+ hasFinally = hasOwn.call(entry, "finallyLoc");
252
+ if (hasCatch && hasFinally) {
253
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
254
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
255
+ } else if (hasCatch) {
256
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
257
+ } else {
258
+ if (!hasFinally) throw new Error("try statement without catch or finally");
259
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
260
+ }
261
+ }
262
+ }
263
+ },
264
+ abrupt: function (type, arg) {
265
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
266
+ var entry = this.tryEntries[i];
267
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
268
+ var finallyEntry = entry;
269
+ break;
270
+ }
271
+ }
272
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
273
+ var record = finallyEntry ? finallyEntry.completion : {};
274
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
275
+ },
276
+ complete: function (record, afterLoc) {
277
+ if ("throw" === record.type) throw record.arg;
278
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
279
+ },
280
+ finish: function (finallyLoc) {
281
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
282
+ var entry = this.tryEntries[i];
283
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
284
+ }
285
+ },
286
+ catch: function (tryLoc) {
287
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
288
+ var entry = this.tryEntries[i];
289
+ if (entry.tryLoc === tryLoc) {
290
+ var record = entry.completion;
291
+ if ("throw" === record.type) {
292
+ var thrown = record.arg;
293
+ resetTryEntry(entry);
294
+ }
295
+ return thrown;
296
+ }
297
+ }
298
+ throw new Error("illegal catch attempt");
299
+ },
300
+ delegateYield: function (iterable, resultName, nextLoc) {
301
+ return this.delegate = {
302
+ iterator: values(iterable),
303
+ resultName: resultName,
304
+ nextLoc: nextLoc
305
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
306
+ }
307
+ }, exports;
308
+ }
8
309
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
9
310
  try {
10
311
  var info = gen[key](arg);
@@ -13,803 +314,59 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
13
314
  reject(error);
14
315
  return;
15
316
  }
16
-
17
317
  if (info.done) {
18
318
  resolve(value);
19
319
  } else {
20
320
  Promise.resolve(value).then(_next, _throw);
21
321
  }
22
322
  }
23
-
24
323
  function _asyncToGenerator(fn) {
25
324
  return function () {
26
325
  var self = this,
27
- args = arguments;
326
+ args = arguments;
28
327
  return new Promise(function (resolve, reject) {
29
328
  var gen = fn.apply(self, args);
30
-
31
329
  function _next(value) {
32
330
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
33
331
  }
34
-
35
332
  function _throw(err) {
36
333
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
37
334
  }
38
-
39
335
  _next(undefined);
40
336
  });
41
337
  };
42
338
  }
43
-
44
339
  function _extends() {
45
- _extends = Object.assign || function (target) {
340
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
46
341
  for (var i = 1; i < arguments.length; i++) {
47
342
  var source = arguments[i];
48
-
49
343
  for (var key in source) {
50
344
  if (Object.prototype.hasOwnProperty.call(source, key)) {
51
345
  target[key] = source[key];
52
346
  }
53
347
  }
54
348
  }
55
-
56
349
  return target;
57
350
  };
58
-
59
351
  return _extends.apply(this, arguments);
60
352
  }
61
-
62
353
  function _objectWithoutPropertiesLoose(source, excluded) {
63
354
  if (source == null) return {};
64
355
  var target = {};
65
356
  var sourceKeys = Object.keys(source);
66
357
  var key, i;
67
-
68
358
  for (i = 0; i < sourceKeys.length; i++) {
69
359
  key = sourceKeys[i];
70
360
  if (excluded.indexOf(key) >= 0) continue;
71
361
  target[key] = source[key];
72
362
  }
73
-
74
363
  return target;
75
364
  }
76
365
 
77
- function createCommonjsModule(fn, module) {
78
- return module = { exports: {} }, fn(module, module.exports), module.exports;
79
- }
80
-
81
- var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
82
- /**
83
- * Copyright (c) 2014-present, Facebook, Inc.
84
- *
85
- * This source code is licensed under the MIT license found in the
86
- * LICENSE file in the root directory of this source tree.
87
- */
88
- var runtime = function (exports) {
89
-
90
- var Op = Object.prototype;
91
- var hasOwn = Op.hasOwnProperty;
92
- var undefined$1; // More compressible than void 0.
93
-
94
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
95
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
96
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
97
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
98
-
99
- function define(obj, key, value) {
100
- Object.defineProperty(obj, key, {
101
- value: value,
102
- enumerable: true,
103
- configurable: true,
104
- writable: true
105
- });
106
- return obj[key];
107
- }
108
-
109
- try {
110
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
111
- define({}, "");
112
- } catch (err) {
113
- define = function define(obj, key, value) {
114
- return obj[key] = value;
115
- };
116
- }
117
-
118
- function wrap(innerFn, outerFn, self, tryLocsList) {
119
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
120
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
121
- var generator = Object.create(protoGenerator.prototype);
122
- var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
123
- // .throw, and .return methods.
124
-
125
- generator._invoke = makeInvokeMethod(innerFn, self, context);
126
- return generator;
127
- }
128
-
129
- exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
130
- // record like context.tryEntries[i].completion. This interface could
131
- // have been (and was previously) designed to take a closure to be
132
- // invoked without arguments, but in all the cases we care about we
133
- // already have an existing method we want to call, so there's no need
134
- // to create a new function object. We can even get away with assuming
135
- // the method takes exactly one argument, since that happens to be true
136
- // in every case, so we don't have to touch the arguments object. The
137
- // only additional allocation required is the completion record, which
138
- // has a stable shape and so hopefully should be cheap to allocate.
139
-
140
- function tryCatch(fn, obj, arg) {
141
- try {
142
- return {
143
- type: "normal",
144
- arg: fn.call(obj, arg)
145
- };
146
- } catch (err) {
147
- return {
148
- type: "throw",
149
- arg: err
150
- };
151
- }
152
- }
153
-
154
- var GenStateSuspendedStart = "suspendedStart";
155
- var GenStateSuspendedYield = "suspendedYield";
156
- var GenStateExecuting = "executing";
157
- var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
158
- // breaking out of the dispatch switch statement.
159
-
160
- var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
161
- // .constructor.prototype properties for functions that return Generator
162
- // objects. For full spec compliance, you may wish to configure your
163
- // minifier not to mangle the names of these two functions.
164
-
165
- function Generator() {}
166
-
167
- function GeneratorFunction() {}
168
-
169
- function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
170
- // don't natively support it.
171
-
172
-
173
- var IteratorPrototype = {};
174
- define(IteratorPrototype, iteratorSymbol, function () {
175
- return this;
176
- });
177
- var getProto = Object.getPrototypeOf;
178
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
179
-
180
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
181
- // This environment has a native %IteratorPrototype%; use it instead
182
- // of the polyfill.
183
- IteratorPrototype = NativeIteratorPrototype;
184
- }
185
-
186
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
187
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
188
- define(Gp, "constructor", GeneratorFunctionPrototype);
189
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
190
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
191
- // Iterator interface in terms of a single ._invoke method.
192
-
193
- function defineIteratorMethods(prototype) {
194
- ["next", "throw", "return"].forEach(function (method) {
195
- define(prototype, method, function (arg) {
196
- return this._invoke(method, arg);
197
- });
198
- });
199
- }
200
-
201
- exports.isGeneratorFunction = function (genFun) {
202
- var ctor = typeof genFun === "function" && genFun.constructor;
203
- return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
204
- // do is to check its .name property.
205
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
206
- };
207
-
208
- exports.mark = function (genFun) {
209
- if (Object.setPrototypeOf) {
210
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
211
- } else {
212
- genFun.__proto__ = GeneratorFunctionPrototype;
213
- define(genFun, toStringTagSymbol, "GeneratorFunction");
214
- }
215
-
216
- genFun.prototype = Object.create(Gp);
217
- return genFun;
218
- }; // Within the body of any async function, `await x` is transformed to
219
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
220
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
221
- // meant to be awaited.
222
-
223
-
224
- exports.awrap = function (arg) {
225
- return {
226
- __await: arg
227
- };
228
- };
229
-
230
- function AsyncIterator(generator, PromiseImpl) {
231
- function invoke(method, arg, resolve, reject) {
232
- var record = tryCatch(generator[method], generator, arg);
233
-
234
- if (record.type === "throw") {
235
- reject(record.arg);
236
- } else {
237
- var result = record.arg;
238
- var value = result.value;
239
-
240
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
241
- return PromiseImpl.resolve(value.__await).then(function (value) {
242
- invoke("next", value, resolve, reject);
243
- }, function (err) {
244
- invoke("throw", err, resolve, reject);
245
- });
246
- }
247
-
248
- return PromiseImpl.resolve(value).then(function (unwrapped) {
249
- // When a yielded Promise is resolved, its final value becomes
250
- // the .value of the Promise<{value,done}> result for the
251
- // current iteration.
252
- result.value = unwrapped;
253
- resolve(result);
254
- }, function (error) {
255
- // If a rejected Promise was yielded, throw the rejection back
256
- // into the async generator function so it can be handled there.
257
- return invoke("throw", error, resolve, reject);
258
- });
259
- }
260
- }
261
-
262
- var previousPromise;
263
-
264
- function enqueue(method, arg) {
265
- function callInvokeWithMethodAndArg() {
266
- return new PromiseImpl(function (resolve, reject) {
267
- invoke(method, arg, resolve, reject);
268
- });
269
- }
270
-
271
- return previousPromise = // If enqueue has been called before, then we want to wait until
272
- // all previous Promises have been resolved before calling invoke,
273
- // so that results are always delivered in the correct order. If
274
- // enqueue has not been called before, then it is important to
275
- // call invoke immediately, without waiting on a callback to fire,
276
- // so that the async generator function has the opportunity to do
277
- // any necessary setup in a predictable way. This predictability
278
- // is why the Promise constructor synchronously invokes its
279
- // executor callback, and why async functions synchronously
280
- // execute code before the first await. Since we implement simple
281
- // async functions in terms of async generators, it is especially
282
- // important to get this right, even though it requires care.
283
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
284
- // invocations of the iterator.
285
- callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
286
- } // Define the unified helper method that is used to implement .next,
287
- // .throw, and .return (see defineIteratorMethods).
288
-
289
-
290
- this._invoke = enqueue;
291
- }
292
-
293
- defineIteratorMethods(AsyncIterator.prototype);
294
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
295
- return this;
296
- });
297
- exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
298
- // AsyncIterator objects; they just return a Promise for the value of
299
- // the final result produced by the iterator.
300
-
301
- exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
302
- if (PromiseImpl === void 0) PromiseImpl = Promise;
303
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
304
- return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
305
- : iter.next().then(function (result) {
306
- return result.done ? result.value : iter.next();
307
- });
308
- };
309
-
310
- function makeInvokeMethod(innerFn, self, context) {
311
- var state = GenStateSuspendedStart;
312
- return function invoke(method, arg) {
313
- if (state === GenStateExecuting) {
314
- throw new Error("Generator is already running");
315
- }
316
-
317
- if (state === GenStateCompleted) {
318
- if (method === "throw") {
319
- throw arg;
320
- } // Be forgiving, per 25.3.3.3.3 of the spec:
321
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
322
-
323
-
324
- return doneResult();
325
- }
326
-
327
- context.method = method;
328
- context.arg = arg;
329
-
330
- while (true) {
331
- var delegate = context.delegate;
332
-
333
- if (delegate) {
334
- var delegateResult = maybeInvokeDelegate(delegate, context);
335
-
336
- if (delegateResult) {
337
- if (delegateResult === ContinueSentinel) continue;
338
- return delegateResult;
339
- }
340
- }
341
-
342
- if (context.method === "next") {
343
- // Setting context._sent for legacy support of Babel's
344
- // function.sent implementation.
345
- context.sent = context._sent = context.arg;
346
- } else if (context.method === "throw") {
347
- if (state === GenStateSuspendedStart) {
348
- state = GenStateCompleted;
349
- throw context.arg;
350
- }
351
-
352
- context.dispatchException(context.arg);
353
- } else if (context.method === "return") {
354
- context.abrupt("return", context.arg);
355
- }
356
-
357
- state = GenStateExecuting;
358
- var record = tryCatch(innerFn, self, context);
359
-
360
- if (record.type === "normal") {
361
- // If an exception is thrown from innerFn, we leave state ===
362
- // GenStateExecuting and loop back for another invocation.
363
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
364
-
365
- if (record.arg === ContinueSentinel) {
366
- continue;
367
- }
368
-
369
- return {
370
- value: record.arg,
371
- done: context.done
372
- };
373
- } else if (record.type === "throw") {
374
- state = GenStateCompleted; // Dispatch the exception by looping back around to the
375
- // context.dispatchException(context.arg) call above.
376
-
377
- context.method = "throw";
378
- context.arg = record.arg;
379
- }
380
- }
381
- };
382
- } // Call delegate.iterator[context.method](context.arg) and handle the
383
- // result, either by returning a { value, done } result from the
384
- // delegate iterator, or by modifying context.method and context.arg,
385
- // setting context.delegate to null, and returning the ContinueSentinel.
386
-
387
-
388
- function maybeInvokeDelegate(delegate, context) {
389
- var method = delegate.iterator[context.method];
390
-
391
- if (method === undefined$1) {
392
- // A .throw or .return when the delegate iterator has no .throw
393
- // method always terminates the yield* loop.
394
- context.delegate = null;
395
-
396
- if (context.method === "throw") {
397
- // Note: ["return"] must be used for ES3 parsing compatibility.
398
- if (delegate.iterator["return"]) {
399
- // If the delegate iterator has a return method, give it a
400
- // chance to clean up.
401
- context.method = "return";
402
- context.arg = undefined$1;
403
- maybeInvokeDelegate(delegate, context);
404
-
405
- if (context.method === "throw") {
406
- // If maybeInvokeDelegate(context) changed context.method from
407
- // "return" to "throw", let that override the TypeError below.
408
- return ContinueSentinel;
409
- }
410
- }
411
-
412
- context.method = "throw";
413
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
414
- }
415
-
416
- return ContinueSentinel;
417
- }
418
-
419
- var record = tryCatch(method, delegate.iterator, context.arg);
420
-
421
- if (record.type === "throw") {
422
- context.method = "throw";
423
- context.arg = record.arg;
424
- context.delegate = null;
425
- return ContinueSentinel;
426
- }
427
-
428
- var info = record.arg;
429
-
430
- if (!info) {
431
- context.method = "throw";
432
- context.arg = new TypeError("iterator result is not an object");
433
- context.delegate = null;
434
- return ContinueSentinel;
435
- }
436
-
437
- if (info.done) {
438
- // Assign the result of the finished delegate to the temporary
439
- // variable specified by delegate.resultName (see delegateYield).
440
- context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
441
-
442
- context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
443
- // exception, let the outer generator proceed normally. If
444
- // context.method was "next", forget context.arg since it has been
445
- // "consumed" by the delegate iterator. If context.method was
446
- // "return", allow the original .return call to continue in the
447
- // outer generator.
448
-
449
- if (context.method !== "return") {
450
- context.method = "next";
451
- context.arg = undefined$1;
452
- }
453
- } else {
454
- // Re-yield the result returned by the delegate method.
455
- return info;
456
- } // The delegate iterator is finished, so forget it and continue with
457
- // the outer generator.
458
-
459
-
460
- context.delegate = null;
461
- return ContinueSentinel;
462
- } // Define Generator.prototype.{next,throw,return} in terms of the
463
- // unified ._invoke helper method.
464
-
465
-
466
- defineIteratorMethods(Gp);
467
- define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
468
- // @@iterator function is called on it. Some browsers' implementations of the
469
- // iterator prototype chain incorrectly implement this, causing the Generator
470
- // object to not be returned from this call. This ensures that doesn't happen.
471
- // See https://github.com/facebook/regenerator/issues/274 for more details.
472
-
473
- define(Gp, iteratorSymbol, function () {
474
- return this;
475
- });
476
- define(Gp, "toString", function () {
477
- return "[object Generator]";
478
- });
479
-
480
- function pushTryEntry(locs) {
481
- var entry = {
482
- tryLoc: locs[0]
483
- };
484
-
485
- if (1 in locs) {
486
- entry.catchLoc = locs[1];
487
- }
488
-
489
- if (2 in locs) {
490
- entry.finallyLoc = locs[2];
491
- entry.afterLoc = locs[3];
492
- }
493
-
494
- this.tryEntries.push(entry);
495
- }
496
-
497
- function resetTryEntry(entry) {
498
- var record = entry.completion || {};
499
- record.type = "normal";
500
- delete record.arg;
501
- entry.completion = record;
502
- }
503
-
504
- function Context(tryLocsList) {
505
- // The root entry object (effectively a try statement without a catch
506
- // or a finally block) gives us a place to store values thrown from
507
- // locations where there is no enclosing try statement.
508
- this.tryEntries = [{
509
- tryLoc: "root"
510
- }];
511
- tryLocsList.forEach(pushTryEntry, this);
512
- this.reset(true);
513
- }
514
-
515
- exports.keys = function (object) {
516
- var keys = [];
517
-
518
- for (var key in object) {
519
- keys.push(key);
520
- }
521
-
522
- keys.reverse(); // Rather than returning an object with a next method, we keep
523
- // things simple and return the next function itself.
524
-
525
- return function next() {
526
- while (keys.length) {
527
- var key = keys.pop();
528
-
529
- if (key in object) {
530
- next.value = key;
531
- next.done = false;
532
- return next;
533
- }
534
- } // To avoid creating an additional object, we just hang the .value
535
- // and .done properties off the next function object itself. This
536
- // also ensures that the minifier will not anonymize the function.
537
-
538
-
539
- next.done = true;
540
- return next;
541
- };
542
- };
543
-
544
- function values(iterable) {
545
- if (iterable) {
546
- var iteratorMethod = iterable[iteratorSymbol];
547
-
548
- if (iteratorMethod) {
549
- return iteratorMethod.call(iterable);
550
- }
551
-
552
- if (typeof iterable.next === "function") {
553
- return iterable;
554
- }
555
-
556
- if (!isNaN(iterable.length)) {
557
- var i = -1,
558
- next = function next() {
559
- while (++i < iterable.length) {
560
- if (hasOwn.call(iterable, i)) {
561
- next.value = iterable[i];
562
- next.done = false;
563
- return next;
564
- }
565
- }
566
-
567
- next.value = undefined$1;
568
- next.done = true;
569
- return next;
570
- };
571
-
572
- return next.next = next;
573
- }
574
- } // Return an iterator with no values.
575
-
576
-
577
- return {
578
- next: doneResult
579
- };
580
- }
581
-
582
- exports.values = values;
583
-
584
- function doneResult() {
585
- return {
586
- value: undefined$1,
587
- done: true
588
- };
589
- }
590
-
591
- Context.prototype = {
592
- constructor: Context,
593
- reset: function reset(skipTempReset) {
594
- this.prev = 0;
595
- this.next = 0; // Resetting context._sent for legacy support of Babel's
596
- // function.sent implementation.
597
-
598
- this.sent = this._sent = undefined$1;
599
- this.done = false;
600
- this.delegate = null;
601
- this.method = "next";
602
- this.arg = undefined$1;
603
- this.tryEntries.forEach(resetTryEntry);
604
-
605
- if (!skipTempReset) {
606
- for (var name in this) {
607
- // Not sure about the optimal order of these conditions:
608
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
609
- this[name] = undefined$1;
610
- }
611
- }
612
- }
613
- },
614
- stop: function stop() {
615
- this.done = true;
616
- var rootEntry = this.tryEntries[0];
617
- var rootRecord = rootEntry.completion;
618
-
619
- if (rootRecord.type === "throw") {
620
- throw rootRecord.arg;
621
- }
622
-
623
- return this.rval;
624
- },
625
- dispatchException: function dispatchException(exception) {
626
- if (this.done) {
627
- throw exception;
628
- }
629
-
630
- var context = this;
631
-
632
- function handle(loc, caught) {
633
- record.type = "throw";
634
- record.arg = exception;
635
- context.next = loc;
636
-
637
- if (caught) {
638
- // If the dispatched exception was caught by a catch block,
639
- // then let that catch block handle the exception normally.
640
- context.method = "next";
641
- context.arg = undefined$1;
642
- }
643
-
644
- return !!caught;
645
- }
646
-
647
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
648
- var entry = this.tryEntries[i];
649
- var record = entry.completion;
650
-
651
- if (entry.tryLoc === "root") {
652
- // Exception thrown outside of any try block that could handle
653
- // it, so set the completion value of the entire function to
654
- // throw the exception.
655
- return handle("end");
656
- }
657
-
658
- if (entry.tryLoc <= this.prev) {
659
- var hasCatch = hasOwn.call(entry, "catchLoc");
660
- var hasFinally = hasOwn.call(entry, "finallyLoc");
661
-
662
- if (hasCatch && hasFinally) {
663
- if (this.prev < entry.catchLoc) {
664
- return handle(entry.catchLoc, true);
665
- } else if (this.prev < entry.finallyLoc) {
666
- return handle(entry.finallyLoc);
667
- }
668
- } else if (hasCatch) {
669
- if (this.prev < entry.catchLoc) {
670
- return handle(entry.catchLoc, true);
671
- }
672
- } else if (hasFinally) {
673
- if (this.prev < entry.finallyLoc) {
674
- return handle(entry.finallyLoc);
675
- }
676
- } else {
677
- throw new Error("try statement without catch or finally");
678
- }
679
- }
680
- }
681
- },
682
- abrupt: function abrupt(type, arg) {
683
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
684
- var entry = this.tryEntries[i];
685
-
686
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
687
- var finallyEntry = entry;
688
- break;
689
- }
690
- }
691
-
692
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
693
- // Ignore the finally entry if control is not jumping to a
694
- // location outside the try/catch block.
695
- finallyEntry = null;
696
- }
697
-
698
- var record = finallyEntry ? finallyEntry.completion : {};
699
- record.type = type;
700
- record.arg = arg;
701
-
702
- if (finallyEntry) {
703
- this.method = "next";
704
- this.next = finallyEntry.finallyLoc;
705
- return ContinueSentinel;
706
- }
707
-
708
- return this.complete(record);
709
- },
710
- complete: function complete(record, afterLoc) {
711
- if (record.type === "throw") {
712
- throw record.arg;
713
- }
714
-
715
- if (record.type === "break" || record.type === "continue") {
716
- this.next = record.arg;
717
- } else if (record.type === "return") {
718
- this.rval = this.arg = record.arg;
719
- this.method = "return";
720
- this.next = "end";
721
- } else if (record.type === "normal" && afterLoc) {
722
- this.next = afterLoc;
723
- }
724
-
725
- return ContinueSentinel;
726
- },
727
- finish: function finish(finallyLoc) {
728
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
729
- var entry = this.tryEntries[i];
730
-
731
- if (entry.finallyLoc === finallyLoc) {
732
- this.complete(entry.completion, entry.afterLoc);
733
- resetTryEntry(entry);
734
- return ContinueSentinel;
735
- }
736
- }
737
- },
738
- "catch": function _catch(tryLoc) {
739
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
740
- var entry = this.tryEntries[i];
741
-
742
- if (entry.tryLoc === tryLoc) {
743
- var record = entry.completion;
744
-
745
- if (record.type === "throw") {
746
- var thrown = record.arg;
747
- resetTryEntry(entry);
748
- }
749
-
750
- return thrown;
751
- }
752
- } // The context.catch method must only be called with a location
753
- // argument that corresponds to a known catch block.
754
-
755
-
756
- throw new Error("illegal catch attempt");
757
- },
758
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
759
- this.delegate = {
760
- iterator: values(iterable),
761
- resultName: resultName,
762
- nextLoc: nextLoc
763
- };
764
-
765
- if (this.method === "next") {
766
- // Deliberately forget the last sent value so that we don't
767
- // accidentally pass it on to the delegate.
768
- this.arg = undefined$1;
769
- }
770
-
771
- return ContinueSentinel;
772
- }
773
- }; // Regardless of whether this script is executing as a CommonJS module
774
- // or not, return the runtime object so that we can declare the variable
775
- // regeneratorRuntime in the outer scope, which allows this module to be
776
- // injected easily by `bin/regenerator --include-runtime script.js`.
777
-
778
- return exports;
779
- }( // If this script is executing as a CommonJS module, use module.exports
780
- // as the regeneratorRuntime namespace. Otherwise create a new empty
781
- // object. Either way, the resulting object will be used to initialize
782
- // the regeneratorRuntime variable at the top of this file.
783
- module.exports );
784
-
785
- try {
786
- regeneratorRuntime = runtime;
787
- } catch (accidentalStrictMode) {
788
- // This module should not be running in strict mode, so the above
789
- // assignment should always work unless something is misconfigured. Just
790
- // in case runtime.js accidentally runs in strict mode, in modern engines
791
- // we can explicitly access globalThis. In older engines we can escape
792
- // strict mode using a global Function call. This could conceivably fail
793
- // if a Content Security Policy forbids using Function, but in that case
794
- // the proper solution is to fix the accidental strict mode problem. If
795
- // you've misconfigured your bundler to force strict mode and applied a
796
- // CSP to forbid Function, and you're not willing to fix either of those
797
- // problems, please detail your unique predicament in a GitHub issue.
798
- if (typeof globalThis === "object") {
799
- globalThis.regeneratorRuntime = runtime;
800
- } else {
801
- Function("r", "regeneratorRuntime = r")(runtime);
802
- }
803
- }
804
- });
805
-
806
366
  var _excluded = ["captureBeyondViewport"],
807
- _excluded2 = ["userAgent", "isDarkMode", "viewport", "cookies"];
808
-
367
+ _excluded2 = ["userAgent", "isDarkMode", "viewport", "cookies"];
809
368
  var _pkg$acceptanceTests, _ref;
810
-
811
369
  var execSync = /*#__PURE__*/require('child_process').execSync;
812
-
813
370
  var getGlobalBrowser = function getGlobalBrowser() {
814
371
  return global.browser;
815
372
  };
@@ -822,11 +379,9 @@ var serverHostName = /*#__PURE__*/function () {
822
379
  if (isCi) {
823
380
  return 'localhost';
824
381
  }
825
-
826
382
  if (isUsingDockerizedChromium) {
827
383
  return process.platform === 'linux' ? '172.17.0.1' : 'host.docker.internal';
828
384
  }
829
-
830
385
  return 'localhost';
831
386
  }();
832
387
  var rootDir = /*#__PURE__*/findRoot( /*#__PURE__*/process.cwd());
@@ -843,11 +398,10 @@ var toMatchImageSnapshot = /*#__PURE__*/configureToMatchImageSnapshot({
843
398
  }
844
399
  });
845
400
  var calledToMatchImageSnapshotOutsideDocker = false;
846
-
847
401
  var localToMatchImageSnapshot = function localToMatchImageSnapshot() {
848
- calledToMatchImageSnapshotOutsideDocker = true; // let the expectation pass, then fail in afterEach. This way we allow developers to debug screenshot tests in local
402
+ calledToMatchImageSnapshotOutsideDocker = true;
403
+ // let the expectation pass, then fail in afterEach. This way we allow developers to debug screenshot tests in local
849
404
  // but don't allow them to save screenshots taken outside the dockerized chromium
850
-
851
405
  return {
852
406
  message: function message() {
853
407
  return '';
@@ -855,7 +409,6 @@ var localToMatchImageSnapshot = function localToMatchImageSnapshot() {
855
409
  pass: true
856
410
  };
857
411
  };
858
-
859
412
  expect.extend({
860
413
  toMatchImageSnapshot: isUsingDockerizedChromium ? toMatchImageSnapshot : localToMatchImageSnapshot
861
414
  });
@@ -866,105 +419,87 @@ afterEach(function () {
866
419
  throw error;
867
420
  }
868
421
  });
869
-
870
422
  var waitForPaintEnd = /*#__PURE__*/function () {
871
- var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(element, _temp) {
423
+ var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(element, _temp) {
872
424
  var _ref4, _ref4$fullPage, fullPage, captureBeyondViewport, MAX_WAIT, STEP_TIME, t0, buf1, buf2;
873
-
874
- return runtime_1.wrap(function _callee$(_context) {
875
- while (1) {
876
- switch (_context.prev = _context.next) {
877
- case 0:
878
- _ref4 = _temp === void 0 ? {} : _temp, _ref4$fullPage = _ref4.fullPage, fullPage = _ref4$fullPage === void 0 ? true : _ref4$fullPage, captureBeyondViewport = _ref4.captureBeyondViewport;
879
- MAX_WAIT = 15000;
880
- STEP_TIME = 250;
881
- t0 = Date.now();
882
- _context.next = 6;
883
- return element.screenshot(normalizeSreenshotOptions({
884
- fullPage: fullPage,
885
- captureBeyondViewport: captureBeyondViewport
886
- }));
887
-
888
- case 6:
889
- buf1 = _context.sent;
890
- _context.next = 9;
891
- return new Promise(function (r) {
892
- return setTimeout(r, STEP_TIME);
893
- });
894
-
895
- case 9:
896
- _context.next = 11;
897
- return element.screenshot(normalizeSreenshotOptions({
898
- fullPage: fullPage,
899
- captureBeyondViewport: captureBeyondViewport
900
- }));
901
-
902
- case 11:
903
- buf2 = _context.sent;
904
-
905
- case 12:
906
- if (!buf1.compare(buf2)) {
907
- _context.next = 23;
908
- break;
909
- }
910
-
911
- if (!(Date.now() - t0 > MAX_WAIT)) {
912
- _context.next = 15;
913
- break;
914
- }
915
-
916
- throw Error('Paint end timeout');
917
-
918
- case 15:
919
- buf1 = buf2;
920
- _context.next = 18;
921
- return new Promise(function (r) {
922
- return setTimeout(r, STEP_TIME);
923
- });
924
-
925
- case 18:
926
- _context.next = 20;
927
- return element.screenshot(normalizeSreenshotOptions({
928
- fullPage: fullPage,
929
- captureBeyondViewport: captureBeyondViewport
930
- }));
931
-
932
- case 20:
933
- buf2 = _context.sent;
934
- _context.next = 12;
425
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
426
+ while (1) switch (_context.prev = _context.next) {
427
+ case 0:
428
+ _ref4 = _temp === void 0 ? {} : _temp, _ref4$fullPage = _ref4.fullPage, fullPage = _ref4$fullPage === void 0 ? true : _ref4$fullPage, captureBeyondViewport = _ref4.captureBeyondViewport;
429
+ MAX_WAIT = 15000;
430
+ STEP_TIME = 250;
431
+ t0 = Date.now();
432
+ _context.next = 6;
433
+ return element.screenshot(normalizeSreenshotOptions({
434
+ fullPage: fullPage,
435
+ captureBeyondViewport: captureBeyondViewport
436
+ }));
437
+ case 6:
438
+ buf1 = _context.sent;
439
+ _context.next = 9;
440
+ return new Promise(function (r) {
441
+ return setTimeout(r, STEP_TIME);
442
+ });
443
+ case 9:
444
+ _context.next = 11;
445
+ return element.screenshot(normalizeSreenshotOptions({
446
+ fullPage: fullPage,
447
+ captureBeyondViewport: captureBeyondViewport
448
+ }));
449
+ case 11:
450
+ buf2 = _context.sent;
451
+ case 12:
452
+ if (!buf1.compare(buf2)) {
453
+ _context.next = 23;
935
454
  break;
936
-
937
- case 23:
938
- case "end":
939
- return _context.stop();
940
- }
455
+ }
456
+ if (!(Date.now() - t0 > MAX_WAIT)) {
457
+ _context.next = 15;
458
+ break;
459
+ }
460
+ throw Error('Paint end timeout');
461
+ case 15:
462
+ buf1 = buf2;
463
+ _context.next = 18;
464
+ return new Promise(function (r) {
465
+ return setTimeout(r, STEP_TIME);
466
+ });
467
+ case 18:
468
+ _context.next = 20;
469
+ return element.screenshot(normalizeSreenshotOptions({
470
+ fullPage: fullPage,
471
+ captureBeyondViewport: captureBeyondViewport
472
+ }));
473
+ case 20:
474
+ buf2 = _context.sent;
475
+ _context.next = 12;
476
+ break;
477
+ case 23:
478
+ case "end":
479
+ return _context.stop();
941
480
  }
942
481
  }, _callee);
943
482
  }));
944
-
945
483
  return function waitForPaintEnd(_x, _x2) {
946
484
  return _ref3.apply(this, arguments);
947
485
  };
948
486
  }();
949
-
950
487
  var normalizeSreenshotOptions = function normalizeSreenshotOptions(_temp2) {
951
488
  var _ref5 = _temp2 === void 0 ? {} : _temp2,
952
- _ref5$captureBeyondVi = _ref5.captureBeyondViewport,
953
- captureBeyondViewport = _ref5$captureBeyondVi === void 0 ? false : _ref5$captureBeyondVi,
954
- options = _objectWithoutPropertiesLoose(_ref5, _excluded);
955
-
489
+ _ref5$captureBeyondVi = _ref5.captureBeyondViewport,
490
+ captureBeyondViewport = _ref5$captureBeyondVi === void 0 ? false : _ref5$captureBeyondVi,
491
+ options = _objectWithoutPropertiesLoose(_ref5, _excluded);
956
492
  // Puppeter default for captureBeyondViewport is true, but we think false is a better default.
957
493
  // When this is true, the fixed elements (like fixed footers) are relative to the original page
958
494
  // viewport, not to the full page, so those elements look weird in fullPage screenshots.
959
495
  return _extends({}, options, {
960
496
  captureBeyondViewport: captureBeyondViewport
961
497
  });
962
- }; // Puppeteer already calls scrollIntoViewIfNeeded before clicking an element. But it doesn't work in all situations
498
+ };
499
+ // Puppeteer already calls scrollIntoViewIfNeeded before clicking an element. But it doesn't work in all situations
963
500
  // For example, when there is a fixed footer in the page and the element to click is under it, the browser won't scroll
964
501
  // because the element is already in the viewport (the ifNeeded part is important here). By forcing the scroll to the
965
502
  // center, we manage to fix these edge cases.
966
-
967
-
968
503
  var scrollIntoView = function scrollIntoView(el) {
969
504
  return el.evaluate(function (e) {
970
505
  return e.scrollIntoView({
@@ -972,158 +507,122 @@ var scrollIntoView = function scrollIntoView(el) {
972
507
  });
973
508
  });
974
509
  };
975
-
976
510
  var getPageApi = function getPageApi(page) {
977
511
  var api = Object.create(page);
978
-
979
512
  api.type = /*#__PURE__*/function () {
980
- var _ref6 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(elementHandle, text, options) {
981
- return runtime_1.wrap(function _callee2$(_context2) {
982
- while (1) {
983
- switch (_context2.prev = _context2.next) {
984
- case 0:
985
- _context2.next = 2;
986
- return scrollIntoView(elementHandle);
987
-
988
- case 2:
989
- return _context2.abrupt("return", elementHandle.type(text, options));
990
-
991
- case 3:
992
- case "end":
993
- return _context2.stop();
994
- }
513
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(elementHandle, text, options) {
514
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
515
+ while (1) switch (_context2.prev = _context2.next) {
516
+ case 0:
517
+ _context2.next = 2;
518
+ return scrollIntoView(elementHandle);
519
+ case 2:
520
+ return _context2.abrupt("return", elementHandle.type(text, options));
521
+ case 3:
522
+ case "end":
523
+ return _context2.stop();
995
524
  }
996
525
  }, _callee2);
997
526
  }));
998
-
999
527
  return function (_x3, _x4, _x5) {
1000
528
  return _ref6.apply(this, arguments);
1001
529
  };
1002
530
  }();
1003
-
1004
531
  api.click = /*#__PURE__*/function () {
1005
- var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(elementHandle, options) {
1006
- return runtime_1.wrap(function _callee3$(_context3) {
1007
- while (1) {
1008
- switch (_context3.prev = _context3.next) {
1009
- case 0:
1010
- _context3.next = 2;
1011
- return scrollIntoView(elementHandle);
1012
-
1013
- case 2:
1014
- return _context3.abrupt("return", elementHandle.click(options));
1015
-
1016
- case 3:
1017
- case "end":
1018
- return _context3.stop();
1019
- }
532
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(elementHandle, options) {
533
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
534
+ while (1) switch (_context3.prev = _context3.next) {
535
+ case 0:
536
+ _context3.next = 2;
537
+ return scrollIntoView(elementHandle);
538
+ case 2:
539
+ return _context3.abrupt("return", elementHandle.click(options));
540
+ case 3:
541
+ case "end":
542
+ return _context3.stop();
1020
543
  }
1021
544
  }, _callee3);
1022
545
  }));
1023
-
1024
546
  return function (_x6, _x7) {
1025
547
  return _ref7.apply(this, arguments);
1026
548
  };
1027
549
  }();
1028
-
1029
550
  api.select = /*#__PURE__*/function () {
1030
- var _ref8 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(elementHandle) {
551
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(elementHandle) {
1031
552
  var _len,
1032
- values,
1033
- _key,
1034
- _args4 = arguments;
1035
-
1036
- return runtime_1.wrap(function _callee4$(_context4) {
1037
- while (1) {
1038
- switch (_context4.prev = _context4.next) {
1039
- case 0:
1040
- _context4.next = 2;
1041
- return scrollIntoView(elementHandle);
1042
-
1043
- case 2:
1044
- for (_len = _args4.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1045
- values[_key - 1] = _args4[_key];
1046
- }
1047
-
1048
- return _context4.abrupt("return", elementHandle.select.apply(elementHandle, values));
1049
-
1050
- case 4:
1051
- case "end":
1052
- return _context4.stop();
1053
- }
553
+ values,
554
+ _key,
555
+ _args4 = arguments;
556
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
557
+ while (1) switch (_context4.prev = _context4.next) {
558
+ case 0:
559
+ _context4.next = 2;
560
+ return scrollIntoView(elementHandle);
561
+ case 2:
562
+ for (_len = _args4.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
563
+ values[_key - 1] = _args4[_key];
564
+ }
565
+ return _context4.abrupt("return", elementHandle.select.apply(elementHandle, values));
566
+ case 4:
567
+ case "end":
568
+ return _context4.stop();
1054
569
  }
1055
570
  }, _callee4);
1056
571
  }));
1057
-
1058
572
  return function (_x8) {
1059
573
  return _ref8.apply(this, arguments);
1060
574
  };
1061
575
  }();
1062
-
1063
576
  api.screenshot = /*#__PURE__*/function () {
1064
- var _ref9 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(options) {
1065
- return runtime_1.wrap(function _callee5$(_context5) {
1066
- while (1) {
1067
- switch (_context5.prev = _context5.next) {
1068
- case 0:
1069
- if (options != null && options.skipNetworkWait) {
1070
- _context5.next = 3;
1071
- break;
1072
- }
1073
-
577
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(options) {
578
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
579
+ while (1) switch (_context5.prev = _context5.next) {
580
+ case 0:
581
+ if (options != null && options.skipNetworkWait) {
1074
582
  _context5.next = 3;
1075
- return page.waitForNetworkIdle();
1076
-
1077
- case 3:
1078
- _context5.next = 5;
1079
- return waitForPaintEnd(page, options);
1080
-
1081
- case 5:
1082
- return _context5.abrupt("return", page.screenshot(normalizeSreenshotOptions(options)));
1083
-
1084
- case 6:
1085
- case "end":
1086
- return _context5.stop();
1087
- }
583
+ break;
584
+ }
585
+ _context5.next = 3;
586
+ return page.waitForNetworkIdle();
587
+ case 3:
588
+ _context5.next = 5;
589
+ return waitForPaintEnd(page, options);
590
+ case 5:
591
+ return _context5.abrupt("return", page.screenshot(normalizeSreenshotOptions(options)));
592
+ case 6:
593
+ case "end":
594
+ return _context5.stop();
1088
595
  }
1089
596
  }, _callee5);
1090
597
  }));
1091
-
1092
598
  return function (_x9) {
1093
599
  return _ref9.apply(this, arguments);
1094
600
  };
1095
601
  }();
1096
-
1097
602
  api.clear = /*#__PURE__*/function () {
1098
- var _ref10 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(elementHandle) {
1099
- return runtime_1.wrap(function _callee6$(_context6) {
1100
- while (1) {
1101
- switch (_context6.prev = _context6.next) {
1102
- case 0:
1103
- _context6.next = 2;
1104
- return elementHandle.click({
1105
- clickCount: 3
1106
- });
1107
-
1108
- case 2:
1109
- _context6.next = 4;
1110
- return elementHandle.press('Delete');
1111
-
1112
- case 4:
1113
- case "end":
1114
- return _context6.stop();
1115
- }
603
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(elementHandle) {
604
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
605
+ while (1) switch (_context6.prev = _context6.next) {
606
+ case 0:
607
+ _context6.next = 2;
608
+ return elementHandle.click({
609
+ clickCount: 3
610
+ });
611
+ case 2:
612
+ _context6.next = 4;
613
+ return elementHandle.press('Delete');
614
+ case 4:
615
+ case "end":
616
+ return _context6.stop();
1116
617
  }
1117
618
  }, _callee6);
1118
619
  }));
1119
-
1120
620
  return function (_x10) {
1121
621
  return _ref10.apply(this, arguments);
1122
622
  };
1123
- }(); // For some reason, puppeteer browserContext.overridePermissions doesn't work with newer chrome versions.
623
+ }();
624
+ // For some reason, puppeteer browserContext.overridePermissions doesn't work with newer chrome versions.
1124
625
  // This workaround polyfills the browser geolocation api to return the mocked position
1125
-
1126
-
1127
626
  api.setGeolocation = function (position) {
1128
627
  return page.evaluate(function (position) {
1129
628
  window.navigator.geolocation.getCurrentPosition = function (callback) {
@@ -1134,32 +633,26 @@ var getPageApi = function getPageApi(page) {
1134
633
  };
1135
634
  }, position);
1136
635
  };
1137
-
1138
636
  return api;
1139
637
  };
1140
638
  var needsRequestInterception = false;
1141
639
  var requestHandlers = [];
1142
-
1143
640
  var requestInterceptor = function requestInterceptor(req) {
1144
641
  var _requestHandlers$find;
1145
-
1146
642
  var _ref11 = (_requestHandlers$find = requestHandlers.find(function (_ref12) {
1147
- var matcher = _ref12.matcher;
1148
- return matcher(req);
1149
- })) != null ? _requestHandlers$find : {
1150
- handler: null
1151
- },
1152
- handler = _ref11.handler;
1153
-
643
+ var matcher = _ref12.matcher;
644
+ return matcher(req);
645
+ })) != null ? _requestHandlers$find : {
646
+ handler: null
647
+ },
648
+ handler = _ref11.handler;
1154
649
  if (!handler) {
1155
650
  req["continue"]();
1156
651
  return;
1157
652
  }
1158
-
1159
653
  var response = handler(req);
1160
654
  req.respond(response);
1161
655
  };
1162
-
1163
656
  var interceptRequest = function interceptRequest(matcher) {
1164
657
  needsRequestInterception = true;
1165
658
  var spy = jest.fn();
@@ -1188,17 +681,14 @@ var createApiEndpointMock = function createApiEndpointMock(_ref13) {
1188
681
  if (method === void 0) {
1189
682
  method = 'GET';
1190
683
  }
1191
-
1192
684
  var matcher = function matcher(req) {
1193
685
  var url = req.url();
1194
686
  var urlPath = url.substring(baseUrl.length);
1195
687
  return req.method() === method && url.startsWith(baseUrl) && !!urlPath.match(globToRegExp(path));
1196
688
  };
1197
-
1198
689
  var spy = jest.fn();
1199
690
  interceptRequest(matcher).mockImplementation(function (req) {
1200
691
  var _spyResult$status;
1201
-
1202
692
  var spyResult = spy(req);
1203
693
  var status = (_spyResult$status = spyResult.status) != null ? _spyResult$status : 200;
1204
694
  var resBody = spyResult.body || spyResult;
@@ -1216,335 +706,261 @@ var createApiEndpointMock = function createApiEndpointMock(_ref13) {
1216
706
  };
1217
707
  };
1218
708
  var openPage = /*#__PURE__*/function () {
1219
- var _ref15 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(_ref14) {
709
+ var _ref15 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_ref14) {
1220
710
  var userAgent, isDarkMode, viewport, cookies, urlConfig, url, currentUserAgent, page, connectionError;
1221
- return runtime_1.wrap(function _callee7$(_context7) {
1222
- while (1) {
1223
- switch (_context7.prev = _context7.next) {
1224
- case 0:
1225
- userAgent = _ref14.userAgent, isDarkMode = _ref14.isDarkMode, viewport = _ref14.viewport, cookies = _ref14.cookies, urlConfig = /*#__PURE__*/_objectWithoutPropertiesLoose(_ref14, _excluded2);
1226
-
1227
- url = function () {
1228
- if (urlConfig.url !== undefined) {
1229
- return urlConfig.url;
1230
- }
1231
-
1232
- var _urlConfig$path = urlConfig.path,
1233
- path = _urlConfig$path === void 0 ? '/' : _urlConfig$path,
1234
- _urlConfig$port = urlConfig.port,
1235
- port = _urlConfig$port === void 0 ? serverPort : _urlConfig$port,
1236
- _urlConfig$protocol = urlConfig.protocol,
1237
- protocol = _urlConfig$protocol === void 0 ? 'http' : _urlConfig$protocol,
1238
- _urlConfig$hostname = urlConfig.hostname,
1239
- hostname = _urlConfig$hostname === void 0 ? serverHostName : _urlConfig$hostname;
1240
-
1241
- if (!port) {
1242
- var error = new Error('You must specify a port. You can specify it when calling openPage() or by configuring a dev and ci server in the acceptanceTests config in your package.json'); // Error.captureStackTrace(error, openPage);
1243
-
1244
- throw error;
1245
- }
1246
-
1247
- return protocol + "://" + hostname + ":" + port + path;
1248
- }();
1249
-
1250
- _context7.t0 = userAgent;
1251
-
1252
- if (_context7.t0) {
1253
- _context7.next = 7;
1254
- break;
711
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
712
+ while (1) switch (_context7.prev = _context7.next) {
713
+ case 0:
714
+ userAgent = _ref14.userAgent, isDarkMode = _ref14.isDarkMode, viewport = _ref14.viewport, cookies = _ref14.cookies, urlConfig = /*#__PURE__*/_objectWithoutPropertiesLoose(_ref14, _excluded2);
715
+ url = function () {
716
+ if (urlConfig.url !== undefined) {
717
+ return urlConfig.url;
1255
718
  }
1256
-
1257
- _context7.next = 6;
1258
- return getGlobalBrowser().userAgent();
1259
-
1260
- case 6:
1261
- _context7.t0 = _context7.sent;
1262
-
1263
- case 7:
1264
- currentUserAgent = _context7.t0;
1265
- page = getGlobalPage();
1266
- _context7.next = 11;
1267
- return page.bringToFront();
1268
-
1269
- case 11:
1270
- if (!viewport) {
1271
- _context7.next = 14;
1272
- break;
719
+ var _urlConfig$path = urlConfig.path,
720
+ path = _urlConfig$path === void 0 ? '/' : _urlConfig$path,
721
+ _urlConfig$port = urlConfig.port,
722
+ port = _urlConfig$port === void 0 ? serverPort : _urlConfig$port,
723
+ _urlConfig$protocol = urlConfig.protocol,
724
+ protocol = _urlConfig$protocol === void 0 ? 'http' : _urlConfig$protocol,
725
+ _urlConfig$hostname = urlConfig.hostname,
726
+ hostname = _urlConfig$hostname === void 0 ? serverHostName : _urlConfig$hostname;
727
+ if (!port) {
728
+ var error = new Error('You must specify a port. You can specify it when calling openPage() or by configuring a dev and ci server in the acceptanceTests config in your package.json');
729
+ // Error.captureStackTrace(error, openPage);
730
+ throw error;
1273
731
  }
1274
-
732
+ return protocol + "://" + hostname + ":" + port + path;
733
+ }();
734
+ _context7.t0 = userAgent;
735
+ if (_context7.t0) {
736
+ _context7.next = 7;
737
+ break;
738
+ }
739
+ _context7.next = 6;
740
+ return getGlobalBrowser().userAgent();
741
+ case 6:
742
+ _context7.t0 = _context7.sent;
743
+ case 7:
744
+ currentUserAgent = _context7.t0;
745
+ page = getGlobalPage();
746
+ _context7.next = 11;
747
+ return page.bringToFront();
748
+ case 11:
749
+ if (!viewport) {
1275
750
  _context7.next = 14;
1276
- return page.setViewport(viewport);
1277
-
1278
- case 14:
1279
- if (!cookies) {
1280
- _context7.next = 17;
1281
- break;
1282
- }
1283
-
751
+ break;
752
+ }
753
+ _context7.next = 14;
754
+ return page.setViewport(viewport);
755
+ case 14:
756
+ if (!cookies) {
1284
757
  _context7.next = 17;
1285
- return page.setCookie.apply(page, cookies);
1286
-
1287
- case 17:
1288
- _context7.next = 19;
1289
- return page.setUserAgent(currentUserAgent + " acceptance-test");
1290
-
1291
- case 19:
1292
- _context7.next = 21;
1293
- return page.emulateMediaFeatures([{
1294
- name: 'prefers-color-scheme',
1295
- value: isDarkMode ? 'dark' : 'light'
1296
- }]);
1297
-
1298
- case 21:
1299
- _context7.next = 23;
1300
- return page.evaluateOnNewDocument(function () {
1301
- var style = document.createElement('style');
1302
- style.innerHTML = "\n *, *:after, *:before {\n transition-delay: 0s !important;\n transition-duration: 0s !important;\n animation-delay: -0.0001s !important;\n animation-duration: 0s !important;\n animation-play-state: paused !important;\n caret-color: transparent !important;\n font-variant-ligatures: none !important;\n }\n *::-webkit-scrollbar {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n }\n ";
1303
- window.addEventListener('DOMContentLoaded', function () {
1304
- document.head.appendChild(style);
1305
- });
758
+ break;
759
+ }
760
+ _context7.next = 17;
761
+ return page.setCookie.apply(page, cookies);
762
+ case 17:
763
+ _context7.next = 19;
764
+ return page.setUserAgent(currentUserAgent + " acceptance-test");
765
+ case 19:
766
+ _context7.next = 21;
767
+ return page.emulateMediaFeatures([{
768
+ name: 'prefers-color-scheme',
769
+ value: isDarkMode ? 'dark' : 'light'
770
+ }]);
771
+ case 21:
772
+ _context7.next = 23;
773
+ return page.evaluateOnNewDocument(function () {
774
+ var style = document.createElement('style');
775
+ style.innerHTML = "\n *, *:after, *:before {\n transition-delay: 0s !important;\n transition-duration: 0s !important;\n animation-delay: -0.0001s !important;\n animation-duration: 0s !important;\n animation-play-state: paused !important;\n caret-color: transparent !important;\n font-variant-ligatures: none !important;\n }\n *::-webkit-scrollbar {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n }\n ";
776
+ window.addEventListener('DOMContentLoaded', function () {
777
+ document.head.appendChild(style);
1306
778
  });
1307
-
1308
- case 23:
1309
- if (!needsRequestInterception) {
1310
- _context7.next = 27;
1311
- break;
1312
- }
1313
-
1314
- _context7.next = 26;
1315
- return page.setRequestInterception(true);
1316
-
1317
- case 26:
1318
- page.on('request', requestInterceptor);
1319
-
1320
- case 27:
1321
- _context7.prev = 27;
1322
- _context7.next = 30;
1323
- return page["goto"](url);
1324
-
1325
- case 30:
1326
- _context7.next = 41;
779
+ });
780
+ case 23:
781
+ if (!needsRequestInterception) {
782
+ _context7.next = 27;
1327
783
  break;
1328
-
1329
- case 32:
1330
- _context7.prev = 32;
1331
- _context7.t1 = _context7["catch"](27);
1332
-
1333
- if (!_context7.t1.message.includes('net::ERR_CONNECTION_REFUSED')) {
1334
- _context7.next = 40;
1335
- break;
1336
- }
1337
-
1338
- connectionError = new Error("Could not connect to " + url + ". Is the server running?");
1339
- Error.captureStackTrace(connectionError, openPage);
1340
- throw connectionError;
1341
-
1342
- case 40:
1343
- throw _context7.t1;
1344
-
1345
- case 41:
1346
- _context7.next = 43;
1347
- return page.waitForFunction('document.fonts.status === "loaded"');
1348
-
1349
- case 43:
1350
- return _context7.abrupt("return", getPageApi(page));
1351
-
1352
- case 44:
1353
- case "end":
1354
- return _context7.stop();
1355
- }
784
+ }
785
+ _context7.next = 26;
786
+ return page.setRequestInterception(true);
787
+ case 26:
788
+ page.on('request', requestInterceptor);
789
+ case 27:
790
+ _context7.prev = 27;
791
+ _context7.next = 30;
792
+ return page["goto"](url);
793
+ case 30:
794
+ _context7.next = 41;
795
+ break;
796
+ case 32:
797
+ _context7.prev = 32;
798
+ _context7.t1 = _context7["catch"](27);
799
+ if (!_context7.t1.message.includes('net::ERR_CONNECTION_REFUSED')) {
800
+ _context7.next = 40;
801
+ break;
802
+ }
803
+ connectionError = new Error("Could not connect to " + url + ". Is the server running?");
804
+ Error.captureStackTrace(connectionError, openPage);
805
+ throw connectionError;
806
+ case 40:
807
+ throw _context7.t1;
808
+ case 41:
809
+ _context7.next = 43;
810
+ return page.waitForFunction('document.fonts.status === "loaded"');
811
+ case 43:
812
+ return _context7.abrupt("return", getPageApi(page));
813
+ case 44:
814
+ case "end":
815
+ return _context7.stop();
1356
816
  }
1357
817
  }, _callee7, null, [[27, 32]]);
1358
818
  }));
1359
-
1360
819
  return function openPage(_x11) {
1361
820
  return _ref15.apply(this, arguments);
1362
821
  };
1363
822
  }();
1364
-
1365
823
  var buildQueryMethods = function buildQueryMethods(_temp3) {
1366
824
  var _ref16 = _temp3 === void 0 ? {} : _temp3,
1367
- page = _ref16.page,
1368
- element = _ref16.element;
1369
-
825
+ page = _ref16.page,
826
+ element = _ref16.element;
1370
827
  var boundQueries = {};
1371
-
1372
828
  var _loop = function _loop() {
1373
829
  var _Object$entries$_i = _Object$entries[_i],
1374
- queryName = _Object$entries$_i[0],
1375
- queryFn = _Object$entries$_i[1];
1376
- boundQueries[queryName] = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12() {
830
+ queryName = _Object$entries$_i[0],
831
+ queryFn = _Object$entries$_i[1];
832
+ boundQueries[queryName] = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
1377
833
  var doc,
1378
- body,
1379
- _len2,
1380
- args,
1381
- _key2,
1382
- queryArgs,
1383
- elementHandle,
1384
- newElementHandle,
1385
- _args12 = arguments;
1386
-
1387
- return runtime_1.wrap(function _callee12$(_context12) {
1388
- while (1) {
1389
- switch (_context12.prev = _context12.next) {
1390
- case 0:
1391
- _context12.next = 2;
1392
- return getDocument(page != null ? page : getGlobalPage());
1393
-
1394
- case 2:
1395
- doc = _context12.sent;
1396
- _context12.next = 5;
1397
- return doc.$('body');
1398
-
1399
- case 5:
1400
- body = _context12.sent;
1401
-
1402
- for (_len2 = _args12.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1403
- args[_key2] = _args12[_key2];
1404
- }
1405
-
1406
- queryArgs = [].concat(args);
1407
-
1408
- if (queryName.startsWith('findBy')) {
1409
- if (queryArgs.length === 1) {
1410
- queryArgs.push(undefined);
1411
- }
1412
-
1413
- queryArgs.push({
1414
- timeout: 10000
1415
- });
834
+ body,
835
+ _len2,
836
+ args,
837
+ _key2,
838
+ queryArgs,
839
+ elementHandle,
840
+ newElementHandle,
841
+ _args12 = arguments;
842
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
843
+ while (1) switch (_context12.prev = _context12.next) {
844
+ case 0:
845
+ _context12.next = 2;
846
+ return getDocument(page != null ? page : getGlobalPage());
847
+ case 2:
848
+ doc = _context12.sent;
849
+ _context12.next = 5;
850
+ return doc.$('body');
851
+ case 5:
852
+ body = _context12.sent;
853
+ for (_len2 = _args12.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
854
+ args[_key2] = _args12[_key2];
855
+ }
856
+ queryArgs = [].concat(args);
857
+ if (queryName.startsWith('findBy')) {
858
+ if (queryArgs.length === 1) {
859
+ queryArgs.push(undefined);
1416
860
  }
1417
-
1418
- _context12.next = 11;
1419
- return queryFn.apply(void 0, [element != null ? element : body].concat(queryArgs));
1420
-
1421
- case 11:
1422
- elementHandle = _context12.sent;
1423
- newElementHandle = Object.create(elementHandle);
1424
-
1425
- newElementHandle.screenshot = /*#__PURE__*/function () {
1426
- var _ref18 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(options) {
1427
- return runtime_1.wrap(function _callee8$(_context8) {
1428
- while (1) {
1429
- switch (_context8.prev = _context8.next) {
1430
- case 0:
1431
- if (options != null && options.skipNetworkWait) {
1432
- _context8.next = 3;
1433
- break;
1434
- }
1435
-
1436
- _context8.next = 3;
1437
- return (page != null ? page : getGlobalPage()).waitForNetworkIdle();
1438
-
1439
- case 3:
1440
- _context8.next = 5;
1441
- return waitForPaintEnd(elementHandle, _extends({}, options, {
1442
- fullPage: false
1443
- }));
1444
-
1445
- case 5:
1446
- return _context8.abrupt("return", elementHandle.screenshot(normalizeSreenshotOptions(options)));
1447
-
1448
- case 6:
1449
- case "end":
1450
- return _context8.stop();
1451
- }
1452
- }
1453
- }, _callee8);
1454
- }));
1455
-
1456
- return function (_x12) {
1457
- return _ref18.apply(this, arguments);
1458
- };
1459
- }();
1460
-
1461
- newElementHandle.click = /*#__PURE__*/function () {
1462
- var _ref19 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(options) {
1463
- return runtime_1.wrap(function _callee9$(_context9) {
1464
- while (1) {
1465
- switch (_context9.prev = _context9.next) {
1466
- case 0:
1467
- _context9.next = 2;
1468
- return scrollIntoView(elementHandle);
1469
-
1470
- case 2:
1471
- return _context9.abrupt("return", elementHandle.click(options));
1472
-
1473
- case 3:
1474
- case "end":
1475
- return _context9.stop();
1476
- }
1477
- }
1478
- }, _callee9);
1479
- }));
1480
-
1481
- return function (_x13) {
1482
- return _ref19.apply(this, arguments);
1483
- };
1484
- }();
1485
-
1486
- newElementHandle.type = /*#__PURE__*/function () {
1487
- var _ref20 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(text, options) {
1488
- return runtime_1.wrap(function _callee10$(_context10) {
1489
- while (1) {
1490
- switch (_context10.prev = _context10.next) {
1491
- case 0:
1492
- _context10.next = 2;
1493
- return scrollIntoView(elementHandle);
1494
-
1495
- case 2:
1496
- return _context10.abrupt("return", elementHandle.type(text, options));
1497
-
1498
- case 3:
1499
- case "end":
1500
- return _context10.stop();
861
+ queryArgs.push({
862
+ timeout: 10000
863
+ });
864
+ }
865
+ _context12.next = 11;
866
+ return queryFn.apply(void 0, [element != null ? element : body].concat(queryArgs));
867
+ case 11:
868
+ elementHandle = _context12.sent;
869
+ newElementHandle = Object.create(elementHandle);
870
+ newElementHandle.screenshot = /*#__PURE__*/function () {
871
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(options) {
872
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
873
+ while (1) switch (_context8.prev = _context8.next) {
874
+ case 0:
875
+ if (options != null && options.skipNetworkWait) {
876
+ _context8.next = 3;
877
+ break;
1501
878
  }
1502
- }
1503
- }, _callee10);
1504
- }));
1505
-
1506
- return function (_x14, _x15) {
1507
- return _ref20.apply(this, arguments);
1508
- };
1509
- }();
1510
-
1511
- newElementHandle.select = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
1512
- var _args11 = arguments;
1513
- return runtime_1.wrap(function _callee11$(_context11) {
1514
- while (1) {
1515
- switch (_context11.prev = _context11.next) {
1516
- case 0:
1517
- _context11.next = 2;
1518
- return scrollIntoView(elementHandle);
1519
-
1520
- case 2:
1521
- return _context11.abrupt("return", elementHandle.select.apply(elementHandle, _args11));
1522
-
1523
- case 3:
1524
- case "end":
1525
- return _context11.stop();
1526
- }
879
+ _context8.next = 3;
880
+ return (page != null ? page : getGlobalPage()).waitForNetworkIdle();
881
+ case 3:
882
+ _context8.next = 5;
883
+ return waitForPaintEnd(elementHandle, _extends({}, options, {
884
+ fullPage: false
885
+ }));
886
+ case 5:
887
+ return _context8.abrupt("return", elementHandle.screenshot(normalizeSreenshotOptions(options)));
888
+ case 6:
889
+ case "end":
890
+ return _context8.stop();
1527
891
  }
1528
- }, _callee11);
892
+ }, _callee8);
1529
893
  }));
1530
- return _context12.abrupt("return", newElementHandle);
1531
-
1532
- case 18:
1533
- case "end":
1534
- return _context12.stop();
1535
- }
894
+ return function (_x12) {
895
+ return _ref18.apply(this, arguments);
896
+ };
897
+ }();
898
+ newElementHandle.click = /*#__PURE__*/function () {
899
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(options) {
900
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
901
+ while (1) switch (_context9.prev = _context9.next) {
902
+ case 0:
903
+ _context9.next = 2;
904
+ return scrollIntoView(elementHandle);
905
+ case 2:
906
+ return _context9.abrupt("return", elementHandle.click(options));
907
+ case 3:
908
+ case "end":
909
+ return _context9.stop();
910
+ }
911
+ }, _callee9);
912
+ }));
913
+ return function (_x13) {
914
+ return _ref19.apply(this, arguments);
915
+ };
916
+ }();
917
+ newElementHandle.type = /*#__PURE__*/function () {
918
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(text, options) {
919
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
920
+ while (1) switch (_context10.prev = _context10.next) {
921
+ case 0:
922
+ _context10.next = 2;
923
+ return scrollIntoView(elementHandle);
924
+ case 2:
925
+ return _context10.abrupt("return", elementHandle.type(text, options));
926
+ case 3:
927
+ case "end":
928
+ return _context10.stop();
929
+ }
930
+ }, _callee10);
931
+ }));
932
+ return function (_x14, _x15) {
933
+ return _ref20.apply(this, arguments);
934
+ };
935
+ }();
936
+ newElementHandle.select = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
937
+ var _args11 = arguments;
938
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
939
+ while (1) switch (_context11.prev = _context11.next) {
940
+ case 0:
941
+ _context11.next = 2;
942
+ return scrollIntoView(elementHandle);
943
+ case 2:
944
+ return _context11.abrupt("return", elementHandle.select.apply(elementHandle, _args11));
945
+ case 3:
946
+ case "end":
947
+ return _context11.stop();
948
+ }
949
+ }, _callee11);
950
+ }));
951
+ return _context12.abrupt("return", newElementHandle);
952
+ case 18:
953
+ case "end":
954
+ return _context12.stop();
1536
955
  }
1537
956
  }, _callee12);
1538
957
  }));
1539
958
  };
1540
-
1541
959
  for (var _i = 0, _Object$entries = Object.entries(queries); _i < _Object$entries.length; _i++) {
1542
960
  _loop();
1543
961
  }
1544
-
1545
962
  return boundQueries;
1546
963
  };
1547
-
1548
964
  var getScreen = function getScreen(page) {
1549
965
  return buildQueryMethods({
1550
966
  page: page
@@ -1556,52 +972,43 @@ var within = function within(element) {
1556
972
  element: element
1557
973
  });
1558
974
  };
1559
- beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13() {
1560
- return runtime_1.wrap(function _callee13$(_context13) {
1561
- while (1) {
1562
- switch (_context13.prev = _context13.next) {
1563
- case 0:
1564
- _context13.next = 2;
1565
- return getGlobalPage().setRequestInterception(false);
1566
-
1567
- case 2:
1568
- _context13.next = 4;
1569
- return global.jestPuppeteer.resetPage();
1570
-
1571
- case 4:
1572
- case "end":
1573
- return _context13.stop();
1574
- }
975
+ beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
976
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
977
+ while (1) switch (_context13.prev = _context13.next) {
978
+ case 0:
979
+ _context13.next = 2;
980
+ return getGlobalPage().setRequestInterception(false);
981
+ case 2:
982
+ _context13.next = 4;
983
+ return global.jestPuppeteer.resetPage();
984
+ case 4:
985
+ case "end":
986
+ return _context13.stop();
1575
987
  }
1576
988
  }, _callee13);
1577
989
  })));
1578
- afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14() {
990
+ afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
1579
991
  var page;
1580
- return runtime_1.wrap(function _callee14$(_context14) {
1581
- while (1) {
1582
- switch (_context14.prev = _context14.next) {
1583
- case 0:
1584
- _context14.prev = 0;
1585
- page = getGlobalPage();
1586
- requestHandlers = [];
1587
- needsRequestInterception = false;
1588
- page.off('request', requestInterceptor); // clear tab, this way we clear the DOM and stop js execution or pending requests
1589
-
1590
- _context14.next = 7;
1591
- return page["goto"]('about:blank');
1592
-
1593
- case 7:
1594
- _context14.next = 11;
1595
- break;
1596
-
1597
- case 9:
1598
- _context14.prev = 9;
1599
- _context14.t0 = _context14["catch"](0);
1600
-
1601
- case 11:
1602
- case "end":
1603
- return _context14.stop();
1604
- }
992
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
993
+ while (1) switch (_context14.prev = _context14.next) {
994
+ case 0:
995
+ _context14.prev = 0;
996
+ page = getGlobalPage();
997
+ requestHandlers = [];
998
+ needsRequestInterception = false;
999
+ page.off('request', requestInterceptor);
1000
+ // clear tab, this way we clear the DOM and stop js execution or pending requests
1001
+ _context14.next = 7;
1002
+ return page["goto"]('about:blank');
1003
+ case 7:
1004
+ _context14.next = 11;
1005
+ break;
1006
+ case 9:
1007
+ _context14.prev = 9;
1008
+ _context14.t0 = _context14["catch"](0);
1009
+ case 11:
1010
+ case "end":
1011
+ return _context14.stop();
1605
1012
  }
1606
1013
  }, _callee14, null, [[0, 9]]);
1607
1014
  })));
@@ -1614,20 +1021,16 @@ afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
1614
1021
  * To workaround this bug or limitation, this function prepares the file by copying it to /tmp in
1615
1022
  * the host and the container.
1616
1023
  */
1617
-
1618
1024
  var prepareFile = function prepareFile(filepath) {
1619
1025
  var isLocal = !isCi;
1620
1026
  var isHeadless = !!process.env.HEADLESS;
1621
1027
  var usesDocker = isLocal && isHeadless;
1622
1028
  var dockerComposeFile = path.join(__dirname, '..', 'docker-compose.yaml');
1623
-
1624
1029
  if (usesDocker) {
1625
1030
  var containerId = execSync("docker-compose -f " + dockerComposeFile + " ps -q").toString().trim();
1626
-
1627
1031
  if (!containerId) {
1628
1032
  throw Error('acceptance-testing container not found');
1629
1033
  }
1630
-
1631
1034
  execSync("docker cp " + filepath + " " + containerId + ":/tmp");
1632
1035
  var newPath = path.join('/tmp', path.basename(filepath));
1633
1036
  fs.copyFileSync(filepath, newPath);
@@ -1639,28 +1042,23 @@ var prepareFile = function prepareFile(filepath) {
1639
1042
  /**
1640
1043
  * A convenience method to defer an expectation
1641
1044
  */
1642
-
1643
1045
  var wait = function wait(expectation, timeout, interval) {
1644
1046
  if (timeout === void 0) {
1645
1047
  timeout = 10000;
1646
1048
  }
1647
-
1648
1049
  if (interval === void 0) {
1649
1050
  interval = 50;
1650
1051
  }
1651
-
1652
1052
  var startTime = Date.now();
1653
1053
  return new Promise(function (resolve, reject) {
1654
1054
  var rejectOrRerun = function rejectOrRerun(error) {
1655
1055
  if (Date.now() - startTime >= timeout) {
1656
1056
  reject(error);
1657
1057
  return;
1658
- } // eslint-disable-next-line @typescript-eslint/no-use-before-define
1659
-
1660
-
1058
+ }
1059
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
1661
1060
  setTimeout(runExpectation, interval);
1662
1061
  };
1663
-
1664
1062
  var runExpectation = function runExpectation() {
1665
1063
  try {
1666
1064
  Promise.resolve(expectation()).then(function (r) {
@@ -1670,7 +1068,6 @@ var wait = function wait(expectation, timeout, interval) {
1670
1068
  rejectOrRerun(error);
1671
1069
  }
1672
1070
  };
1673
-
1674
1071
  setTimeout(runExpectation, 0);
1675
1072
  });
1676
1073
  };