@telefonica/acceptance-testing 2.6.1 → 2.9.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 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?: Page): ReturnType<typeof getQueriesForElement> => {\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(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 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","_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,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,yBAEtCC,EAAOC,EAAKC,EAAKC,UACxBf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,OAIXF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,UACnBF,EAAIC,GAAOC,YAIbM,EAAKC,EAASC,EAASC,EAAMC,OAGhCC,EAAY1B,OAAO2B,QADFJ,GAAWA,EAAQtB,qBAAqB2B,EAAYL,EAAUK,GACtC3B,WACzC4B,EAAU,IAAIC,EAAQL,GAAe,WAIzCC,EAAUK,iBA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AAOW,yFAC1B7D,EAAAA,EAAQD,KAAiBiE,4CAC1BvB,EAAgBkB,OAAmBE,GAASlB,UAAU,qCACrDgB,EAAcT,WAAWC,EAA0BU,wHAGvD+C,sDArBoB1P,OAAO2P,QAAQC,qCAwB3Cb,GAKEc,EAASf,IAItBgB,qBAAW,4FAEAnH,OAAeoH,cAAcC,wDAGxC5E,oBAAU,qGAGIvC,SAAqB,wNAdV,SAACC,UAAegG,EAAkBhG"}
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\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}\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\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: 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 // 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","skipNetworkWait","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,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,yBAEtCC,EAAOC,EAAKC,EAAKC,UACxBf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,OAIXF,EAAO,GAAI,IACX,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,UACnBF,EAAIC,GAAOC,YAIbM,EAAKC,EAASC,EAASC,EAAMC,OAGhCC,EAAY1B,OAAO2B,QADFJ,GAAWA,EAAQtB,qBAAqB2B,EAAYL,EAAUK,GACtC3B,WACzC4B,EAAU,IAAIC,EAAQL,GAAe,WAIzCC,EAAUK,iBAuMcT,EAASE,EAAMK,OACnCG,EAhLuB,wBAkLpB,SAAgBC,EAAQC,MAhLT,cAiLhBF,QACI,IAAIG,MAAM,mCAjLE,cAoLhBH,EAA6B,IAChB,UAAXC,QACIC,QAyQL,CAAEnB,WA1fPqB,EA0fyBC,MAAM,OAjQ/BR,EAAQI,OAASA,EACjBJ,EAAQK,IAAMA,IAED,KACPI,EAAWT,EAAQS,YACnBA,EAAU,KACRC,EAAiBC,EAAoBF,EAAUT,MAC/CU,EAAgB,IACdA,IAAmBE,EAAkB,gBAClCF,MAIY,SAAnBV,EAAQI,OAGVJ,EAAQa,KAAOb,EAAQc,MAAQd,EAAQK,SAElC,GAAuB,UAAnBL,EAAQI,OAAoB,IAnNhB,mBAoNjBD,QACFA,EAlNc,YAmNRH,EAAQK,IAGhB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SAACC,UAAeyG,EAAkB,CAACzG,KAAAA,sGAItC,SAAC0C,UAA2B+D,EAAkB,CAAC/D,QAAAA"}
@@ -1038,17 +1038,22 @@ var getPageApi = function getPageApi(page) {
1038
1038
  while (1) {
1039
1039
  switch (_context5.prev = _context5.next) {
1040
1040
  case 0:
1041
- _context5.next = 2;
1041
+ if (options != null && options.skipNetworkWait) {
1042
+ _context5.next = 3;
1043
+ break;
1044
+ }
1045
+
1046
+ _context5.next = 3;
1042
1047
  return page.waitForNetworkIdle();
1043
1048
 
1044
- case 2:
1045
- _context5.next = 4;
1049
+ case 3:
1050
+ _context5.next = 5;
1046
1051
  return waitForPaintEnd(page, options);
1047
1052
 
1048
- case 4:
1053
+ case 5:
1049
1054
  return _context5.abrupt("return", page.screenshot(normalizeSreenshotOptions(options)));
1050
1055
 
1051
- case 5:
1056
+ case 6:
1052
1057
  case "end":
1053
1058
  return _context5.stop();
1054
1059
  }
@@ -1185,20 +1190,30 @@ var openPage = /*#__PURE__*/function () {
1185
1190
  }]);
1186
1191
 
1187
1192
  case 21:
1188
- _context7.prev = 21;
1189
- _context7.next = 24;
1193
+ _context7.next = 23;
1194
+ return page.evaluateOnNewDocument(function () {
1195
+ var style = document.createElement('style');
1196
+ 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 ";
1197
+ window.addEventListener('DOMContentLoaded', function () {
1198
+ document.head.appendChild(style);
1199
+ });
1200
+ });
1201
+
1202
+ case 23:
1203
+ _context7.prev = 23;
1204
+ _context7.next = 26;
1190
1205
  return page["goto"](url);
1191
1206
 
1192
- case 24:
1193
- _context7.next = 35;
1207
+ case 26:
1208
+ _context7.next = 37;
1194
1209
  break;
1195
1210
 
1196
- case 26:
1197
- _context7.prev = 26;
1198
- _context7.t1 = _context7["catch"](21);
1211
+ case 28:
1212
+ _context7.prev = 28;
1213
+ _context7.t1 = _context7["catch"](23);
1199
1214
 
1200
1215
  if (!_context7.t1.message.includes('net::ERR_CONNECTION_REFUSED')) {
1201
- _context7.next = 34;
1216
+ _context7.next = 36;
1202
1217
  break;
1203
1218
  }
1204
1219
 
@@ -1206,22 +1221,22 @@ var openPage = /*#__PURE__*/function () {
1206
1221
  Error.captureStackTrace(connectionError, openPage);
1207
1222
  throw connectionError;
1208
1223
 
1209
- case 34:
1224
+ case 36:
1210
1225
  throw _context7.t1;
1211
1226
 
1212
- case 35:
1213
- _context7.next = 37;
1227
+ case 37:
1228
+ _context7.next = 39;
1214
1229
  return page.waitForFunction('document.fonts.status === "loaded"');
1215
1230
 
1216
- case 37:
1231
+ case 39:
1217
1232
  return _context7.abrupt("return", getPageApi(page));
1218
1233
 
1219
- case 38:
1234
+ case 40:
1220
1235
  case "end":
1221
1236
  return _context7.stop();
1222
1237
  }
1223
1238
  }
