@telefonica/acceptance-testing 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/acceptance-testing.cjs.development.js +164 -36
- package/dist/acceptance-testing.cjs.development.js.map +1 -1
- package/dist/acceptance-testing.cjs.production.min.js +1 -1
- package/dist/acceptance-testing.cjs.production.min.js.map +1 -1
- package/dist/acceptance-testing.esm.js +164 -37
- package/dist/acceptance-testing.esm.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/package.json +1 -1
|
@@ -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';\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,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,MA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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"}
|
|
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';\nconst execSync = require('child_process').execSync;\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\n// Puppeteer already calls scrollIntoViewIfNeeded before clicking an element. But it doesn't work in all situations\n// For example, when there is a fixed footer in the page and the element to click is under it, the browser won't scroll\n// because the element is already in the viewport (the ifNeeded part is important here). By forcing the scroll to the\n// center, we manage to fix these edge cases.\nconst scrollIntoView = (el: ElementHandle) => el.evaluate((e) => e.scrollIntoView({block: 'center'}));\n\nexport const getPageApi = (page: Page): PageApi => {\n const api: PageApi = Object.create(page);\n\n api.type = async (elementHandle, text, options) => {\n await scrollIntoView(elementHandle);\n return elementHandle.type(text, options);\n };\n api.click = async (elementHandle, options) => {\n await scrollIntoView(elementHandle);\n return elementHandle.click(options);\n };\n api.select = async (elementHandle, ...values) => {\n await scrollIntoView(elementHandle);\n return elementHandle.select(...values);\n };\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: 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 newElementHandle.click = async (options?: ClickOptions) => {\n await scrollIntoView(elementHandle);\n return elementHandle.click(options);\n };\n\n newElementHandle.type = async (text: string, options?: {delay: number}) => {\n await scrollIntoView(elementHandle);\n return elementHandle.type(text, options);\n };\n\n newElementHandle.select = async (...values: Array<string>) => {\n await scrollIntoView(elementHandle);\n return elementHandle.select(...values);\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\n/**\n * Returns a new path to the file that can be used by chromium in acceptance tests\n *\n * To be able to use `element.uploadFile()` in a dockerized chromium, the file must exist in the\n * host and the docker, and both sides must use the same path.\n *\n * To workaround this bug or limitation, this function prepares the file by copying it to /tmp in\n * the host and the container.\n */\nexport const prepareFile = (filepath: string): string => {\n const isLocal = !isCi;\n const isHeadless = !!process.env.HEADLESS;\n const usesDocker = isLocal && isHeadless;\n\n const dockerComposeFile = path.join(__dirname, '..', 'docker-compose.yaml');\n\n if (usesDocker) {\n const containerId = execSync(`docker-compose -f ${dockerComposeFile} ps -q`).toString().trim();\n\n if (!containerId) {\n throw Error('acceptance-testing container not found');\n }\n\n execSync(`docker cp ${filepath} ${containerId}:/tmp`);\n\n const newPath = path.join('/tmp', path.basename(filepath));\n\n fs.copyFileSync(filepath, newPath);\n\n return newPath;\n } else {\n return filepath;\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","execSync","require","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","scrollIntoView","el","evaluate","e","block","getPageApi","api","elementHandle","text","options","click","select","skipNetworkWait","waitForNetworkIdle","clear","clickCount","press","setGeolocation","position","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","filepath","isHeadless","HEADLESS","usesDocker","dockerComposeFile","__dirname","containerId","toString","trim","newPath","basename","copyFileSync"],"mappings":"2hCAOIA,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,MAAQ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EAAMf,EAAIe,MACVgD,EAAUhD,EAAIiD,UAAUN,EAAQhM,eAElCsI,EAAIpM,WAAaA,GAAUmN,EAAIiC,WAAWU,MAAcK,EAAQE,MAAMC,EAAarI,OAMjE8H,oBAAmB,SAAC3D,OACpCmE,EAAU5D,EAAIP,SACb,CACH4D,OAAQ,IACRC,QAAS,+BAC0B,KAEnCO,YAAa,mBACbvB,KAAMpH,KAAK4I,UAAUF,OAItB5D,+FA8KM,SAAC5F,UAAe2H,EAAkB,CAAC3H,KAAAA,uEAqCjC,SAAC2J,OAElBC,IAAe1J,QAAQG,IAAIwJ,SAC3BC,GAFW7J,GAEa2J,EAExBG,EAAoB7I,EAAKC,KAAK6I,UAAW,KAAM,0BAEjDF,EAAY,KACNG,EAAcvK,uBAA8BqK,YAA2BG,WAAWC,WAEnFF,QACK9Q,MAAM,0CAGhBuG,eAAsBiK,MAAYM,eAE5BG,EAAUlJ,EAAKC,KAAK,OAAQD,EAAKmJ,SAASV,WAEhD3I,EAAGsJ,aAAaX,EAAUS,GAEnBA,SAEAT,iFAvDO,SAACjH,UAA2BiF,EAAkB,CAACjF,QAAAA"}
|
|
@@ -807,6 +807,9 @@ var _excluded = ["captureBeyondViewport"],
|
|
|
807
807
|
_excluded2 = ["userAgent", "isDarkMode", "viewport", "cookies"];
|
|
808
808
|
|
|
809
809
|
var _pkg$acceptanceTests, _ref;
|
|
810
|
+
|
|
811
|
+
var execSync = /*#__PURE__*/require('child_process').execSync;
|
|
812
|
+
|
|
810
813
|
var getGlobalBrowser = function getGlobalBrowser() {
|
|
811
814
|
return global.browser;
|
|
812
815
|
};
|
|
@@ -956,6 +959,18 @@ var normalizeSreenshotOptions = function normalizeSreenshotOptions(_temp2) {
|
|
|
956
959
|
return _extends({}, options, {
|
|
957
960
|
captureBeyondViewport: captureBeyondViewport
|
|
958
961
|
});
|
|
962
|
+
}; // Puppeteer already calls scrollIntoViewIfNeeded before clicking an element. But it doesn't work in all situations
|
|
963
|
+
// For example, when there is a fixed footer in the page and the element to click is under it, the browser won't scroll
|
|
964
|
+
// because the element is already in the viewport (the ifNeeded part is important here). By forcing the scroll to the
|
|
965
|
+
// center, we manage to fix these edge cases.
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
var scrollIntoView = function scrollIntoView(el) {
|
|
969
|
+
return el.evaluate(function (e) {
|
|
970
|
+
return e.scrollIntoView({
|
|
971
|
+
block: 'center'
|
|
972
|
+
});
|
|
973
|
+
});
|
|
959
974
|
};
|
|
960
975
|
|
|
961
976
|
var getPageApi = function getPageApi(page) {
|
|
@@ -967,9 +982,13 @@ var getPageApi = function getPageApi(page) {
|
|
|
967
982
|
while (1) {
|
|
968
983
|
switch (_context2.prev = _context2.next) {
|
|
969
984
|
case 0:
|
|
985
|
+
_context2.next = 2;
|
|
986
|
+
return scrollIntoView(elementHandle);
|
|
987
|
+
|
|
988
|
+
case 2:
|
|
970
989
|
return _context2.abrupt("return", elementHandle.type(text, options));
|
|
971
990
|
|
|
972
|
-
case
|
|
991
|
+
case 3:
|
|
973
992
|
case "end":
|
|
974
993
|
return _context2.stop();
|
|
975
994
|
}
|
|
@@ -988,9 +1007,13 @@ var getPageApi = function getPageApi(page) {
|
|
|
988
1007
|
while (1) {
|
|
989
1008
|
switch (_context3.prev = _context3.next) {
|
|
990
1009
|
case 0:
|
|
1010
|
+
_context3.next = 2;
|
|
1011
|
+
return scrollIntoView(elementHandle);
|
|
1012
|
+
|
|
1013
|
+
case 2:
|
|
991
1014
|
return _context3.abrupt("return", elementHandle.click(options));
|
|
992
1015
|
|
|
993
|
-
case
|
|
1016
|
+
case 3:
|
|
994
1017
|
case "end":
|
|
995
1018
|
return _context3.stop();
|
|
996
1019
|
}
|
|
@@ -1014,13 +1037,17 @@ var getPageApi = function getPageApi(page) {
|
|
|
1014
1037
|
while (1) {
|
|
1015
1038
|
switch (_context4.prev = _context4.next) {
|
|
1016
1039
|
case 0:
|
|
1040
|
+
_context4.next = 2;
|
|
1041
|
+
return scrollIntoView(elementHandle);
|
|
1042
|
+
|
|
1043
|
+
case 2:
|
|
1017
1044
|
for (_len = _args4.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1018
1045
|
values[_key - 1] = _args4[_key];
|
|
1019
1046
|
}
|
|
1020
1047
|
|
|
1021
1048
|
return _context4.abrupt("return", elementHandle.select.apply(elementHandle, values));
|
|
1022
1049
|
|
|
1023
|
-
case
|
|
1050
|
+
case 4:
|
|
1024
1051
|
case "end":
|
|
1025
1052
|
return _context4.stop();
|
|
1026
1053
|
}
|
|
@@ -1342,7 +1369,7 @@ var buildQueryMethods = function buildQueryMethods(_temp3) {
|
|
|
1342
1369
|
var _Object$entries$_i = _Object$entries[_i],
|
|
1343
1370
|
queryName = _Object$entries$_i[0],
|
|
1344
1371
|
queryFn = _Object$entries$_i[1];
|
|
1345
|
-
boundQueries[queryName] = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
1372
|
+
boundQueries[queryName] = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12() {
|
|
1346
1373
|
var doc,
|
|
1347
1374
|
body,
|
|
1348
1375
|
_len2,
|
|
@@ -1351,25 +1378,25 @@ var buildQueryMethods = function buildQueryMethods(_temp3) {
|
|
|
1351
1378
|
queryArgs,
|
|
1352
1379
|
elementHandle,
|
|
1353
1380
|
newElementHandle,
|
|
1354
|
-
|
|
1381
|
+
_args12 = arguments;
|
|
1355
1382
|
|
|
1356
|
-
return runtime_1.wrap(function
|
|
1383
|
+
return runtime_1.wrap(function _callee12$(_context12) {
|
|
1357
1384
|
while (1) {
|
|
1358
|
-
switch (
|
|
1385
|
+
switch (_context12.prev = _context12.next) {
|
|
1359
1386
|
case 0:
|
|
1360
|
-
|
|
1387
|
+
_context12.next = 2;
|
|
1361
1388
|
return getDocument(page != null ? page : getGlobalPage());
|
|
1362
1389
|
|
|
1363
1390
|
case 2:
|
|
1364
|
-
doc =
|
|
1365
|
-
|
|
1391
|
+
doc = _context12.sent;
|
|
1392
|
+
_context12.next = 5;
|
|
1366
1393
|
return doc.$('body');
|
|
1367
1394
|
|
|
1368
1395
|
case 5:
|
|
1369
|
-
body =
|
|
1396
|
+
body = _context12.sent;
|
|
1370
1397
|
|
|
1371
|
-
for (_len2 =
|
|
1372
|
-
args[_key2] =
|
|
1398
|
+
for (_len2 = _args12.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1399
|
+
args[_key2] = _args12[_key2];
|
|
1373
1400
|
}
|
|
1374
1401
|
|
|
1375
1402
|
queryArgs = [].concat(args);
|
|
@@ -1384,11 +1411,11 @@ var buildQueryMethods = function buildQueryMethods(_temp3) {
|
|
|
1384
1411
|
});
|
|
1385
1412
|
}
|
|
1386
1413
|
|
|
1387
|
-
|
|
1414
|
+
_context12.next = 11;
|
|
1388
1415
|
return queryFn.apply(void 0, [element != null ? element : body].concat(queryArgs));
|
|
1389
1416
|
|
|
1390
1417
|
case 11:
|
|
1391
|
-
elementHandle =
|
|
1418
|
+
elementHandle = _context12.sent;
|
|
1392
1419
|
newElementHandle = Object.create(elementHandle);
|
|
1393
1420
|
|
|
1394
1421
|
newElementHandle.screenshot = /*#__PURE__*/function () {
|
|
@@ -1427,14 +1454,83 @@ var buildQueryMethods = function buildQueryMethods(_temp3) {
|
|
|
1427
1454
|
};
|
|
1428
1455
|
}();
|
|
1429
1456
|
|
|
1430
|
-
|
|
1457
|
+
newElementHandle.click = /*#__PURE__*/function () {
|
|
1458
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(options) {
|
|
1459
|
+
return runtime_1.wrap(function _callee9$(_context9) {
|
|
1460
|
+
while (1) {
|
|
1461
|
+
switch (_context9.prev = _context9.next) {
|
|
1462
|
+
case 0:
|
|
1463
|
+
_context9.next = 2;
|
|
1464
|
+
return scrollIntoView(elementHandle);
|
|
1465
|
+
|
|
1466
|
+
case 2:
|
|
1467
|
+
return _context9.abrupt("return", elementHandle.click(options));
|
|
1468
|
+
|
|
1469
|
+
case 3:
|
|
1470
|
+
case "end":
|
|
1471
|
+
return _context9.stop();
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
}, _callee9);
|
|
1475
|
+
}));
|
|
1476
|
+
|
|
1477
|
+
return function (_x13) {
|
|
1478
|
+
return _ref19.apply(this, arguments);
|
|
1479
|
+
};
|
|
1480
|
+
}();
|
|
1481
|
+
|
|
1482
|
+
newElementHandle.type = /*#__PURE__*/function () {
|
|
1483
|
+
var _ref20 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(text, options) {
|
|
1484
|
+
return runtime_1.wrap(function _callee10$(_context10) {
|
|
1485
|
+
while (1) {
|
|
1486
|
+
switch (_context10.prev = _context10.next) {
|
|
1487
|
+
case 0:
|
|
1488
|
+
_context10.next = 2;
|
|
1489
|
+
return scrollIntoView(elementHandle);
|
|
1490
|
+
|
|
1491
|
+
case 2:
|
|
1492
|
+
return _context10.abrupt("return", elementHandle.type(text, options));
|
|
1493
|
+
|
|
1494
|
+
case 3:
|
|
1495
|
+
case "end":
|
|
1496
|
+
return _context10.stop();
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
}, _callee10);
|
|
1500
|
+
}));
|
|
1501
|
+
|
|
1502
|
+
return function (_x14, _x15) {
|
|
1503
|
+
return _ref20.apply(this, arguments);
|
|
1504
|
+
};
|
|
1505
|
+
}();
|
|
1506
|
+
|
|
1507
|
+
newElementHandle.select = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
|
|
1508
|
+
var _args11 = arguments;
|
|
1509
|
+
return runtime_1.wrap(function _callee11$(_context11) {
|
|
1510
|
+
while (1) {
|
|
1511
|
+
switch (_context11.prev = _context11.next) {
|
|
1512
|
+
case 0:
|
|
1513
|
+
_context11.next = 2;
|
|
1514
|
+
return scrollIntoView(elementHandle);
|
|
1515
|
+
|
|
1516
|
+
case 2:
|
|
1517
|
+
return _context11.abrupt("return", elementHandle.select.apply(elementHandle, _args11));
|
|
1518
|
+
|
|
1519
|
+
case 3:
|
|
1520
|
+
case "end":
|
|
1521
|
+
return _context11.stop();
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
}, _callee11);
|
|
1525
|
+
}));
|
|
1526
|
+
return _context12.abrupt("return", newElementHandle);
|
|
1431
1527
|
|
|
1432
|
-
case
|
|
1528
|
+
case 18:
|
|
1433
1529
|
case "end":
|
|
1434
|
-
return
|
|
1530
|
+
return _context12.stop();
|
|
1435
1531
|
}
|
|
1436
1532
|
}
|
|
1437
|
-
},
|
|
1533
|
+
}, _callee12);
|
|
1438
1534
|
}));
|
|
1439
1535
|
};
|
|
1440
1536
|
|
|
@@ -1456,55 +1552,86 @@ var within = function within(element) {
|
|
|
1456
1552
|
element: element
|
|
1457
1553
|
});
|
|
1458
1554
|
};
|
|
1459
|
-
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
1460
|
-
return runtime_1.wrap(function
|
|
1555
|
+
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13() {
|
|
1556
|
+
return runtime_1.wrap(function _callee13$(_context13) {
|
|
1461
1557
|
while (1) {
|
|
1462
|
-
switch (
|
|
1558
|
+
switch (_context13.prev = _context13.next) {
|
|
1463
1559
|
case 0:
|
|
1464
|
-
|
|
1560
|
+
_context13.next = 2;
|
|
1465
1561
|
return getGlobalPage().setRequestInterception(false);
|
|
1466
1562
|
|
|
1467
1563
|
case 2:
|
|
1468
|
-
|
|
1564
|
+
_context13.next = 4;
|
|
1469
1565
|
return global.jestPuppeteer.resetPage();
|
|
1470
1566
|
|
|
1471
1567
|
case 4:
|
|
1472
1568
|
case "end":
|
|
1473
|
-
return
|
|
1569
|
+
return _context13.stop();
|
|
1474
1570
|
}
|
|
1475
1571
|
}
|
|
1476
|
-
},
|
|
1572
|
+
}, _callee13);
|
|
1477
1573
|
})));
|
|
1478
|
-
afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
1574
|
+
afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14() {
|
|
1479
1575
|
var page;
|
|
1480
|
-
return runtime_1.wrap(function
|
|
1576
|
+
return runtime_1.wrap(function _callee14$(_context14) {
|
|
1481
1577
|
while (1) {
|
|
1482
|
-
switch (
|
|
1578
|
+
switch (_context14.prev = _context14.next) {
|
|
1483
1579
|
case 0:
|
|
1484
|
-
|
|
1580
|
+
_context14.prev = 0;
|
|
1485
1581
|
page = getGlobalPage();
|
|
1486
1582
|
requestHandlers = [];
|
|
1487
1583
|
needsRequestInterception = false;
|
|
1488
1584
|
page.off('request', requestInterceptor); // clear tab, this way we clear the DOM and stop js execution or pending requests
|
|
1489
1585
|
|
|
1490
|
-
|
|
1586
|
+
_context14.next = 7;
|
|
1491
1587
|
return page["goto"]('about:blank');
|
|
1492
1588
|
|
|
1493
1589
|
case 7:
|
|
1494
|
-
|
|
1590
|
+
_context14.next = 11;
|
|
1495
1591
|
break;
|
|
1496
1592
|
|
|
1497
1593
|
case 9:
|
|
1498
|
-
|
|
1499
|
-
|
|
1594
|
+
_context14.prev = 9;
|
|
1595
|
+
_context14.t0 = _context14["catch"](0);
|
|
1500
1596
|
|
|
1501
1597
|
case 11:
|
|
1502
1598
|
case "end":
|
|
1503
|
-
return
|
|
1599
|
+
return _context14.stop();
|
|
1504
1600
|
}
|
|
1505
1601
|
}
|
|
1506
|
-
},
|
|
1602
|
+
}, _callee14, null, [[0, 9]]);
|
|
1507
1603
|
})));
|
|
1604
|
+
/**
|
|
1605
|
+
* Returns a new path to the file that can be used by chromium in acceptance tests
|
|
1606
|
+
*
|
|
1607
|
+
* To be able to use `element.uploadFile()` in a dockerized chromium, the file must exist in the
|
|
1608
|
+
* host and the docker, and both sides must use the same path.
|
|
1609
|
+
*
|
|
1610
|
+
* To workaround this bug or limitation, this function prepares the file by copying it to /tmp in
|
|
1611
|
+
* the host and the container.
|
|
1612
|
+
*/
|
|
1613
|
+
|
|
1614
|
+
var prepareFile = function prepareFile(filepath) {
|
|
1615
|
+
var isLocal = !isCi;
|
|
1616
|
+
var isHeadless = !!process.env.HEADLESS;
|
|
1617
|
+
var usesDocker = isLocal && isHeadless;
|
|
1618
|
+
var dockerComposeFile = path.join(__dirname, '..', 'docker-compose.yaml');
|
|
1619
|
+
|
|
1620
|
+
if (usesDocker) {
|
|
1621
|
+
var containerId = execSync("docker-compose -f " + dockerComposeFile + " ps -q").toString().trim();
|
|
1622
|
+
|
|
1623
|
+
if (!containerId) {
|
|
1624
|
+
throw Error('acceptance-testing container not found');
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
execSync("docker cp " + filepath + " " + containerId + ":/tmp");
|
|
1628
|
+
var newPath = path.join('/tmp', path.basename(filepath));
|
|
1629
|
+
fs.copyFileSync(filepath, newPath);
|
|
1630
|
+
return newPath;
|
|
1631
|
+
} else {
|
|
1632
|
+
return filepath;
|
|
1633
|
+
}
|
|
1634
|
+
};
|
|
1508
1635
|
|
|
1509
|
-
export { createApiEndpointMock, getGlobalBrowser, getGlobalPage, getPageApi, getScreen, interceptRequest, openPage, screen, serverHostName, serverPort, within };
|
|
1636
|
+
export { createApiEndpointMock, getGlobalBrowser, getGlobalPage, getPageApi, getScreen, interceptRequest, openPage, prepareFile, screen, serverHostName, serverPort, within };
|
|
1510
1637
|
//# sourceMappingURL=acceptance-testing.esm.js.map
|