@telefonica/acceptance-testing 2.8.0 → 2.10.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.
@@ -1 +1 @@
1
- {"version":3,"file":"acceptance-testing.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import path from 'path';\nimport fs from 'fs';\nimport findRoot from 'find-root';\nimport {getDocument, queries} from 'pptr-testing-library';\nimport {configureToMatchImageSnapshot} from 'jest-image-snapshot';\n\nimport type {\n Page,\n ElementHandle,\n ScreenshotOptions,\n Browser,\n ClickOptions,\n Viewport,\n GeolocationOptions,\n} from 'puppeteer';\nimport type {getQueriesForElement} from 'pptr-testing-library';\n\nexport const getGlobalBrowser = (): Browser => (global as any).browser;\nexport const getGlobalPage = (): Page => (global as any).page;\n\nconst isCi = process.argv.includes('--ci') || process.env.CI;\nconst isUsingDockerizedChromium = isCi || new URL(getGlobalBrowser().wsEndpoint()).port === '9223';\n\nexport const serverHostName = ((): string => {\n if (isCi) {\n return 'localhost';\n }\n\n if (isUsingDockerizedChromium) {\n return process.platform === 'linux' ? '172.17.0.1' : 'host.docker.internal';\n }\n\n return 'localhost';\n})();\n\nconst rootDir = findRoot(process.cwd());\nconst pkg = JSON.parse(fs.readFileSync(path.join(rootDir, 'package.json'), 'utf-8'));\nconst projectConfig = pkg.acceptanceTests ?? {};\nconst server = (isCi ? projectConfig.ciServer : projectConfig.devServer) ?? projectConfig.server;\n\nexport const serverPort = server?.port;\n\nconst toMatchImageSnapshot = configureToMatchImageSnapshot({\n failureThreshold: 0,\n failureThresholdType: 'percent',\n customSnapshotIdentifier: ({defaultIdentifier}) => defaultIdentifier,\n});\n\nlet calledToMatchImageSnapshotOutsideDocker = false;\n\nconst localToMatchImageSnapshot = () => {\n calledToMatchImageSnapshotOutsideDocker = true;\n // let the expectation pass, then fail in afterEach. This way we allow developers to debug screenshot tests in local\n // but don't allow them to save screenshots taken outside the dockerized chromium\n return {\n message: () => '',\n pass: true,\n };\n};\n\nexpect.extend({\n toMatchImageSnapshot: isUsingDockerizedChromium ? toMatchImageSnapshot : localToMatchImageSnapshot,\n});\n\nafterEach(() => {\n if (calledToMatchImageSnapshotOutsideDocker) {\n const error = new Error(\n `Calling .toMatchImageSnapshot() is not allowed outside dockerized browser. Please, run your screenshot test in headless mode.`\n );\n error.stack = (error.stack || '').split('\\n')[0];\n throw error;\n }\n});\n\ntype WaitForPaintEndOptions = {\n fullPage?: boolean;\n captureBeyondViewport?: boolean;\n};\n\nconst waitForPaintEnd = async (\n element: ElementHandle | Page,\n {fullPage = true, captureBeyondViewport}: WaitForPaintEndOptions = {}\n) => {\n const MAX_WAIT = 15000;\n const STEP_TIME = 250;\n const t0 = Date.now();\n\n let buf1 = (await element.screenshot(\n normalizeSreenshotOptions({fullPage, captureBeyondViewport})\n )) as Buffer;\n await new Promise((r) => setTimeout(r, STEP_TIME));\n let buf2 = (await element.screenshot(\n normalizeSreenshotOptions({fullPage, captureBeyondViewport})\n )) as Buffer;\n\n // buffers are different if compare != 0\n while (buf1.compare(buf2)) {\n if (Date.now() - t0 > MAX_WAIT) {\n throw Error('Paint end timeout');\n }\n buf1 = buf2;\n await new Promise((r) => setTimeout(r, STEP_TIME));\n buf2 = (await element.screenshot(\n normalizeSreenshotOptions({fullPage, captureBeyondViewport})\n )) as Buffer;\n }\n};\n\nexport interface PageApi extends Omit<Page, 'click' | 'type' | 'select'> {\n clear: (selector: ElementHandle) => Promise<void>;\n // These are overridden:\n type: (selector: ElementHandle, text: string, options?: {delay: number}) => Promise<void>;\n click: (selector: ElementHandle, options?: ClickOptions) => Promise<void>;\n select: (selector: ElementHandle, ...values: string[]) => Promise<string[]>;\n}\n\nconst normalizeSreenshotOptions = ({captureBeyondViewport = false, ...options}: ScreenshotOptions = {}) => {\n // Puppeter default for captureBeyondViewport is true, but we think false is a better default.\n // When this is true, the fixed elements (like fixed footers) are relative to the original page\n // viewport, not to the full page, so those elements look weird in fullPage screenshots.\n return {...options, captureBeyondViewport};\n};\n\nexport const getPageApi = (page: Page): PageApi => {\n const api: PageApi = Object.create(page);\n\n api.type = async (elementHandle, text, options) => elementHandle.type(text, options);\n api.click = async (elementHandle, options) => elementHandle.click(options);\n api.select = async (elementHandle, ...values) => elementHandle.select(...values);\n\n api.screenshot = async (options?: ScreenshotOptions) => {\n await page.waitForNetworkIdle();\n await waitForPaintEnd(page, options);\n return page.screenshot(normalizeSreenshotOptions(options));\n };\n\n api.clear = async (elementHandle) => {\n await elementHandle.click({clickCount: 3});\n await elementHandle.press('Delete');\n };\n\n // For some reason, puppeteer browserContext.overridePermissions doesn't work with newer chrome versions.\n // This workaround polyfills the browser geolocation api to return the mocked position\n api.setGeolocation = (position: GeolocationOptions) =>\n page.evaluate((position) => {\n window.navigator.geolocation.getCurrentPosition = (callback) => {\n // @ts-ignore\n callback({\n coords: position,\n });\n };\n }, position as any);\n\n return api;\n};\n\ntype CookieConfig = {\n name: string;\n value: string;\n url?: string;\n domain?: string;\n path?: string;\n secure?: boolean;\n httpOnly?: boolean;\n sameSite?: 'Strict' | 'Lax' | 'None';\n expires?: number;\n priority?: 'Low' | 'Medium' | 'High';\n sameParty?: boolean;\n sourceScheme?: 'Unset' | 'NonSecure' | 'Secure';\n sourcePort?: number;\n};\n\ninterface OpenPageCommonConfig {\n userAgent?: string;\n viewport?: Viewport;\n isDarkMode?: boolean;\n cookies?: Array<CookieConfig>;\n}\n\ninterface OpenPageUrlConfig extends OpenPageCommonConfig {\n url: string;\n}\n\ninterface OpenPagePathConfig extends OpenPageCommonConfig {\n url?: undefined;\n\n path?: string;\n port?: number;\n protocol?: string;\n hostname?: string;\n}\n\ntype OpenPageConfig = OpenPageUrlConfig | OpenPagePathConfig;\n\nexport const openPage = async ({\n userAgent,\n isDarkMode,\n viewport,\n cookies,\n ...urlConfig\n}: OpenPageConfig): Promise<PageApi> => {\n const url = ((): string => {\n if (urlConfig.url !== undefined) {\n return urlConfig.url;\n }\n\n const {path = '/', port = serverPort, protocol = 'http', hostname = serverHostName} = urlConfig;\n\n if (!port) {\n const error = new Error(\n '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'\n );\n // Error.captureStackTrace(error, openPage);\n throw error;\n }\n\n return `${protocol}://${hostname}:${port}${path}`;\n })();\n\n const currentUserAgent = userAgent || (await getGlobalBrowser().userAgent());\n const page = getGlobalPage();\n\n await page.bringToFront();\n if (viewport) {\n await page.setViewport(viewport);\n }\n if (cookies) {\n await page.setCookie(...cookies);\n }\n await page.setUserAgent(`${currentUserAgent} acceptance-test`);\n await page.emulateMediaFeatures([{name: 'prefers-color-scheme', value: isDarkMode ? 'dark' : 'light'}]);\n\n // A set of styles to make screenshot tests more reliable.\n await page.evaluateOnNewDocument(() => {\n const style = document.createElement('style');\n 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 `;\n window.addEventListener('DOMContentLoaded', () => {\n document.head.appendChild(style);\n });\n });\n\n try {\n await page.goto(url);\n } catch (e) {\n if ((e as Error).message.includes('net::ERR_CONNECTION_REFUSED')) {\n const connectionError = new Error(`Could not connect to ${url}. Is the server running?`);\n Error.captureStackTrace(connectionError, openPage);\n throw connectionError;\n } else {\n throw e;\n }\n }\n await page.waitForFunction('document.fonts.status === \"loaded\"');\n\n return getPageApi(page);\n};\n\nconst buildQueryMethods = ({page, element}: {page?: Page; element?: ElementHandle} = {}): ReturnType<\n typeof getQueriesForElement\n> => {\n const boundQueries: any = {};\n for (const [queryName, queryFn] of Object.entries(queries)) {\n boundQueries[queryName] = async (...args: any) => {\n const doc = await getDocument(page ?? getGlobalPage());\n const body = await doc.$('body');\n const queryArgs = [...args];\n if (queryName.startsWith('findBy')) {\n if (queryArgs.length === 1) {\n queryArgs.push(undefined);\n }\n queryArgs.push({timeout: 10000});\n }\n const elementHandle = await queryFn(element ?? body, ...queryArgs);\n\n const newElementHandle = Object.create(elementHandle);\n\n newElementHandle.screenshot = async (options: ScreenshotOptions) => {\n await (page ?? getGlobalPage()).waitForNetworkIdle();\n await waitForPaintEnd(elementHandle, {...options, fullPage: false});\n return elementHandle.screenshot(normalizeSreenshotOptions(options));\n };\n\n return newElementHandle;\n };\n }\n return boundQueries;\n};\n\nexport const getScreen = (page: Page) => buildQueryMethods({page});\n\nexport const screen = buildQueryMethods();\n\nexport const within = (element: ElementHandle) => buildQueryMethods({element});\n\nexport type {ElementHandle, Viewport} from 'puppeteer';\n\nbeforeEach(async () => {\n // by resetting the page we clean up all the evaluateOnNewDocument calls, which are persistent between documents\n await (global as any).jestPuppeteer.resetPage();\n});\n\nafterEach(async () => {\n try {\n // clear tab, this way we clear the DOM and stop js execution or pending requests\n await getGlobalPage().goto('about:blank');\n } catch (e) {\n // ignore, at this point page might be destroyed\n }\n});\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","getGlobalBrowser","global","browser","getGlobalPage","page","isCi","process","argv","includes","env","CI","isUsingDockerizedChromium","URL","wsEndpoint","port","serverHostName","platform","projectConfig","JSON","parse","fs","readFileSync","path","join","findRoot","cwd","acceptanceTests","server","ciServer","devServer","serverPort","calledToMatchImageSnapshotOutsideDocker","expect","extend","toMatchImageSnapshot","configureToMatchImageSnapshot","failureThreshold","failureThresholdType","customSnapshotIdentifier","defaultIdentifier","message","pass","afterEach","stack","split","waitForPaintEnd","element","fullPage","captureBeyondViewport","MAX_WAIT","STEP_TIME","t0","Date","now","screenshot","normalizeSreenshotOptions","buf1","r","setTimeout","buf2","compare","getPageApi","api","elementHandle","text","options","click","select","waitForNetworkIdle","clear","clickCount","press","setGeolocation","position","evaluate","window","navigator","geolocation","getCurrentPosition","callback","coords","openPage","userAgent","isDarkMode","viewport","cookies","urlConfig","url","protocol","hostname","currentUserAgent","bringToFront","setViewport","setCookie","setUserAgent","emulateMediaFeatures","evaluateOnNewDocument","style","document","createElement","innerHTML","addEventListener","head","appendChild","_context7","connectionError","captureStackTrace","waitForFunction","buildQueryMethods","boundQueries","queryName","queryFn","getDocument","doc","$","body","args","queryArgs","startsWith","timeout","newElementHandle","entries","queries","screen","beforeEach","jestPuppeteer","resetPage"],"mappings":"4/BAOIA,EAAW,SAAUC,OAGnBC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAA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AoB,WACxCH,SAASI,KAAKC,YAAYN,4CAKxB7F,OAAUmF,kEAEXiB,KAAYhE,QAAQhC,SAAS,sDACxBiG,EAAkB,IAAIhN,8BAA8B8L,8BAC1D9L,MAAMiN,kBAAkBD,EAAiBxB,GACnCwB,8CAKRrG,EAAKuG,gBAAgB,uEAEpB9C,EAAWzD,qHAGhBwG,EAAoB,iCAA2D,KAAzDxG,IAAAA,KAAM0C,IAAAA,QAGxB+D,EAAoB,2BACdC,OAAWC,OACnBF,EAAaC,aAAa,4HACJE,oBAAY5G,EAAAA,EAAQD,mBAAhC8G,kBACaA,EAAIC,EAAE,mBAAnBC,oBAF0BC,2BAAAA,iBAG1BC,YAAgBD,GAClBN,EAAUQ,WAAW,YACI,IAArBD,EAAUhK,QACVgK,EAAUvK,UAAKpD,GAEnB2N,EAAUvK,KAAK,CAACyK,QAAS,iBAEDR,sBAAQjE,EAAAA,EAAWqE,UAASE,mBAAlDtD,UAEAyD,EAAmBlQ,OAAO2B,OAAO8K,IAEtBT,sCAAa,WAAOW,yFAC1B7D,EAAAA,EAAQD,KAAiBiE,4CAC1BvB,EAAgBkB,OAAmBE,GAASlB,UAAU,qCACrDgB,EAAcT,WAAWC,EAA0BU,wHAGvDuD,sDArBoBlQ,OAAOmQ,QAAQC,qCAwB3Cb,GAKEc,EAASf,IAMtBgB,qBAAW,4FAEA3H,OAAe4H,cAAcC,wDAGxCpF,oBAAU,qGAGIvC,SAAqB,wNAhBV,SAACC,UAAewG,EAAkB,CAACxG,KAAAA,sGAItC,SAAC0C,UAA2B8D,EAAkB,CAAC9D,QAAAA"}
1
+ {"version":3,"file":"acceptance-testing.cjs.production.min.js","sources":["../../../node_modules/regenerator-runtime/runtime.js","../src/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","import path from 'path';\nimport fs from 'fs';\nimport findRoot from 'find-root';\nimport {getDocument, queries} from 'pptr-testing-library';\nimport {configureToMatchImageSnapshot} from 'jest-image-snapshot';\nimport globToRegExp from 'glob-to-regexp';\n\nimport type {\n Page,\n ElementHandle,\n ScreenshotOptions,\n Browser,\n ClickOptions,\n Viewport,\n GeolocationOptions,\n HTTPRequest,\n ResponseForRequest,\n} from 'puppeteer';\nimport type {getQueriesForElement} from 'pptr-testing-library';\n\ntype CustomScreenshotOptions = ScreenshotOptions & {\n skipNetworkWait?: boolean;\n};\n\nexport const getGlobalBrowser = (): Browser => (global as any).browser;\nexport const getGlobalPage = (): Page => (global as any).page;\n\nconst isCi = process.argv.includes('--ci') || process.env.CI;\nconst isUsingDockerizedChromium = isCi || new URL(getGlobalBrowser().wsEndpoint()).port === '9223';\n\nexport const serverHostName = ((): string => {\n if (isCi) {\n return 'localhost';\n }\n\n if (isUsingDockerizedChromium) {\n return process.platform === 'linux' ? '172.17.0.1' : 'host.docker.internal';\n }\n\n return 'localhost';\n})();\n\nconst rootDir = findRoot(process.cwd());\nconst pkg = JSON.parse(fs.readFileSync(path.join(rootDir, 'package.json'), 'utf-8'));\nconst projectConfig = pkg.acceptanceTests ?? {};\nconst server = (isCi ? projectConfig.ciServer : projectConfig.devServer) ?? projectConfig.server;\n\nexport const serverPort = server?.port;\n\nconst toMatchImageSnapshot = configureToMatchImageSnapshot({\n failureThreshold: 0,\n failureThresholdType: 'percent',\n customSnapshotIdentifier: ({defaultIdentifier}) => defaultIdentifier,\n});\n\nlet calledToMatchImageSnapshotOutsideDocker = false;\n\nconst localToMatchImageSnapshot = () => {\n calledToMatchImageSnapshotOutsideDocker = true;\n // let the expectation pass, then fail in afterEach. This way we allow developers to debug screenshot tests in local\n // but don't allow them to save screenshots taken outside the dockerized chromium\n return {\n message: () => '',\n pass: true,\n };\n};\n\nexpect.extend({\n toMatchImageSnapshot: isUsingDockerizedChromium ? toMatchImageSnapshot : localToMatchImageSnapshot,\n});\n\nafterEach(() => {\n if (calledToMatchImageSnapshotOutsideDocker) {\n const error = new Error(\n `Calling .toMatchImageSnapshot() is not allowed outside dockerized browser. Please, run your screenshot test in headless mode.`\n );\n error.stack = (error.stack || '').split('\\n')[0];\n throw error;\n }\n});\n\ntype WaitForPaintEndOptions = {\n fullPage?: boolean;\n captureBeyondViewport?: boolean;\n};\n\nconst waitForPaintEnd = async (\n element: ElementHandle | Page,\n {fullPage = true, captureBeyondViewport}: WaitForPaintEndOptions = {}\n) => {\n const MAX_WAIT = 15000;\n const STEP_TIME = 250;\n const t0 = Date.now();\n\n let buf1 = (await element.screenshot(\n normalizeSreenshotOptions({fullPage, captureBeyondViewport})\n )) as Buffer;\n await new Promise((r) => setTimeout(r, STEP_TIME));\n let buf2 = (await element.screenshot(\n normalizeSreenshotOptions({fullPage, captureBeyondViewport})\n )) as Buffer;\n\n // buffers are different if compare != 0\n while (buf1.compare(buf2)) {\n if (Date.now() - t0 > MAX_WAIT) {\n throw Error('Paint end timeout');\n }\n buf1 = buf2;\n await new Promise((r) => setTimeout(r, STEP_TIME));\n buf2 = (await element.screenshot(\n normalizeSreenshotOptions({fullPage, captureBeyondViewport})\n )) as Buffer;\n }\n};\n\nexport interface PageApi extends Omit<Page, 'click' | 'type' | 'select'> {\n clear: (selector: ElementHandle) => Promise<void>;\n // These are overridden:\n type: (selector: ElementHandle, text: string, options?: {delay: number}) => Promise<void>;\n click: (selector: ElementHandle, options?: ClickOptions) => Promise<void>;\n select: (selector: ElementHandle, ...values: string[]) => Promise<string[]>;\n screenshot: (options?: CustomScreenshotOptions) => Promise<Buffer | string | void>;\n}\n\nconst normalizeSreenshotOptions = ({captureBeyondViewport = false, ...options}: ScreenshotOptions = {}) => {\n // Puppeter default for captureBeyondViewport is true, but we think false is a better default.\n // When this is true, the fixed elements (like fixed footers) are relative to the original page\n // viewport, not to the full page, so those elements look weird in fullPage screenshots.\n return {...options, captureBeyondViewport};\n};\n\nexport const getPageApi = (page: Page): PageApi => {\n const api: PageApi = Object.create(page);\n\n api.type = async (elementHandle, text, options) => elementHandle.type(text, options);\n api.click = async (elementHandle, options) => elementHandle.click(options);\n api.select = async (elementHandle, ...values) => elementHandle.select(...values);\n\n api.screenshot = async (options?: CustomScreenshotOptions) => {\n if (!options?.skipNetworkWait) {\n await page.waitForNetworkIdle();\n }\n await waitForPaintEnd(page, options);\n return page.screenshot(normalizeSreenshotOptions(options));\n };\n\n api.clear = async (elementHandle) => {\n await elementHandle.click({clickCount: 3});\n await elementHandle.press('Delete');\n };\n\n // For some reason, puppeteer browserContext.overridePermissions doesn't work with newer chrome versions.\n // This workaround polyfills the browser geolocation api to return the mocked position\n api.setGeolocation = (position: GeolocationOptions) =>\n page.evaluate((position) => {\n window.navigator.geolocation.getCurrentPosition = (callback) => {\n // @ts-ignore\n callback({\n coords: position,\n });\n };\n }, position as any);\n\n return api;\n};\n\nlet needsRequestInterception = false;\ntype RequestMatcherFn = (req: HTTPRequest) => boolean;\nlet requestHandlers: Array<{\n matcher: RequestMatcherFn;\n handler: jest.Mock<any, any>;\n}> = [];\n\nconst requestInterceptor = (req: HTTPRequest) => {\n const {handler} = requestHandlers.find(({matcher}) => matcher(req)) ?? {handler: null};\n if (!handler) {\n req.continue();\n return;\n }\n const response = handler(req);\n req.respond(response);\n};\n\nexport const interceptRequest = (\n matcher: RequestMatcherFn\n): jest.Mock<Partial<ResponseForRequest>, [HTTPRequest]> => {\n needsRequestInterception = true;\n const spy = jest.fn();\n requestHandlers.push({matcher, handler: spy});\n return spy;\n};\n\ntype ApiEndpointMock = {\n spyOn(path: string, method?: string): jest.Mock<unknown, [HTTPRequest]>;\n};\n\nexport const createApiEndpointMock = ({baseUrl}: {baseUrl: string}): ApiEndpointMock => {\n interceptRequest((req) => req.method() === 'OPTIONS' && req.url().startsWith(baseUrl)).mockImplementation(\n () => ({\n status: 204,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'POST,PATCH,PUT,GET,OPTIONS',\n 'Access-Control-Allow-Headers': 'Content-Type,Authorization',\n },\n })\n );\n\n return {\n spyOn(path: string, method: string = 'GET') {\n const matcher = (req: HTTPRequest) => {\n const url = req.url();\n const urlPath = url.substring(baseUrl.length);\n return (\n req.method() === method && url.startsWith(baseUrl) && !!urlPath.match(globToRegExp(path))\n );\n };\n\n const spy = jest.fn();\n\n interceptRequest(matcher).mockImplementation((req) => {\n const resBody = spy(req);\n return {\n status: 200,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n },\n contentType: 'application/json',\n body: JSON.stringify(resBody),\n };\n });\n\n return spy;\n },\n };\n};\n\ntype CookieConfig = {\n name: string;\n value: string;\n url?: string;\n domain?: string;\n path?: string;\n secure?: boolean;\n httpOnly?: boolean;\n sameSite?: 'Strict' | 'Lax' | 'None';\n expires?: number;\n priority?: 'Low' | 'Medium' | 'High';\n sameParty?: boolean;\n sourceScheme?: 'Unset' | 'NonSecure' | 'Secure';\n sourcePort?: number;\n};\n\ninterface OpenPageCommonConfig {\n userAgent?: string;\n viewport?: Viewport;\n isDarkMode?: boolean;\n cookies?: Array<CookieConfig>;\n}\n\ninterface OpenPageUrlConfig extends OpenPageCommonConfig {\n url: string;\n}\n\ninterface OpenPagePathConfig extends OpenPageCommonConfig {\n url?: undefined;\n\n path?: string;\n port?: number;\n protocol?: string;\n hostname?: string;\n}\n\ntype OpenPageConfig = OpenPageUrlConfig | OpenPagePathConfig;\n\nexport const openPage = async ({\n userAgent,\n isDarkMode,\n viewport,\n cookies,\n ...urlConfig\n}: OpenPageConfig): Promise<PageApi> => {\n const url = ((): string => {\n if (urlConfig.url !== undefined) {\n return urlConfig.url;\n }\n\n const {path = '/', port = serverPort, protocol = 'http', hostname = serverHostName} = urlConfig;\n\n if (!port) {\n const error = new Error(\n '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'\n );\n // Error.captureStackTrace(error, openPage);\n throw error;\n }\n\n return `${protocol}://${hostname}:${port}${path}`;\n })();\n\n const currentUserAgent = userAgent || (await getGlobalBrowser().userAgent());\n const page = getGlobalPage();\n\n await page.bringToFront();\n if (viewport) {\n await page.setViewport(viewport);\n }\n if (cookies) {\n await page.setCookie(...cookies);\n }\n await page.setUserAgent(`${currentUserAgent} acceptance-test`);\n await page.emulateMediaFeatures([{name: 'prefers-color-scheme', value: isDarkMode ? 'dark' : 'light'}]);\n\n // A set of styles to make screenshot tests more reliable.\n await page.evaluateOnNewDocument(() => {\n const style = document.createElement('style');\n 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 `;\n window.addEventListener('DOMContentLoaded', () => {\n document.head.appendChild(style);\n });\n });\n\n if (needsRequestInterception) {\n await page.setRequestInterception(true);\n page.on('request', requestInterceptor);\n }\n\n try {\n await page.goto(url);\n } catch (e) {\n if ((e as Error).message.includes('net::ERR_CONNECTION_REFUSED')) {\n const connectionError = new Error(`Could not connect to ${url}. Is the server running?`);\n Error.captureStackTrace(connectionError, openPage);\n throw connectionError;\n } else {\n throw e;\n }\n }\n await page.waitForFunction('document.fonts.status === \"loaded\"');\n\n return getPageApi(page);\n};\n\nconst buildQueryMethods = ({page, element}: {page?: Page; element?: ElementHandle} = {}): ReturnType<\n typeof getQueriesForElement\n> => {\n const boundQueries: any = {};\n for (const [queryName, queryFn] of Object.entries(queries)) {\n boundQueries[queryName] = async (...args: any) => {\n const doc = await getDocument(page ?? getGlobalPage());\n const body = await doc.$('body');\n const queryArgs = [...args];\n if (queryName.startsWith('findBy')) {\n if (queryArgs.length === 1) {\n queryArgs.push(undefined);\n }\n queryArgs.push({timeout: 10000});\n }\n const elementHandle = await queryFn(element ?? body, ...queryArgs);\n\n const newElementHandle = Object.create(elementHandle);\n\n newElementHandle.screenshot = async (options: CustomScreenshotOptions) => {\n if (!options?.skipNetworkWait) {\n await (page ?? getGlobalPage()).waitForNetworkIdle();\n }\n await waitForPaintEnd(elementHandle, {...options, fullPage: false});\n return elementHandle.screenshot(normalizeSreenshotOptions(options));\n };\n\n return newElementHandle;\n };\n }\n return boundQueries;\n};\n\nexport const getScreen = (page: Page) => buildQueryMethods({page});\n\nexport const screen = buildQueryMethods();\n\nexport const within = (element: ElementHandle) => buildQueryMethods({element});\n\nexport type {ElementHandle, Viewport} from 'puppeteer';\n\nbeforeEach(async () => {\n await getGlobalPage().setRequestInterception(false);\n // by resetting the page we clean up all the evaluateOnNewDocument calls, which are persistent between documents\n await (global as any).jestPuppeteer.resetPage();\n});\n\nafterEach(async () => {\n try {\n const page = getGlobalPage();\n requestHandlers = [];\n needsRequestInterception = false;\n page.off('request', requestInterceptor);\n\n // clear tab, this way we clear the DOM and stop js execution or pending requests\n await page.goto('about:blank');\n } catch (e) {\n // ignore, at this point page might be destroyed\n }\n});\n"],"names":["runtime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","generator","create","Generator","context","Context","_invoke","state","method","arg","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","previousPromise","callInvokeWithMethodAndArg","resolve","reject","invoke","result","__await","then","unwrapped","error","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","getGlobalBrowser","global","browser","getGlobalPage","page","isCi","process","argv","includes","env","CI","isUsingDockerizedChromium","URL","wsEndpoint","port","serverHostName","platform","projectConfig","JSON","parse","fs","readFileSync","path","join","findRoot","cwd","acceptanceTests","server","ciServer","devServer","serverPort","calledToMatchImageSnapshotOutsideDocker","expect","extend","toMatchImageSnapshot","configureToMatchImageSnapshot","failureThreshold","failureThresholdType","customSnapshotIdentifier","defaultIdentifier","message","pass","afterEach","stack","split","waitForPaintEnd","element","fullPage","captureBeyondViewport","MAX_WAIT","STEP_TIME","t0","Date","now","screenshot","normalizeSreenshotOptions","buf1","r","setTimeout","buf2","compare","getPageApi","api","elementHandle","text","options","click","select","skipNetworkWait","waitForNetworkIdle","clear","clickCount","press","setGeolocation","position","evaluate","window","navigator","geolocation","getCurrentPosition","callback","coords","needsRequestInterception","requestHandlers","requestInterceptor","req","handler","find","matcher","response","respond","interceptRequest","spy","jest","openPage","userAgent","isDarkMode","viewport","cookies","urlConfig","url","protocol","hostname","currentUserAgent","bringToFront","setViewport","setCookie","setUserAgent","emulateMediaFeatures","evaluateOnNewDocument","style","document","createElement","innerHTML","addEventListener","head","appendChild","setRequestInterception","on","_context7","connectionError","captureStackTrace","waitForFunction","buildQueryMethods","boundQueries","queryName","queryFn","getDocument","doc","$","body","args","queryArgs","startsWith","timeout","newElementHandle","entries","queries","screen","beforeEach","jestPuppeteer","resetPage","off","baseUrl","mockImplementation","status","headers","spyOn","urlPath","substring","match","globToRegExp","resBody","contentType","stringify"],"mappings":"2hCAOIA,EAAW,SAAUC,OAGnBC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,GAClDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,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BAAuB,0BAEtCpH,OAAe2I,cAAcC,wDAGxCnG,oBAAU,kGAEItC,EAAOD,IACbgF,EAAkB,GAClBD,GAA2B,EAC3B9E,EAAK0I,IAAI,UAAW1D,YAGdhF,OAAU,8JAzNa,gBAAE2I,IAAAA,eACnCpD,GAAiB,SAACN,SAAyB,YAAjBA,EAAI9L,UAA0B8L,EAAIe,MAAMiC,WAAWU,MAAUC,oBACnF,iBAAO,CACHC,OAAQ,IACRC,QAAS,+BAC0B,mCACC,4DACA,kCAKrC,CACHC,eAAM7H,EAAc/H,YAAAA,IAAAA,EAAiB,WAS3BqM,EAAMC,KAAKrL,YAEjBmL,GAVgB,SAACN,OACPe,EAAMf,EAAIe,MACVgD,EAAUhD,EAAIiD,UAAUN,EAAQ1L,eAElCgI,EAAI9L,WAAaA,GAAU6M,EAAIiC,WAAWU,MAAcK,EAAQE,MAAMC,EAAajI,OAMjE0H,oBAAmB,SAAC3D,OACpCmE,EAAU5D,EAAIP,SACb,CACH4D,OAAQ,IACRC,QAAS,+BAC0B,KAEnCO,YAAa,mBACbvB,KAAMhH,KAAKwI,UAAUF,OAItB5D,+FA+JM,SAACxF,UAAeuH,EAAkB,CAACvH,KAAAA,iIAItC,SAAC0C,UAA2B6E,EAAkB,CAAC7E,QAAAA"}
@@ -3,6 +3,7 @@ import fs from 'fs';
3
3
  import findRoot from 'find-root';