1224
- }, _callee7, null, [[21, 26]]);
1239
+ }, _callee7, null, [[23, 28]]);
1225
1240
  }));
1226
1241
 
1227
1242
  return function openPage(_x11) {
@@ -1229,7 +1244,11 @@ var openPage = /*#__PURE__*/function () {
1229
1244
  };
1230
1245
  }();
1231
1246
 
1232
- var buildQueryMethods = function buildQueryMethods(page) {
1247
+ var buildQueryMethods = function buildQueryMethods(_temp3) {
1248
+ var _ref13 = _temp3 === void 0 ? {} : _temp3,
1249
+ page = _ref13.page,
1250
+ element = _ref13.element;
1251
+
1233
1252
  var boundQueries = {};
1234
1253
 
1235
1254
  var _loop = function _loop() {
@@ -1279,31 +1298,36 @@ var buildQueryMethods = function buildQueryMethods(page) {
1279
1298
  }
1280
1299
 
1281
1300
  _context9.next = 11;
1282
- return queryFn.apply(void 0, [body].concat(queryArgs));
1301
+ return queryFn.apply(void 0, [element != null ? element : body].concat(queryArgs));
1283
1302
 
1284
1303
  case 11:
1285
1304
  elementHandle = _context9.sent;
1286
1305
  newElementHandle = Object.create(elementHandle);
1287
1306
 
1288
1307
  newElementHandle.screenshot = /*#__PURE__*/function () {
1289
- var _ref14 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(options) {
1308
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(options) {
1290
1309
  return runtime_1.wrap(function _callee8$(_context8) {
1291
1310
  while (1) {
1292
1311
  switch (_context8.prev = _context8.next) {
1293
1312
  case 0:
1294
- _context8.next = 2;
1313
+ if (options != null && options.skipNetworkWait) {
1314
+ _context8.next = 3;
1315
+ break;
1316
+ }
1317
+
1318
+ _context8.next = 3;
1295
1319
  return (page != null ? page : getGlobalPage()).waitForNetworkIdle();
1296
1320
 
1297
- case 2:
1298
- _context8.next = 4;
1321
+ case 3:
1322
+ _context8.next = 5;
1299
1323
  return waitForPaintEnd(elementHandle, _extends({}, options, {
1300
1324
  fullPage: false
1301
1325
  }));
1302
1326
 
1303
- case 4:
1327
+ case 5:
1304
1328
  return _context8.abrupt("return", elementHandle.screenshot(normalizeSreenshotOptions(options)));
1305
1329
 
1306
- case 5:
1330
+ case 6:
1307
1331
  case "end":
1308
1332
  return _context8.stop();
1309
1333
  }
@@ -1312,7 +1336,7 @@ var buildQueryMethods = function buildQueryMethods(page) {
1312
1336
  }));
1313
1337
 
1314
1338
  return function (_x12) {
1315
- return _ref14.apply(this, arguments);
1339
+ return _ref15.apply(this, arguments);
1316
1340
  };
1317
1341
  }();
1318
1342
 
@@ -1335,9 +1359,16 @@ var buildQueryMethods = function buildQueryMethods(page) {
1335
1359
  };
1336
1360
 
1337
1361
  var getScreen = function getScreen(page) {
1338
- return buildQueryMethods(page);
1362
+ return buildQueryMethods({
1363
+ page: page
1364
+ });
1339
1365
  };
1340
1366
  var screen = /*#__PURE__*/buildQueryMethods();
1367
+ var within = function within(element) {
1368
+ return buildQueryMethods({
1369
+ element: element
1370
+ });
1371
+ };
1341
1372
  beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10() {
1342
1373
  return runtime_1.wrap(function _callee10$(_context10) {
1343
1374
  while (1) {
@@ -1378,5 +1409,5 @@ afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
1378
1409
  }, _callee11, null, [[0, 5]]);
1379
1410
  })));
1380
1411
 
1381
- export { getGlobalBrowser, getGlobalPage, getPageApi, getScreen, openPage, screen, serverHostName, serverPort };
1412
+ export { getGlobalBrowser, getGlobalPage, getPageApi, getScreen, openPage, screen, serverHostName, serverPort, within };
1382
1413
  //# sourceMappingURL=acceptance-testing.esm.js.map