4
4
  import { queries, getDocument } from 'pptr-testing-library';
5
5
  import { configureToMatchImageSnapshot } from 'jest-image-snapshot';
6
+ import globToRegExp from 'glob-to-regexp';
6
7
 
7
8
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
8
9
  try {
@@ -1038,17 +1039,22 @@ var getPageApi = function getPageApi(page) {
1038
1039
  while (1) {
1039
1040
  switch (_context5.prev = _context5.next) {
1040
1041
  case 0:
1041
- _context5.next = 2;
1042
+ if (options != null && options.skipNetworkWait) {
1043
+ _context5.next = 3;
1044
+ break;
1045
+ }
1046
+
1047
+ _context5.next = 3;
1042
1048
  return page.waitForNetworkIdle();
1043
1049
 
1044
- case 2:
1045
- _context5.next = 4;
1050
+ case 3:
1051
+ _context5.next = 5;
1046
1052
  return waitForPaintEnd(page, options);
1047
1053
 
1048
- case 4:
1054
+ case 5:
1049
1055
  return _context5.abrupt("return", page.screenshot(normalizeSreenshotOptions(options)));
1050
1056
 
1051
- case 5:
1057
+ case 6:
1052
1058
  case "end":
1053
1059
  return _context5.stop();
1054
1060
  }
@@ -1104,14 +1110,88 @@ var getPageApi = function getPageApi(page) {
1104
1110
 
1105
1111
  return api;
1106
1112
  };
1113
+ var needsRequestInterception = false;
1114
+ var requestHandlers = [];
1115
+
1116
+ var requestInterceptor = function requestInterceptor(req) {
1117
+ var _requestHandlers$find;
1118
+
1119
+ var _ref11 = (_requestHandlers$find = requestHandlers.find(function (_ref12) {
1120
+ var matcher = _ref12.matcher;
1121
+ return matcher(req);
1122
+ })) != null ? _requestHandlers$find : {
1123
+ handler: null
1124
+ },
1125
+ handler = _ref11.handler;
1126
+
1127
+ if (!handler) {
1128
+ req["continue"]();
1129
+ return;
1130
+ }
1131
+
1132
+ var response = handler(req);
1133
+ req.respond(response);
1134
+ };
1135
+
1136
+ var interceptRequest = function interceptRequest(matcher) {
1137
+ needsRequestInterception = true;
1138
+ var spy = jest.fn();
1139
+ requestHandlers.push({
1140
+ matcher: matcher,
1141
+ handler: spy
1142
+ });
1143
+ return spy;
1144
+ };
1145
+ var createApiEndpointMock = function createApiEndpointMock(_ref13) {
1146
+ var baseUrl = _ref13.baseUrl;
1147
+ interceptRequest(function (req) {
1148
+ return req.method() === 'OPTIONS' && req.url().startsWith(baseUrl);
1149
+ }).mockImplementation(function () {
1150
+ return {
1151
+ status: 204,
1152
+ headers: {
1153
+ 'Access-Control-Allow-Origin': '*',
1154
+ 'Access-Control-Allow-Methods': 'POST,PATCH,PUT,GET,OPTIONS',
1155
+ 'Access-Control-Allow-Headers': 'Content-Type,Authorization'
1156
+ }
1157
+ };
1158
+ });
1159
+ return {
1160
+ spyOn: function spyOn(path, method) {
1161
+ if (method === void 0) {
1162
+ method = 'GET';
1163
+ }
1164
+
1165
+ var matcher = function matcher(req) {
1166
+ var url = req.url();
1167
+ var urlPath = url.substring(baseUrl.length);
1168
+ return req.method() === method && url.startsWith(baseUrl) && !!urlPath.match(globToRegExp(path));
1169
+ };
1170
+
1171
+ var spy = jest.fn();
1172
+ interceptRequest(matcher).mockImplementation(function (req) {
1173
+ var resBody = spy(req);
1174
+ return {
1175
+ status: 200,
1176
+ headers: {
1177
+ 'Access-Control-Allow-Origin': '*'
1178
+ },
1179
+ contentType: 'application/json',
1180
+ body: JSON.stringify(resBody)
1181
+ };
1182
+ });
1183
+ return spy;
1184
+ }
1185
+ };
1186
+ };
1107
1187
  var openPage = /*#__PURE__*/function () {
1108
- var _ref12 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(_ref11) {
1188
+ var _ref15 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(_ref14) {
1109
1189
  var userAgent, isDarkMode, viewport, cookies, urlConfig, url, currentUserAgent, page, connectionError;
1110
1190
  return runtime_1.wrap(function _callee7$(_context7) {
1111
1191
  while (1) {
1112
1192
  switch (_context7.prev = _context7.next) {
1113
1193
  case 0:
1114
- userAgent = _ref11.userAgent, isDarkMode = _ref11.isDarkMode, viewport = _ref11.viewport, cookies = _ref11.cookies, urlConfig = /*#__PURE__*/_objectWithoutPropertiesLoose(_ref11, _excluded2);
1194
+ userAgent = _ref14.userAgent, isDarkMode = _ref14.isDarkMode, viewport = _ref14.viewport, cookies = _ref14.cookies, urlConfig = /*#__PURE__*/_objectWithoutPropertiesLoose(_ref14, _excluded2);
1115
1195
 
1116
1196
  url = function () {
1117
1197
  if (urlConfig.url !== undefined) {
@@ -1195,20 +1275,32 @@ var openPage = /*#__PURE__*/function () {
1195
1275
  });
1196
1276
 
1197
1277
  case 23:
1198
- _context7.prev = 23;
1278
+ if (!needsRequestInterception) {
1279
+ _context7.next = 27;
1280
+ break;
1281
+ }
1282
+
1199
1283
  _context7.next = 26;
1200
- return page["goto"](url);
1284
+ return page.setRequestInterception(true);
1201
1285
 
1202
1286
  case 26:
1203
- _context7.next = 37;
1287
+ page.on('request', requestInterceptor);
1288
+
1289
+ case 27:
1290
+ _context7.prev = 27;
1291
+ _context7.next = 30;
1292
+ return page["goto"](url);
1293
+
1294
+ case 30:
1295
+ _context7.next = 41;
1204
1296
  break;
1205
1297
 
1206
- case 28:
1207
- _context7.prev = 28;
1208
- _context7.t1 = _context7["catch"](23);
1298
+ case 32:
1299
+ _context7.prev = 32;
1300
+ _context7.t1 = _context7["catch"](27);
1209
1301
 
1210
1302
  if (!_context7.t1.message.includes('net::ERR_CONNECTION_REFUSED')) {
1211
- _context7.next = 36;
1303
+ _context7.next = 40;
1212
1304
  break;
1213
1305
  }
1214
1306
 
@@ -1216,33 +1308,33 @@ var openPage = /*#__PURE__*/function () {
1216
1308
  Error.captureStackTrace(connectionError, openPage);
1217
1309
  throw connectionError;
1218
1310
 
1219
- case 36:
1311
+ case 40:
1220
1312
  throw _context7.t1;
1221
1313
 
1222
- case 37:
1223
- _context7.next = 39;
1314
+ case 41:
1315
+ _context7.next = 43;
1224
1316
  return page.waitForFunction('document.fonts.status === "loaded"');
1225
1317
 
1226
- case 39:
1318
+ case 43:
1227
1319
  return _context7.abrupt("return", getPageApi(page));
1228
1320
 
1229
- case 40:
1321
+ case 44:
1230
1322
  case "end":
1231
1323
  return _context7.stop();
1232
1324
  }
1233
1325
  }
1234
- }, _callee7, null, [[23, 28]]);
1326
+ }, _callee7, null, [[27, 32]]);
1235
1327
  }));
1236
1328
 
1237
1329
  return function openPage(_x11) {
1238
- return _ref12.apply(this, arguments);
1330
+ return _ref15.apply(this, arguments);
1239
1331
  };
1240
1332
  }();
1241
1333
 
1242
1334
  var buildQueryMethods = function buildQueryMethods(_temp3) {
1243
- var _ref13 = _temp3 === void 0 ? {} : _temp3,
1244
- page = _ref13.page,
1245
- element = _ref13.element;
1335
+ var _ref16 = _temp3 === void 0 ? {} : _temp3,
1336
+ page = _ref16.page,
1337
+ element = _ref16.element;
1246
1338
 
1247
1339
  var boundQueries = {};
1248
1340
 
@@ -1300,24 +1392,29 @@ var buildQueryMethods = function buildQueryMethods(_temp3) {
1300
1392
  newElementHandle = Object.create(elementHandle);
1301
1393
 
1302
1394
  newElementHandle.screenshot = /*#__PURE__*/function () {
1303
- var _ref15 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(options) {
1395
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(options) {
1304
1396
  return runtime_1.wrap(function _callee8$(_context8) {
1305
1397
  while (1) {
1306
1398
  switch (_context8.prev = _context8.next) {
1307
1399
  case 0:
1308
- _context8.next = 2;
1400
+ if (options != null && options.skipNetworkWait) {
1401
+ _context8.next = 3;
1402
+ break;
1403
+ }
1404
+
1405
+ _context8.next = 3;
1309
1406
  return (page != null ? page : getGlobalPage()).waitForNetworkIdle();
1310
1407
 
1311
- case 2:
1312
- _context8.next = 4;
1408
+ case 3:
1409
+ _context8.next = 5;
1313
1410
  return waitForPaintEnd(elementHandle, _extends({}, options, {
1314
1411
  fullPage: false
1315
1412
  }));
1316
1413
 
1317
- case 4:
1414
+ case 5:
1318
1415
  return _context8.abrupt("return", elementHandle.screenshot(normalizeSreenshotOptions(options)));
1319
1416
 
1320
- case 5:
1417
+ case 6:
1321
1418
  case "end":
1322
1419
  return _context8.stop();
1323
1420
  }
@@ -1326,7 +1423,7 @@ var buildQueryMethods = function buildQueryMethods(_temp3) {
1326
1423
  }));
1327
1424
 
1328
1425
  return function (_x12) {
1329
- return _ref15.apply(this, arguments);
1426
+ return _ref18.apply(this, arguments);
1330
1427
  };
1331
1428
  }();
1332
1429
 
@@ -1365,9 +1462,13 @@ beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
1365
1462
  switch (_context10.prev = _context10.next) {
1366
1463
  case 0:
1367
1464
  _context10.next = 2;
1368
- return global.jestPuppeteer.resetPage();
1465
+ return getGlobalPage().setRequestInterception(false);
1369
1466
 
1370
1467
  case 2:
1468
+ _context10.next = 4;
1469
+ return global.jestPuppeteer.resetPage();
1470
+
1471
+ case 4:
1371
1472
  case "end":
1372
1473
  return _context10.stop();
1373
1474
  }
@@ -1375,29 +1476,35 @@ beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
1375
1476
  }, _callee10);
1376
1477
  })));
1377
1478
  afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
1479
+ var page;
1378
1480
  return runtime_1.wrap(function _callee11$(_context11) {
1379
1481
  while (1) {
1380
1482
  switch (_context11.prev = _context11.next) {
1381
1483
  case 0:
1382
1484
  _context11.prev = 0;
1383
- _context11.next = 3;
1384
- return getGlobalPage()["goto"]('about:blank');
1485
+ page = getGlobalPage();
1486
+ requestHandlers = [];
1487
+ needsRequestInterception = false;
1488
+ page.off('request', requestInterceptor); // clear tab, this way we clear the DOM and stop js execution or pending requests
1385
1489
 
1386
- case 3:
1387
1490
  _context11.next = 7;
1491
+ return page["goto"]('about:blank');
1492
+
1493
+ case 7:
1494
+ _context11.next = 11;
1388
1495
  break;
1389
1496
 
1390
- case 5:
1391
- _context11.prev = 5;
1497
+ case 9:
1498
+ _context11.prev = 9;
1392
1499
  _context11.t0 = _context11["catch"](0);
1393
1500
 
1394
- case 7:
1501
+ case 11:
1395
1502
  case "end":
1396
1503
  return _context11.stop();
1397
1504
  }
1398
1505
  }
1399
- }, _callee11, null, [[0, 5]]);
1506
+ }, _callee11, null, [[0, 9]]);
1400
1507
  })));
1401
1508
 
1402
- export { getGlobalBrowser, getGlobalPage, getPageApi, getScreen, openPage, screen, serverHostName, serverPort, within };
1509
+ export { createApiEndpointMock, getGlobalBrowser, getGlobalPage, getPageApi, getScreen, interceptRequest, openPage, screen, serverHostName, serverPort, within };
1403
1510
  //# sourceMappingURL=acceptance-testing.esm.js.map