@telefonica/acceptance-testing 2.23.1 → 3.0.0-beta0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"acceptance-testing.cjs.production.min.js","sources":["../src/coverage.ts","../src/index.ts","../src/utils.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs';\n\nimport type {Page} from 'puppeteer';\n\nconst getGlobalPage = (): Page => (global as any).page;\n\nexport const getRootPath = () => {\n const rootPath = expect.getState().snapshotState._rootDir;\n if (!rootPath) {\n throw new Error('Root path not found');\n }\n return rootPath;\n};\n\n/**\n * We want to clear coverage files from previous runs, but at this point it is not easy because each\n * worker runs a different instance of this script, so we can't just clear the coverage folder at\n * the beginning of the test run.\n *\n * The solution is to remove the coverage folder when the stored ppid (parent process id) is\n * different from the current one\n */\nconst prepareCoverageReportPath = ({coveragePath}: {coveragePath: string}) => {\n const ppidFile = path.join(coveragePath, '.ppid');\n const ppid = process.ppid.toString();\n if (!fs.existsSync(ppidFile) || fs.readFileSync(ppidFile, 'utf-8') !== ppid) {\n // the condition is just to make sure we don't remove files outside the repo\n if (getRootPath() === process.cwd() && path.normalize(coveragePath).startsWith(process.cwd())) {\n fs.rmSync(coveragePath, {recursive: true, force: true});\n }\n fs.mkdirSync(coveragePath, {recursive: true});\n fs.writeFileSync(ppidFile, ppid);\n }\n};\n\n/**\n * Asumes the code was instrumented with istanbul and the coverage report stored in `window.__coverage__`.\n * If not, this function does nothing.\n */\nexport const collectCoverageIfAvailable = async ({coveragePath}: {coveragePath: string}): Promise<void> => {\n const coverage = await getGlobalPage().evaluate(() => {\n return (window as any).__coverage__;\n });\n if (!coverage) {\n return;\n }\n\n prepareCoverageReportPath({coveragePath});\n const nycOutputPath = path.join(coveragePath, '.nyc_output');\n fs.mkdirSync(nycOutputPath, {recursive: true});\n\n Object.values(coverage).forEach((cov: any) => {\n if (cov && cov.path && cov.hash) {\n fs.writeFileSync(path.join(nycOutputPath, cov.hash + '.json'), JSON.stringify({[cov.path]: cov}));\n }\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';\nimport {execSync} from 'child_process';\nimport {collectCoverageIfAvailable} from './coverage';\nimport {matchPath} from './utils';\n\nimport type {getQueriesForElement} from 'pptr-testing-library';\nimport type {\n Browser,\n ClickOptions,\n ElementHandle,\n GeolocationOptions,\n HTTPRequest,\n Page,\n ResponseForRequest,\n ScreenshotOptions,\n Viewport,\n} from 'puppeteer';\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\n/** Check if running inside WSL */\nconst isWsl = () => {\n if (process.platform !== 'linux') {\n return false;\n }\n try {\n return execSync('which wsl.exe').toString().startsWith('/mnt/');\n } catch (e) {\n // catched because it throws an error if wsl.exe is not found\n return false;\n }\n};\n\n/** Assumes running inside WSL */\nconst isWsl2 = () => {\n // `wsl.exe -l -v` returns something like:\n //\n // NAME STATE VERSION\n // * Ubuntu-22.04 Running 2\n // docker-desktop-data Running 2\n // docker-desktop Running 2\n // Ubuntu-20.04 Stopped 2\n return (\n execSync('wsl.exe -l -v')\n .toString()\n // null-bytes are inserted between chars in this command output (UTF-16 output?)\n .replace(/\\0/g, '')\n .split('\\n')\n .map((line) => line.trim())\n // matches a line like: \"* Ubuntu-22.04 Running 2\"\n .some((line) => !!line.match(/\\*\\s+\\S+\\s+Running\\s+2/))\n );\n};\n\n/** Assumes running inside WSL */\nconst getWslHostIp = () => execSync('wsl.exe hostname -I').toString().trim();\n\nexport const serverHostName = ((): string => {\n if (isCi) {\n return 'localhost';\n }\n\n if (isUsingDockerizedChromium) {\n if (isWsl()) {\n if (isWsl2()) {\n return getWslHostIp();\n }\n throw new Error('WSL 1 is not supported. Please, use WSL 2.');\n }\n\n if (process.platform === 'win32') {\n throw new Error('Windows is not supported. Please, use WSL 2.');\n }\n\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;\nconst coveragePath = path.join(rootDir, projectConfig.coveragePath ?? 'reports/coverage-acceptance');\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-expect-error - puppeteer's setGeoLocation does not expect a timestamp to be passed\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 = ({\n /** defaults to any origin */\n origin,\n baseUrl,\n}: {\n origin?: string;\n /** @deprecated use origin */\n baseUrl?: string;\n} = {}): ApiEndpointMock => {\n const originRegExp = globToRegExp(origin ?? baseUrl ?? '*');\n\n interceptRequest((req) => {\n const {origin} = new URL(req.url());\n return req.method() === 'OPTIONS' && !!origin.match(originRegExp);\n }).mockImplementation(() => ({\n status: 204,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'POST,PATCH,PUT,GET,OPTIONS,DELETE',\n 'Access-Control-Allow-Headers': '*',\n },\n }));\n\n return {\n spyOn(spiedPath: string, method: string = 'GET') {\n const matcher = (req: HTTPRequest) => {\n const {origin, pathname, search} = new URL(req.url());\n const pathWithParams = pathname + search;\n\n return (\n req.method() === method &&\n !!origin.match(originRegExp) &&\n matchPath(spiedPath, pathWithParams)\n );\n };\n\n const spy = jest.fn();\n\n interceptRequest(matcher).mockImplementation((req) => {\n const spyResult = spy(req);\n const status = spyResult.status ?? 200;\n const resBody = spyResult.body || spyResult;\n return {\n status,\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\nexport interface TestViewport extends Viewport {\n safeAreaInset?: {\n top?: number | string;\n right?: number | string;\n bottom?: number | string;\n left?: number | string;\n };\n}\n\ninterface OpenPageCommonConfig {\n userAgent?: string;\n viewport?: TestViewport;\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 // Error.captureStackTrace(error, openPage);\n throw 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 }\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((viewport: TestViewport) => {\n const overriddenSafeAreaInsets = !viewport\n ? []\n : Object.keys(viewport?.safeAreaInset ?? {}).map((key) => {\n const position = key as 'top' | 'right' | 'bottom' | 'left';\n return `--acceptance-test-override-safe-area-inset-${key}: ${viewport?.safeAreaInset?.[position]};`;\n });\n\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 :root {\n ${overriddenSafeAreaInsets.join('\\n')}\n }\n `;\n window.addEventListener('DOMContentLoaded', () => {\n document.head.appendChild(style);\n });\n }, viewport);\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\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 await collectCoverageIfAvailable({coveragePath});\n\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\n/**\n * A convenience method to defer an expectation\n */\nexport const wait = <T>(expectation: () => Promise<T> | T, timeout = 10000, interval = 50): Promise<T> => {\n const startTime = Date.now();\n const startStack = new Error().stack;\n\n return new Promise((resolve, reject) => {\n const rejectOrRerun = (error: unknown) => {\n if (Date.now() - startTime >= timeout) {\n if (error instanceof Error) {\n if (error.message === 'Element not removed') {\n error.stack = startStack;\n }\n }\n reject(error);\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n setTimeout(runExpectation, interval);\n };\n const runExpectation = () => {\n try {\n Promise.resolve(expectation())\n .then((r) => resolve(r))\n .catch(rejectOrRerun);\n } catch (error) {\n rejectOrRerun(error);\n }\n };\n setTimeout(runExpectation, 0);\n });\n};\n\nexport const waitForElementToBeRemoved = (\n element: ElementHandle<Element>,\n timeout = 10000,\n interval = 100\n): Promise<void> => {\n const startStack = new Error().stack;\n\n const wait = async () => {\n const t0 = Date.now();\n while (Date.now() - t0 < timeout) {\n // boundingBox returns null when the element is not in the DOM\n const box = await element.boundingBox();\n if (!box) {\n return;\n }\n await new Promise((resolve) => setTimeout(resolve, interval));\n }\n throw new Error('Element not removed');\n };\n\n return wait().catch((error) => {\n if (error.message === 'Element not removed') {\n error.stack = startStack;\n }\n throw error;\n });\n};\n","import path from 'path';\nimport globToRegExp from 'glob-to-regexp';\n\n/**\n * Returns true if the current path matches the spied path, including parameters\n */\nexport const matchPath = (spiedPath: string, currentPath: string): boolean => {\n const normalizedCurrentPath = path.normalize(currentPath);\n const pattern = globToRegExp(spiedPath);\n return pattern.test(normalizedCurrentPath);\n};\n"],"names":["prepareCoverageReportPath","_ref","coveragePath","ppidFile","path","join","ppid","process","toString","fs","existsSync","readFileSync","rootPath","expect","getState","snapshotState","_rootDir","Error","getRootPath","cwd","normalize","startsWith","rmSync","recursive","force","mkdirSync","writeFileSync","collectCoverageIfAvailable","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref2","coverage","nycOutputPath","wrap","_context","prev","next","global","page","evaluate","window","__coverage__","sent","abrupt","Object","values","forEach","cov","_JSON$stringify","hash","JSON","stringify","stop","_x","apply","arguments","getGlobalBrowser","browser","getGlobalPage","isCi","argv","includes","env","CI","isUsingDockerizedChromium","URL","wsEndpoint","port","serverHostName","platform","execSync","e","isWsl","replace","split","map","line","trim","some","match","rootDir","findRoot","projectConfig","_pkg$acceptanceTests","parse","acceptanceTests","server","ciServer","devServer","_projectConfig$covera","serverPort","calledToMatchImageSnapshotOutsideDocker","extend","toMatchImageSnapshot","configureToMatchImageSnapshot","failureThreshold","failureThresholdType","customSnapshotIdentifier","defaultIdentifier","message","pass","afterEach","error","stack","waitForPaintEnd","element","_temp","_ref4","_ref4$fullPage","fullPage","captureBeyondViewport","MAX_WAIT","STEP_TIME","t0","buf1","buf2","Date","now","screenshot","normalizeSreenshotOptions","Promise","r","setTimeout","compare","_x2","_temp2","_ref5$captureBeyondVi","_ref5","_extends","_objectWithoutPropertiesLoose","_excluded","scrollIntoView","el","block","getPageApi","api","create","type","_ref6","_callee2","elementHandle","text","options","_context2","_x3","_x4","_x5","click","_ref7","_callee3","_context3","_x6","_x7","select","_ref8","_callee4","_len","_key","_args4","_context4","length","Array","_x8","_ref9","_callee5","_context5","skipNetworkWait","waitForNetworkIdle","_x9","clear","_ref10","_callee6","_context6","clickCount","press","_x10","setGeolocation","position","navigator","geolocation","getCurrentPosition","callback","coords","needsRequestInterception","requestHandlers","requestInterceptor","req","handler","_requestHandlers$find","find","_ref12","matcher","response","respond","interceptRequest","spy","jest","fn","push","openPage","_ref16","_callee7","_ref15","userAgent","isDarkMode","viewport","cookies","urlConfig","url","currentUserAgent","connectionError","_context7","_excluded2","undefined","_urlConfig$path","_urlConfig$port","_urlConfig$protocol","protocol","_urlConfig$hostname","hostname","bringToFront","setViewport","setCookie","setUserAgent","emulateMediaFeatures","name","value","evaluateOnNewDocument","overriddenSafeAreaInsets","keys","_viewport$safeAreaIns","safeAreaInset","key","_viewport$safeAreaIns2","style","document","createElement","innerHTML","addEventListener","head","appendChild","setRequestInterception","on","t1","captureStackTrace","waitForFunction","_x11","buildQueryMethods","_temp4","_ref17","boundQueries","_loop","_Object$entries$_i","_Object$entries","_i","queryName","queryFn","_callee12","doc","body","_len2","args","_key2","queryArgs","newElementHandle","_args12","_context12","getDocument","$","concat","timeout","_ref19","_callee8","_context8","_x12","_ref20","_callee9","_context9","_x13","_ref21","_callee10","_context10","_x14","_x15","_callee11","_args11","_context11","entries","queries","screen","beforeEach","_callee13","_context13","jestPuppeteer","resetPage","_callee14","_context14","off","_temp3","origin","_ref13","originRegExp","globToRegExp","_ref14","baseUrl","method","mockImplementation","status","headers","Access-Control-Allow-Origin","Access-Control-Allow-Methods","Access-Control-Allow-Headers","spyOn","spiedPath","_URL2","pathWithParams","pathname","search","currentPath","normalizedCurrentPath","test","matchPath","spyResult","_spyResult$status","contentType","filepath","isHeadless","HEADLESS","usesDocker","dockerComposeFile","__dirname","containerId","newPath","basename","copyFileSync","expectation","interval","startTime","startStack","resolve","reject","rejectOrRerun","runExpectation","then","_ref25","_callee15","_context15","boundingBox","wait"],"mappings":"u7OAKA,UAkBMA,EAA4B,SAAHC,OAAKC,EAAYD,EAAZC,aAC1BC,EAAWC,EAAKC,KAAKH,EAAc,SACnCI,EAAOC,QAAQD,KAAKE,WACrBC,EAAGC,WAAWP,IAAaM,EAAGE,aAAaR,EAAU,WAAaG,IAnBhD,WACvB,IAAMM,EAAWC,OAAOC,WAAWC,cAAcC,SACjD,IAAKJ,EACD,MAAM,IAAIK,MAAM,uBAEpB,OAAOL,EAgBCM,KAAkBX,QAAQY,OAASf,EAAKgB,UAAUlB,GAAcmB,WAAWd,QAAQY,QACnFV,EAAGa,OAAOpB,EAAc,CAACqB,WAAW,EAAMC,OAAO,IAErDf,EAAGgB,UAAUvB,EAAc,CAACqB,WAAW,IACvCd,EAAGiB,cAAcvB,EAAUG,KAQtBqB,aAA0B,IAAAC,EAAAC,EAAAC,IAAAC,MAAG,SAAAC,EAAAC,GAAA,IAAA/B,EAAAgC,EAAAC,EAAA,OAAAL,IAAAM,eAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,OAAoB,OAAZrC,EAAY+B,EAAZ/B,aAAYmC,EAAAE,OAnC3BC,OAAeC,KAoCPC,UAAS,WAC5C,OAAQC,OAAeC,gBACzB,OAFY,GAARV,EAAQG,EAAAQ,MAGDR,EAAAE,OAAA,MAAA,OAAAF,EAAAS,iBAAA,OAIb9C,EAA0B,CAACE,aAAAA,IACrBiC,EAAgB/B,EAAKC,KAAKH,EAAc,eAC9CO,EAAGgB,UAAUU,EAAe,CAACZ,WAAW,IAExCwB,OAAOC,OAAOd,GAAUe,SAAQ,SAACC,GACI,IAAAC,EAA7BD,GAAOA,EAAI9C,MAAQ8C,EAAIE,MACvB3C,EAAGiB,cAActB,EAAKC,KAAK8B,EA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,OAAA,MAAA,OAAAsT,EAAA/S,iBAAA,OAAA,OAAA+S,EAAAtT,OAGF,IAAIoF,SAAQ,SAAC2N,GAAO,OAAKzN,WAAWyN,EAASH,MAAU,OAAAU,EAAAtT,OAAA,MAAA,QAAA,MAE3D,IAAItB,MAAM,uBAAsB,QAAA,UAAA,OAAA4U,EAAAtS,UAAAqS,OACzC,kBAXS,OAAAD,EAAAlS,WAAAC,cAaHqS,UAAa,SAACtP,GAIjB,KAHsB,wBAAlBA,EAAMH,UACNG,EAAMC,MAAQ2O,GAEZ5O,qBAxHQ,SAACG,GAAsB,OAAK8I,EAAkB,CAAC9I,QAAAA"}
1
+ {"version":3,"file":"acceptance-testing.cjs.production.min.js","sources":["../src/coverage.ts","../src/index.ts","../src/utils.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs';\n\nimport type {Page} from 'puppeteer';\n\nconst getGlobalPage = (): Page => (global as any).page;\n\nexport const getRootPath = () => {\n const rootPath = expect.getState().snapshotState._rootDir;\n if (!rootPath) {\n throw new Error('Root path not found');\n }\n return rootPath;\n};\n\n/**\n * We want to clear coverage files from previous runs, but at this point it is not easy because each\n * worker runs a different instance of this script, so we can't just clear the coverage folder at\n * the beginning of the test run.\n *\n * The solution is to remove the coverage folder when the stored ppid (parent process id) is\n * different from the current one\n */\nconst prepareCoverageReportPath = ({coveragePath}: {coveragePath: string}) => {\n const ppidFile = path.join(coveragePath, '.ppid');\n const ppid = process.ppid.toString();\n if (!fs.existsSync(ppidFile) || fs.readFileSync(ppidFile, 'utf-8') !== ppid) {\n // the condition is just to make sure we don't remove files outside the repo\n if (getRootPath() === process.cwd() && path.normalize(coveragePath).startsWith(process.cwd())) {\n fs.rmSync(coveragePath, {recursive: true, force: true});\n }\n fs.mkdirSync(coveragePath, {recursive: true});\n fs.writeFileSync(ppidFile, ppid);\n }\n};\n\n/**\n * Asumes the code was instrumented with istanbul and the coverage report stored in `window.__coverage__`.\n * If not, this function does nothing.\n */\nexport const collectCoverageIfAvailable = async ({coveragePath}: {coveragePath: string}): Promise<void> => {\n const coverage = await getGlobalPage().evaluate(() => {\n return (window as any).__coverage__;\n });\n if (!coverage) {\n return;\n }\n\n prepareCoverageReportPath({coveragePath});\n const nycOutputPath = path.join(coveragePath, '.nyc_output');\n fs.mkdirSync(nycOutputPath, {recursive: true});\n\n Object.values(coverage).forEach((cov: any) => {\n if (cov && cov.path && cov.hash) {\n fs.writeFileSync(path.join(nycOutputPath, cov.hash + '.json'), JSON.stringify({[cov.path]: cov}));\n }\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';\nimport {execSync} from 'child_process';\nimport {collectCoverageIfAvailable} from './coverage';\nimport {matchPath} from './utils';\n\nimport type {getQueriesForElement} from 'pptr-testing-library';\nimport type {\n Browser,\n ClickOptions,\n ElementHandle,\n GeolocationOptions,\n HTTPRequest,\n Page,\n ResponseForRequest,\n ScreenshotOptions,\n Viewport,\n} from 'puppeteer';\n\ntype CustomScreenshotOptions = ScreenshotOptions & {\n skipNetworkWait?: boolean;\n};\n\nconst LINUX_DOCKER_HOST_IP = '172.17.0.1';\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\n/** Check if running inside WSL */\nconst isWsl = () => {\n if (process.platform !== 'linux') {\n return false;\n }\n try {\n return execSync('which wsl.exe').toString().startsWith('/mnt/');\n } catch (e) {\n // catched because it throws an error if wsl.exe is not found\n return false;\n }\n};\n\n/** Assumes running inside WSL */\nconst isWsl2 = () => {\n // `wsl.exe -l -v` returns something like:\n //\n // NAME STATE VERSION\n // * Ubuntu-22.04 Running 2\n // docker-desktop-data Running 2\n // docker-desktop Running 2\n // Ubuntu-20.04 Stopped 2\n return (\n execSync('wsl.exe -l -v')\n .toString()\n // null-bytes are inserted between chars in this command output (UTF-16 output?)\n .replace(/\\0/g, '')\n .split('\\n')\n .map((line) => line.trim())\n // matches a line like: \"* Ubuntu-22.04 Running 2\"\n .some((line) => !!line.match(/\\*\\s+\\S+\\s+Running\\s+2/))\n );\n};\n\n/** Assumes running inside WSL */\nconst getWslHostIp = () => {\n const ips = execSync('wsl.exe hostname -I').toString().trim().split(/\\s+/);\n\n if (ips.includes(LINUX_DOCKER_HOST_IP)) {\n // looks like a docker engine installed inside linux\n return LINUX_DOCKER_HOST_IP;\n }\n // assuming docker-desktop installed in windows\n return ips[0];\n};\n\nexport const serverHostName = ((): string => {\n if (isCi) {\n return 'localhost';\n }\n\n if (isUsingDockerizedChromium) {\n if (isWsl()) {\n if (isWsl2()) {\n return getWslHostIp();\n }\n throw new Error('WSL 1 is not supported. Please, use WSL 2.');\n }\n\n if (process.platform === 'win32') {\n throw new Error('Windows is not supported. Please, use WSL 2.');\n }\n\n return process.platform === 'linux' ? LINUX_DOCKER_HOST_IP : '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;\nconst coveragePath = path.join(rootDir, projectConfig.coveragePath ?? 'reports/coverage-acceptance');\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' | 'screenshot'> {\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>;\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-expect-error - puppeteer's setGeoLocation does not expect a timestamp to be passed\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)) ?? {\n handler: null,\n };\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 = ({\n /** defaults to any origin */\n origin,\n baseUrl,\n}: {\n origin?: string;\n /** @deprecated use origin */\n baseUrl?: string;\n} = {}): ApiEndpointMock => {\n const originRegExp = globToRegExp(origin ?? baseUrl ?? '*');\n\n interceptRequest((req) => {\n const {origin} = new URL(req.url());\n return req.method() === 'OPTIONS' && !!origin.match(originRegExp);\n }).mockImplementation(() => ({\n status: 204,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'POST,PATCH,PUT,GET,OPTIONS,DELETE',\n 'Access-Control-Allow-Headers': '*',\n },\n }));\n\n return {\n spyOn(spiedPath: string, method: string = 'GET') {\n const matcher = (req: HTTPRequest) => {\n const {origin, pathname, search} = new URL(req.url());\n const pathWithParams = pathname + search;\n\n return (\n req.method() === method &&\n !!origin.match(originRegExp) &&\n matchPath(spiedPath, pathWithParams)\n );\n };\n\n const spy = jest.fn();\n\n interceptRequest(matcher).mockImplementation((req) => {\n const spyResult = spy(req);\n const status = spyResult.status ?? 200;\n const resBody = spyResult.body || spyResult;\n return {\n status,\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\nexport interface TestViewport extends Viewport {\n safeAreaInset?: {\n top?: number | string;\n right?: number | string;\n bottom?: number | string;\n left?: number | string;\n };\n}\n\ninterface OpenPageCommonConfig {\n userAgent?: string;\n viewport?: TestViewport;\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 // Error.captureStackTrace(error, openPage);\n throw 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 }\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((viewport?: TestViewport) => {\n const overriddenSafeAreaInsets = !viewport\n ? []\n : Object.keys(viewport?.safeAreaInset ?? {}).map((key) => {\n const position = key as 'top' | 'right' | 'bottom' | 'left';\n return `--acceptance-test-override-safe-area-inset-${key}: ${viewport?.safeAreaInset?.[position]};`;\n });\n\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 :root {\n ${overriddenSafeAreaInsets.join('\\n')}\n }\n `;\n window.addEventListener('DOMContentLoaded', () => {\n document.head.appendChild(style);\n });\n }, viewport);\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\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 await collectCoverageIfAvailable({coveragePath});\n\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\n/**\n * A convenience method to defer an expectation\n */\nexport const wait = <T>(expectation: () => Promise<T> | T, timeout = 10000, interval = 50): Promise<T> => {\n const startTime = Date.now();\n const startStack = new Error().stack;\n\n return new Promise((resolve, reject) => {\n const rejectOrRerun = (error: unknown) => {\n if (Date.now() - startTime >= timeout) {\n if (error instanceof Error) {\n if (error.message === 'Element not removed') {\n error.stack = startStack;\n }\n }\n reject(error);\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n setTimeout(runExpectation, interval);\n };\n const runExpectation = () => {\n try {\n Promise.resolve(expectation())\n .then((r) => resolve(r))\n .catch(rejectOrRerun);\n } catch (error) {\n rejectOrRerun(error);\n }\n };\n setTimeout(runExpectation, 0);\n });\n};\n\nexport const waitForElementToBeRemoved = (\n element: ElementHandle<Element>,\n timeout = 10000,\n interval = 100\n): Promise<void> => {\n const startStack = new Error().stack;\n\n const wait = async () => {\n const t0 = Date.now();\n while (Date.now() - t0 < timeout) {\n // boundingBox returns null when the element is not in the DOM\n const box = await element.boundingBox();\n if (!box) {\n return;\n }\n await new Promise((resolve) => setTimeout(resolve, interval));\n }\n throw new Error('Element not removed');\n };\n\n return wait().catch((error) => {\n if (error.message === 'Element not removed') {\n error.stack = startStack;\n }\n throw error;\n });\n};\n","import path from 'path';\nimport globToRegExp from 'glob-to-regexp';\n\n/**\n * Returns true if the current path matches the spied path, including parameters\n */\nexport const matchPath = (spiedPath: string, currentPath: string): boolean => {\n const normalizedCurrentPath = path.normalize(currentPath);\n const pattern = globToRegExp(spiedPath);\n return pattern.test(normalizedCurrentPath);\n};\n"],"names":["prepareCoverageReportPath","_ref","coveragePath","ppidFile","path","join","ppid","process","toString","fs","existsSync","readFileSync","rootPath","expect","getState","snapshotState","_rootDir","Error","getRootPath","cwd","normalize","startsWith","rmSync","recursive","force","mkdirSync","writeFileSync","collectCoverageIfAvailable","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref2","coverage","nycOutputPath","wrap","_context","prev","next","global","page","evaluate","window","__coverage__","sent","abrupt","Object","values","forEach","cov","_JSON$stringify","hash","JSON","stringify","stop","_x","apply","arguments","getGlobalBrowser","browser","getGlobalPage","isCi","argv","includes","env","CI","isUsingDockerizedChromium","URL","wsEndpoint","port","serverHostName","platform","execSync","e","isWsl","replace","split","map","line","trim","some","match","ips","rootDir","findRoot","projectConfig","_pkg$acceptanceTests","parse","acceptanceTests","server","ciServer","devServer","_projectConfig$covera","serverPort","calledToMatchImageSnapshotOutsideDocker","extend","toMatchImageSnapshot","configureToMatchImageSnapshot","failureThreshold","failureThresholdType","customSnapshotIdentifier","defaultIdentifier","message","pass","afterEach","error","stack","waitForPaintEnd","element","_temp","_ref4","_ref4$fullPage","fullPage","captureBeyondViewport","MAX_WAIT","STEP_TIME","t0","buf1","buf2","Date","now","screenshot","normalizeSreenshotOptions","Promise","r","setTimeout","compare","_x2","_temp2","_ref5$captureBeyondVi","_ref5","_extends","_objectWithoutPropertiesLoose","_excluded","scrollIntoView","el","block","getPageApi","api","create","type","_ref6","_callee2","elementHandle","text","options","_context2","_x3","_x4","_x5","click","_ref7","_callee3","_context3","_x6","_x7","select","_ref8","_callee4","_len","_key","_args4","_context4","length","Array","_x8","_ref9","_callee5","_context5","skipNetworkWait","waitForNetworkIdle","_x9","clear","_ref10","_callee6","_context6","clickCount","press","_x10","setGeolocation","position","navigator","geolocation","getCurrentPosition","callback","coords","needsRequestInterception","requestHandlers","requestInterceptor","req","handler","_requestHandlers$find","find","_ref12","matcher","response","respond","interceptRequest","spy","jest","fn","push","openPage","_ref16","_callee7","_ref15","userAgent","isDarkMode","viewport","cookies","urlConfig","url","currentUserAgent","connectionError","_context7","_excluded2","undefined","_urlConfig$path","_urlConfig$port","_urlConfig$protocol","protocol","_urlConfig$hostname","hostname","bringToFront","setViewport","setCookie","setUserAgent","emulateMediaFeatures","name","value","evaluateOnNewDocument","overriddenSafeAreaInsets","keys","_viewport$safeAreaIns","safeAreaInset","key","_viewport$safeAreaIns2","style","document","createElement","innerHTML","addEventListener","head","appendChild","setRequestInterception","on","t1","captureStackTrace","waitForFunction","_x11","buildQueryMethods","_temp4","_ref17","boundQueries","_loop","_Object$entries$_i","_Object$entries","_i","queryName","queryFn","_callee12","doc","body","_len2","args","_key2","queryArgs","newElementHandle","_args12","_context12","getDocument","$","concat","timeout","_ref19","_callee8","_context8","_x12","_ref20","_callee9","_context9","_x13","_ref21","_callee10","_context10","_x14","_x15","_callee11","_args11","_context11","entries","queries","screen","beforeEach","_callee13","_context13","jestPuppeteer","resetPage","_callee14","_context14","off","_temp3","origin","_ref13","originRegExp","globToRegExp","_ref14","baseUrl","method","mockImplementation","status","headers","Access-Control-Allow-Origin","Access-Control-Allow-Methods","Access-Control-Allow-Headers","spyOn","spiedPath","_URL2","pathWithParams","pathname","search","currentPath","normalizedCurrentPath","test","matchPath","spyResult","_spyResult$status","contentType","filepath","isHeadless","HEADLESS","usesDocker","dockerComposeFile","__dirname","containerId","newPath","basename","copyFileSync","expectation","interval","startTime","startStack","resolve","reject","rejectOrRerun","runExpectation","then","_ref25","_callee15","_context15","boundingBox","wait"],"mappings":"u7OAKA,UAkBMA,EAA4B,SAAHC,OAAKC,EAAYD,EAAZC,aAC1BC,EAAWC,EAAKC,KAAKH,EAAc,SACnCI,EAAOC,QAAQD,KAAKE,WACrBC,EAAGC,WAAWP,IAAaM,EAAGE,aAAaR,EAAU,WAAaG,IAnBhD,WACvB,IAAMM,EAAWC,OAAOC,WAAWC,cAAcC,SACjD,IAAKJ,EACD,MAAM,IAAIK,MAAM,uBAEpB,OAAOL,EAgBCM,KAAkBX,QAAQY,OAASf,EAAKgB,UAAUlB,GAAcmB,WAAWd,QAAQY,QACnFV,EAAGa,OAAOpB,EAAc,CAACqB,WAAW,EAAMC,OAAO,IAErDf,EAAGgB,UAAUvB,EAAc,CAACqB,WAAW,IACvCd,EAAGiB,cAAcvB,EAAUG,KAQtBqB,aAA0B,IAAAC,EAAAC,EAAAC,IAAAC,MAAG,SAAAC,EAAAC,GAAA,IAAA/B,EAAAgC,EAAAC,EAAA,OAAAL,IAAAM,eAAAC,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AQ2N,QAAQJ,KACXQ,MAAK,SAAC9N,GAAC,OAAK0N,EAAQ1N,YACd4N,GACb,MAAO/O,GACL+O,EAAc/O,KAGtBoB,WAAW4N,EAAgB,yCAIM,SACrC7O,EACAqK,EACAkE,YADAlE,IAAAA,EAAU,cACVkE,IAAAA,EAAW,KAEX,IAAME,GAAa,IAAIrU,OAAQ0F,MAe/B,kBAbU,IAAAiP,EAAA/T,EAAAC,IAAAC,MAAG,SAAA8T,IAAA,IAAAxO,EAAA,OAAAvF,IAAAM,eAAA0T,GAAA,cAAAA,EAAAxT,KAAAwT,EAAAvT,MAAA,OACH8E,EAAKG,KAAKC,MAAK,OAAA,KACdD,KAAKC,MAAQJ,EAAK6J,IAAO4E,EAAAvT,QAAA,MAAA,OAAAuT,EAAAvT,OAEVsE,EAAQkP,cAAa,OAA9B,GAAAD,EAAAjT,MACDiT,EAAAvT,OAAA,MAAA,OAAAuT,EAAAhT,iBAAA,OAAA,OAAAgT,EAAAvT,OAGF,IAAIqF,SAAQ,SAAC2N,GAAO,OAAKzN,WAAWyN,EAASH,MAAU,OAAAU,EAAAvT,OAAA,MAAA,QAAA,MAE3D,IAAItB,MAAM,uBAAsB,QAAA,UAAA,OAAA6U,EAAAvS,UAAAsS,OACzC,kBAXS,OAAAD,EAAAnS,WAAAC,cAaHsS,UAAa,SAACtP,GAIjB,KAHsB,wBAAlBA,EAAMH,UACNG,EAAMC,MAAQ2O,GAEZ5O,qBAxHQ,SAACG,GAAsB,OAAK8I,EAAkB,CAAC9I,QAAAA"}
@@ -374,13 +374,13 @@ var getRootPath = function getRootPath() {
374
374
  }
375
375
  return rootPath;
376
376
  };
377
- /**
378
- * We want to clear coverage files from previous runs, but at this point it is not easy because each
379
- * worker runs a different instance of this script, so we can't just clear the coverage folder at
380
- * the beginning of the test run.
381
- *
382
- * The solution is to remove the coverage folder when the stored ppid (parent process id) is
383
- * different from the current one
377
+ /**
378
+ * We want to clear coverage files from previous runs, but at this point it is not easy because each
379
+ * worker runs a different instance of this script, so we can't just clear the coverage folder at
380
+ * the beginning of the test run.
381
+ *
382
+ * The solution is to remove the coverage folder when the stored ppid (parent process id) is
383
+ * different from the current one
384
384
  */
385
385
  var prepareCoverageReportPath = function prepareCoverageReportPath(_ref) {
386
386
  var coveragePath = _ref.coveragePath;
@@ -400,9 +400,9 @@ var prepareCoverageReportPath = function prepareCoverageReportPath(_ref) {
400
400
  fs.writeFileSync(ppidFile, ppid);
401
401
  }
402
402
  };
403
- /**
404
- * Asumes the code was instrumented with istanbul and the coverage report stored in `window.__coverage__`.
405
- * If not, this function does nothing.
403
+ /**
404
+ * Asumes the code was instrumented with istanbul and the coverage report stored in `window.__coverage__`.
405
+ * If not, this function does nothing.
406
406
  */
407
407
  var collectCoverageIfAvailable = /*#__PURE__*/function () {
408
408
  var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
@@ -447,8 +447,8 @@ var collectCoverageIfAvailable = /*#__PURE__*/function () {
447
447
  };
448
448
  }();
449
449
 
450
- /**
451
- * Returns true if the current path matches the spied path, including parameters
450
+ /**
451
+ * Returns true if the current path matches the spied path, including parameters
452
452
  */
453
453
  var matchPath = function matchPath(spiedPath, currentPath) {
454
454
  var normalizedCurrentPath = path.normalize(currentPath);
@@ -459,6 +459,7 @@ var matchPath = function matchPath(spiedPath, currentPath) {
459
459
  var _excluded = ["captureBeyondViewport"],
460
460
  _excluded2 = ["userAgent", "isDarkMode", "viewport", "cookies"];
461
461
  var _pkg$acceptanceTests, _ref, _projectConfig$covera;
462
+ var LINUX_DOCKER_HOST_IP = '172.17.0.1';
462
463
  var getGlobalBrowser = function getGlobalBrowser() {
463
464
  return global.browser;
464
465
  };
@@ -500,7 +501,13 @@ var isWsl2 = function isWsl2() {
500
501
  };
501
502
  /** Assumes running inside WSL */
502
503
  var getWslHostIp = function getWslHostIp() {
503
- return execSync('wsl.exe hostname -I').toString().trim();
504
+ var ips = execSync('wsl.exe hostname -I').toString().trim().split(/\s+/);
505
+ if (ips.includes(LINUX_DOCKER_HOST_IP)) {
506
+ // looks like a docker engine installed inside linux
507
+ return LINUX_DOCKER_HOST_IP;
508
+ }
509
+ // assuming docker-desktop installed in windows
510
+ return ips[0];
504
511
  };
505
512
  var serverHostName = /*#__PURE__*/function () {
506
513
  if (isCi) {
@@ -516,7 +523,7 @@ var serverHostName = /*#__PURE__*/function () {
516
523
  if (process.platform === 'win32') {
517
524
  throw new Error('Windows is not supported. Please, use WSL 2.');
518
525
  }
519
- return process.platform === 'linux' ? '172.17.0.1' : 'host.docker.internal';
526
+ return process.platform === 'linux' ? LINUX_DOCKER_HOST_IP : 'host.docker.internal';
520
527
  }
521
528
  return 'localhost';
522
529
  }();
@@ -1168,14 +1175,14 @@ afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().ma
1168
1175
  }
1169
1176
  }, _callee14, null, [[2, 11]]);
1170
1177
  })));
1171
- /**
1172
- * Returns a new path to the file that can be used by chromium in acceptance tests
1173
- *
1174
- * To be able to use `element.uploadFile()` in a dockerized chromium, the file must exist in the
1175
- * host and the docker, and both sides must use the same path.
1176
- *
1177
- * To workaround this bug or limitation, this function prepares the file by copying it to /tmp in
1178
- * the host and the container.
1178
+ /**
1179
+ * Returns a new path to the file that can be used by chromium in acceptance tests
1180
+ *
1181
+ * To be able to use `element.uploadFile()` in a dockerized chromium, the file must exist in the
1182
+ * host and the docker, and both sides must use the same path.
1183
+ *
1184
+ * To workaround this bug or limitation, this function prepares the file by copying it to /tmp in
1185
+ * the host and the container.
1179
1186
  */
1180
1187
  var prepareFile = function prepareFile(filepath) {
1181
1188
  var isLocal = !isCi;
@@ -1195,8 +1202,8 @@ var prepareFile = function prepareFile(filepath) {
1195
1202
  return filepath;
1196
1203
  }
1197
1204
  };
1198
- /**
1199
- * A convenience method to defer an expectation
1205
+ /**
1206
+ * A convenience method to defer an expectation
1200
1207
  */
1201
1208
  var wait = function wait(expectation, timeout, interval) {
1202
1209
  if (timeout === void 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"acceptance-testing.esm.js","sources":["../src/coverage.ts","../src/utils.ts","../src/index.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs';\n\nimport type {Page} from 'puppeteer';\n\nconst getGlobalPage = (): Page => (global as any).page;\n\nexport const getRootPath = () => {\n const rootPath = expect.getState().snapshotState._rootDir;\n if (!rootPath) {\n throw new Error('Root path not found');\n }\n return rootPath;\n};\n\n/**\n * We want to clear coverage files from previous runs, but at this point it is not easy because each\n * worker runs a different instance of this script, so we can't just clear the coverage folder at\n * the beginning of the test run.\n *\n * The solution is to remove the coverage folder when the stored ppid (parent process id) is\n * different from the current one\n */\nconst prepareCoverageReportPath = ({coveragePath}: {coveragePath: string}) => {\n const ppidFile = path.join(coveragePath, '.ppid');\n const ppid = process.ppid.toString();\n if (!fs.existsSync(ppidFile) || fs.readFileSync(ppidFile, 'utf-8') !== ppid) {\n // the condition is just to make sure we don't remove files outside the repo\n if (getRootPath() === process.cwd() && path.normalize(coveragePath).startsWith(process.cwd())) {\n fs.rmSync(coveragePath, {recursive: true, force: true});\n }\n fs.mkdirSync(coveragePath, {recursive: true});\n fs.writeFileSync(ppidFile, ppid);\n }\n};\n\n/**\n * Asumes the code was instrumented with istanbul and the coverage report stored in `window.__coverage__`.\n * If not, this function does nothing.\n */\nexport const collectCoverageIfAvailable = async ({coveragePath}: {coveragePath: string}): Promise<void> => {\n const coverage = await getGlobalPage().evaluate(() => {\n return (window as any).__coverage__;\n });\n if (!coverage) {\n return;\n }\n\n prepareCoverageReportPath({coveragePath});\n const nycOutputPath = path.join(coveragePath, '.nyc_output');\n fs.mkdirSync(nycOutputPath, {recursive: true});\n\n Object.values(coverage).forEach((cov: any) => {\n if (cov && cov.path && cov.hash) {\n fs.writeFileSync(path.join(nycOutputPath, cov.hash + '.json'), JSON.stringify({[cov.path]: cov}));\n }\n });\n};\n","import path from 'path';\nimport globToRegExp from 'glob-to-regexp';\n\n/**\n * Returns true if the current path matches the spied path, including parameters\n */\nexport const matchPath = (spiedPath: string, currentPath: string): boolean => {\n const normalizedCurrentPath = path.normalize(currentPath);\n const pattern = globToRegExp(spiedPath);\n return pattern.test(normalizedCurrentPath);\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';\nimport {execSync} from 'child_process';\nimport {collectCoverageIfAvailable} from './coverage';\nimport {matchPath} from './utils';\n\nimport type {getQueriesForElement} from 'pptr-testing-library';\nimport type {\n Browser,\n ClickOptions,\n ElementHandle,\n GeolocationOptions,\n HTTPRequest,\n Page,\n ResponseForRequest,\n ScreenshotOptions,\n Viewport,\n} from 'puppeteer';\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\n/** Check if running inside WSL */\nconst isWsl = () => {\n if (process.platform !== 'linux') {\n return false;\n }\n try {\n return execSync('which wsl.exe').toString().startsWith('/mnt/');\n } catch (e) {\n // catched because it throws an error if wsl.exe is not found\n return false;\n }\n};\n\n/** Assumes running inside WSL */\nconst isWsl2 = () => {\n // `wsl.exe -l -v` returns something like:\n //\n // NAME STATE VERSION\n // * Ubuntu-22.04 Running 2\n // docker-desktop-data Running 2\n // docker-desktop Running 2\n // Ubuntu-20.04 Stopped 2\n return (\n execSync('wsl.exe -l -v')\n .toString()\n // null-bytes are inserted between chars in this command output (UTF-16 output?)\n .replace(/\\0/g, '')\n .split('\\n')\n .map((line) => line.trim())\n // matches a line like: \"* Ubuntu-22.04 Running 2\"\n .some((line) => !!line.match(/\\*\\s+\\S+\\s+Running\\s+2/))\n );\n};\n\n/** Assumes running inside WSL */\nconst getWslHostIp = () => execSync('wsl.exe hostname -I').toString().trim();\n\nexport const serverHostName = ((): string => {\n if (isCi) {\n return 'localhost';\n }\n\n if (isUsingDockerizedChromium) {\n if (isWsl()) {\n if (isWsl2()) {\n return getWslHostIp();\n }\n throw new Error('WSL 1 is not supported. Please, use WSL 2.');\n }\n\n if (process.platform === 'win32') {\n throw new Error('Windows is not supported. Please, use WSL 2.');\n }\n\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;\nconst coveragePath = path.join(rootDir, projectConfig.coveragePath ?? 'reports/coverage-acceptance');\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-expect-error - puppeteer's setGeoLocation does not expect a timestamp to be passed\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 = ({\n /** defaults to any origin */\n origin,\n baseUrl,\n}: {\n origin?: string;\n /** @deprecated use origin */\n baseUrl?: string;\n} = {}): ApiEndpointMock => {\n const originRegExp = globToRegExp(origin ?? baseUrl ?? '*');\n\n interceptRequest((req) => {\n const {origin} = new URL(req.url());\n return req.method() === 'OPTIONS' && !!origin.match(originRegExp);\n }).mockImplementation(() => ({\n status: 204,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'POST,PATCH,PUT,GET,OPTIONS,DELETE',\n 'Access-Control-Allow-Headers': '*',\n },\n }));\n\n return {\n spyOn(spiedPath: string, method: string = 'GET') {\n const matcher = (req: HTTPRequest) => {\n const {origin, pathname, search} = new URL(req.url());\n const pathWithParams = pathname + search;\n\n return (\n req.method() === method &&\n !!origin.match(originRegExp) &&\n matchPath(spiedPath, pathWithParams)\n );\n };\n\n const spy = jest.fn();\n\n interceptRequest(matcher).mockImplementation((req) => {\n const spyResult = spy(req);\n const status = spyResult.status ?? 200;\n const resBody = spyResult.body || spyResult;\n return {\n status,\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\nexport interface TestViewport extends Viewport {\n safeAreaInset?: {\n top?: number | string;\n right?: number | string;\n bottom?: number | string;\n left?: number | string;\n };\n}\n\ninterface OpenPageCommonConfig {\n userAgent?: string;\n viewport?: TestViewport;\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 // Error.captureStackTrace(error, openPage);\n throw 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 }\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((viewport: TestViewport) => {\n const overriddenSafeAreaInsets = !viewport\n ? []\n : Object.keys(viewport?.safeAreaInset ?? {}).map((key) => {\n const position = key as 'top' | 'right' | 'bottom' | 'left';\n return `--acceptance-test-override-safe-area-inset-${key}: ${viewport?.safeAreaInset?.[position]};`;\n });\n\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 :root {\n ${overriddenSafeAreaInsets.join('\\n')}\n }\n `;\n window.addEventListener('DOMContentLoaded', () => {\n document.head.appendChild(style);\n });\n }, viewport);\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\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 await collectCoverageIfAvailable({coveragePath});\n\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\n/**\n * A convenience method to defer an expectation\n */\nexport const wait = <T>(expectation: () => Promise<T> | T, timeout = 10000, interval = 50): Promise<T> => {\n const startTime = Date.now();\n const startStack = new Error().stack;\n\n return new Promise((resolve, reject) => {\n const rejectOrRerun = (error: unknown) => {\n if (Date.now() - startTime >= timeout) {\n if (error instanceof Error) {\n if (error.message === 'Element not removed') {\n error.stack = startStack;\n }\n }\n reject(error);\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n setTimeout(runExpectation, interval);\n };\n const runExpectation = () => {\n try {\n Promise.resolve(expectation())\n .then((r) => resolve(r))\n .catch(rejectOrRerun);\n } catch (error) {\n rejectOrRerun(error);\n }\n };\n setTimeout(runExpectation, 0);\n });\n};\n\nexport const waitForElementToBeRemoved = (\n element: ElementHandle<Element>,\n timeout = 10000,\n interval = 100\n): Promise<void> => {\n const startStack = new Error().stack;\n\n const wait = async () => {\n const t0 = Date.now();\n while (Date.now() - t0 < timeout) {\n // boundingBox returns null when the element is not in the DOM\n const box = await element.boundingBox();\n if (!box) {\n return;\n }\n await new Promise((resolve) => setTimeout(resolve, interval));\n }\n throw new Error('Element not removed');\n };\n\n return wait().catch((error) => {\n if (error.message === 'Element not removed') {\n error.stack = startStack;\n }\n throw error;\n });\n};\n"],"names":["getGlobalPage","global","page","getRootPath","rootPath","expect","getState","snapshotState","_rootDir","Error","prepareCoverageReportPath","_ref","coveragePath","ppidFile","path","join","ppid","process","toString","fs","existsSync","readFileSync","cwd","normalize","startsWith","rmSync","recursive","force","mkdirSync","writeFileSync","collectCoverageIfAvailable","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref2","coverage","nycOutputPath","wrap","_callee$","_context","prev","next","evaluate","window","__coverage__","sent","abrupt","Object","values","forEach","cov","hash","_JSON$stringify","JSON","stringify","stop","_x","apply","arguments","matchPath","spiedPath","currentPath","normalizedCurrentPath","pattern","globToRegExp","test","getGlobalBrowser","browser","isCi","argv","includes","env","CI","isUsingDockerizedChromium","URL","wsEndpoint","port","isWsl","platform","execSync","e","isWsl2","replace","split","map","line","trim","some","match","getWslHostIp","serverHostName","rootDir","findRoot","pkg","parse","projectConfig","_pkg$acceptanceTests","acceptanceTests","server","ciServer","devServer","_projectConfig$covera","serverPort","toMatchImageSnapshot","configureToMatchImageSnapshot","failureThreshold","failureThresholdType","customSnapshotIdentifier","defaultIdentifier","calledToMatchImageSnapshotOutsideDocker","localToMatchImageSnapshot","message","pass","extend","afterEach","error","stack","waitForPaintEnd","element","_temp","_ref4","_ref4$fullPage","fullPage","captureBeyondViewport","MAX_WAIT","STEP_TIME","t0","buf1","buf2","Date","now","screenshot","normalizeSreenshotOptions","Promise","r","setTimeout","compare","_x2","_temp2","_ref5$captureBeyondVi","_ref5","options","_objectWithoutPropertiesLoose","_excluded","_extends","scrollIntoView","el","block","getPageApi","api","create","type","_ref6","_callee2","elementHandle","text","_callee2$","_context2","_x3","_x4","_x5","click","_ref7","_callee3","_callee3$","_context3","_x6","_x7","select","_ref8","_callee4","_len","_key","_args4","_callee4$","_context4","length","Array","_x8","_ref9","_callee5","_callee5$","_context5","skipNetworkWait","waitForNetworkIdle","_x9","clear","_ref10","_callee6","_callee6$","_context6","clickCount","press","_x10","setGeolocation","position","navigator","geolocation","getCurrentPosition","callback","coords","needsRequestInterception","requestHandlers","requestInterceptor","req","_ref11","_requestHandlers$find","find","_ref12","matcher","handler","response","respond","interceptRequest","spy","jest","fn","push","createApiEndpointMock","_temp3","origin","_ref13","baseUrl","originRegExp","_ref14","_URL","url","method","mockImplementation","status","headers","spyOn","_URL2","pathname","search","pathWithParams","spyResult","_spyResult$status","resBody","body","contentType","openPage","_ref16","_callee7","_ref15","userAgent","isDarkMode","viewport","cookies","urlConfig","currentUserAgent","connectionError","_callee7$","_context7","_excluded2","undefined","_urlConfig$path","_urlConfig$port","_urlConfig$protocol","protocol","_urlConfig$hostname","hostname","bringToFront","setViewport","setCookie","setUserAgent","emulateMediaFeatures","name","value","evaluateOnNewDocument","overriddenSafeAreaInsets","keys","_viewport$safeAreaIns","safeAreaInset","key","_viewport$safeAreaIns2","style","document","createElement","innerHTML","addEventListener","head","appendChild","setRequestInterception","on","t1","captureStackTrace","waitForFunction","_x11","buildQueryMethods","_temp4","_ref17","boundQueries","_loop","_Object$entries$_i","_Object$entries","_i","queryName","queryFn","_callee12","doc","_len2","args","_key2","queryArgs","newElementHandle","_args12","_callee12$","_context12","getDocument","$","concat","timeout","_ref19","_callee8","_callee8$","_context8","_x12","_ref20","_callee9","_callee9$","_context9","_x13","_ref21","_callee10","_callee10$","_context10","_x14","_x15","_callee11","_args11","_callee11$","_context11","entries","queries","getScreen","screen","within","beforeEach","_callee13","_callee13$","_context13","jestPuppeteer","resetPage","_callee14","_callee14$","_context14","off","prepareFile","filepath","isLocal","isHeadless","HEADLESS","usesDocker","dockerComposeFile","__dirname","containerId","newPath","basename","copyFileSync","wait","expectation","interval","startTime","startStack","resolve","reject","rejectOrRerun","runExpectation","then","waitForElementToBeRemoved","_ref25","_callee15","box","_callee15$","_context15","boundingBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA;EAAA,OAAgBC,MAAc,CAACC,IAAI;AAAA;AAE/C,IAAMC,WAAW,GAAG,SAAdA,WAAWA;EACpB,IAAMC,QAAQ,GAAGC,MAAM,CAACC,QAAQ,EAAE,CAACC,aAAa,CAACC,QAAQ;EACzD,IAAI,CAACJ,QAAQ,EAAE;IACX,MAAM,IAAIK,KAAK,CAAC,qBAAqB,CAAC;;EAE1C,OAAOL,QAAQ;AACnB,CAAC;AAED;;;;;;;;AAQA,IAAMM,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAAC,IAAA;MAAKC,YAAY,GAAAD,IAAA,CAAZC,YAAY;EAC5C,IAAMC,QAAQ,GAAGC,IAAI,CAACC,IAAI,CAACH,YAAY,EAAE,OAAO,CAAC;EACjD,IAAMI,IAAI,GAAGC,OAAO,CAACD,IAAI,CAACE,QAAQ,EAAE;EACpC,IAA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CAAA9U,IAAA;cAAA;;YAAA,OAAA8U,UAAA,CAAAzU,MAAA;UAAA;YAAAyU,UAAA,CAAA9U,IAAA;YAAA,OAGF,IAAI4F,OAAO,CAAC,UAACwO,OAAO;cAAA,OAAKtO,UAAU,CAACsO,OAAO,EAAEH,QAAQ,CAAC;cAAC;UAAA;YAAAa,UAAA,CAAA9U,IAAA;YAAA;UAAA;YAAA,MAE3D,IAAIlC,KAAK,CAAC,qBAAqB,CAAC;UAAA;UAAA;YAAA,OAAAgX,UAAA,CAAAhU,IAAA;;SAAA6T,SAAA;KACzC;IAAA,gBAXKZ,IAAIA;MAAA,OAAAW,MAAA,CAAA1T,KAAA,OAAAC,SAAA;;KAWT;EAED,OAAO8S,IAAI,EAAE,SAAM,CAAC,UAACrP,KAAK;IACtB,IAAIA,KAAK,CAACJ,OAAO,KAAK,qBAAqB,EAAE;MACzCI,KAAK,CAACC,KAAK,GAAGwP,UAAU;;IAE5B,MAAMzP,KAAK;GACd,CAAC;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"acceptance-testing.esm.js","sources":["../src/coverage.ts","../src/utils.ts","../src/index.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs';\n\nimport type {Page} from 'puppeteer';\n\nconst getGlobalPage = (): Page => (global as any).page;\n\nexport const getRootPath = () => {\n const rootPath = expect.getState().snapshotState._rootDir;\n if (!rootPath) {\n throw new Error('Root path not found');\n }\n return rootPath;\n};\n\n/**\n * We want to clear coverage files from previous runs, but at this point it is not easy because each\n * worker runs a different instance of this script, so we can't just clear the coverage folder at\n * the beginning of the test run.\n *\n * The solution is to remove the coverage folder when the stored ppid (parent process id) is\n * different from the current one\n */\nconst prepareCoverageReportPath = ({coveragePath}: {coveragePath: string}) => {\n const ppidFile = path.join(coveragePath, '.ppid');\n const ppid = process.ppid.toString();\n if (!fs.existsSync(ppidFile) || fs.readFileSync(ppidFile, 'utf-8') !== ppid) {\n // the condition is just to make sure we don't remove files outside the repo\n if (getRootPath() === process.cwd() && path.normalize(coveragePath).startsWith(process.cwd())) {\n fs.rmSync(coveragePath, {recursive: true, force: true});\n }\n fs.mkdirSync(coveragePath, {recursive: true});\n fs.writeFileSync(ppidFile, ppid);\n }\n};\n\n/**\n * Asumes the code was instrumented with istanbul and the coverage report stored in `window.__coverage__`.\n * If not, this function does nothing.\n */\nexport const collectCoverageIfAvailable = async ({coveragePath}: {coveragePath: string}): Promise<void> => {\n const coverage = await getGlobalPage().evaluate(() => {\n return (window as any).__coverage__;\n });\n if (!coverage) {\n return;\n }\n\n prepareCoverageReportPath({coveragePath});\n const nycOutputPath = path.join(coveragePath, '.nyc_output');\n fs.mkdirSync(nycOutputPath, {recursive: true});\n\n Object.values(coverage).forEach((cov: any) => {\n if (cov && cov.path && cov.hash) {\n fs.writeFileSync(path.join(nycOutputPath, cov.hash + '.json'), JSON.stringify({[cov.path]: cov}));\n }\n });\n};\n","import path from 'path';\nimport globToRegExp from 'glob-to-regexp';\n\n/**\n * Returns true if the current path matches the spied path, including parameters\n */\nexport const matchPath = (spiedPath: string, currentPath: string): boolean => {\n const normalizedCurrentPath = path.normalize(currentPath);\n const pattern = globToRegExp(spiedPath);\n return pattern.test(normalizedCurrentPath);\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';\nimport {execSync} from 'child_process';\nimport {collectCoverageIfAvailable} from './coverage';\nimport {matchPath} from './utils';\n\nimport type {getQueriesForElement} from 'pptr-testing-library';\nimport type {\n Browser,\n ClickOptions,\n ElementHandle,\n GeolocationOptions,\n HTTPRequest,\n Page,\n ResponseForRequest,\n ScreenshotOptions,\n Viewport,\n} from 'puppeteer';\n\ntype CustomScreenshotOptions = ScreenshotOptions & {\n skipNetworkWait?: boolean;\n};\n\nconst LINUX_DOCKER_HOST_IP = '172.17.0.1';\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\n/** Check if running inside WSL */\nconst isWsl = () => {\n if (process.platform !== 'linux') {\n return false;\n }\n try {\n return execSync('which wsl.exe').toString().startsWith('/mnt/');\n } catch (e) {\n // catched because it throws an error if wsl.exe is not found\n return false;\n }\n};\n\n/** Assumes running inside WSL */\nconst isWsl2 = () => {\n // `wsl.exe -l -v` returns something like:\n //\n // NAME STATE VERSION\n // * Ubuntu-22.04 Running 2\n // docker-desktop-data Running 2\n // docker-desktop Running 2\n // Ubuntu-20.04 Stopped 2\n return (\n execSync('wsl.exe -l -v')\n .toString()\n // null-bytes are inserted between chars in this command output (UTF-16 output?)\n .replace(/\\0/g, '')\n .split('\\n')\n .map((line) => line.trim())\n // matches a line like: \"* Ubuntu-22.04 Running 2\"\n .some((line) => !!line.match(/\\*\\s+\\S+\\s+Running\\s+2/))\n );\n};\n\n/** Assumes running inside WSL */\nconst getWslHostIp = () => {\n const ips = execSync('wsl.exe hostname -I').toString().trim().split(/\\s+/);\n\n if (ips.includes(LINUX_DOCKER_HOST_IP)) {\n // looks like a docker engine installed inside linux\n return LINUX_DOCKER_HOST_IP;\n }\n // assuming docker-desktop installed in windows\n return ips[0];\n};\n\nexport const serverHostName = ((): string => {\n if (isCi) {\n return 'localhost';\n }\n\n if (isUsingDockerizedChromium) {\n if (isWsl()) {\n if (isWsl2()) {\n return getWslHostIp();\n }\n throw new Error('WSL 1 is not supported. Please, use WSL 2.');\n }\n\n if (process.platform === 'win32') {\n throw new Error('Windows is not supported. Please, use WSL 2.');\n }\n\n return process.platform === 'linux' ? LINUX_DOCKER_HOST_IP : '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;\nconst coveragePath = path.join(rootDir, projectConfig.coveragePath ?? 'reports/coverage-acceptance');\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' | 'screenshot'> {\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>;\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-expect-error - puppeteer's setGeoLocation does not expect a timestamp to be passed\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)) ?? {\n handler: null,\n };\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 = ({\n /** defaults to any origin */\n origin,\n baseUrl,\n}: {\n origin?: string;\n /** @deprecated use origin */\n baseUrl?: string;\n} = {}): ApiEndpointMock => {\n const originRegExp = globToRegExp(origin ?? baseUrl ?? '*');\n\n interceptRequest((req) => {\n const {origin} = new URL(req.url());\n return req.method() === 'OPTIONS' && !!origin.match(originRegExp);\n }).mockImplementation(() => ({\n status: 204,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Methods': 'POST,PATCH,PUT,GET,OPTIONS,DELETE',\n 'Access-Control-Allow-Headers': '*',\n },\n }));\n\n return {\n spyOn(spiedPath: string, method: string = 'GET') {\n const matcher = (req: HTTPRequest) => {\n const {origin, pathname, search} = new URL(req.url());\n const pathWithParams = pathname + search;\n\n return (\n req.method() === method &&\n !!origin.match(originRegExp) &&\n matchPath(spiedPath, pathWithParams)\n );\n };\n\n const spy = jest.fn();\n\n interceptRequest(matcher).mockImplementation((req) => {\n const spyResult = spy(req);\n const status = spyResult.status ?? 200;\n const resBody = spyResult.body || spyResult;\n return {\n status,\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\nexport interface TestViewport extends Viewport {\n safeAreaInset?: {\n top?: number | string;\n right?: number | string;\n bottom?: number | string;\n left?: number | string;\n };\n}\n\ninterface OpenPageCommonConfig {\n userAgent?: string;\n viewport?: TestViewport;\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 // Error.captureStackTrace(error, openPage);\n throw 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 }\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((viewport?: TestViewport) => {\n const overriddenSafeAreaInsets = !viewport\n ? []\n : Object.keys(viewport?.safeAreaInset ?? {}).map((key) => {\n const position = key as 'top' | 'right' | 'bottom' | 'left';\n return `--acceptance-test-override-safe-area-inset-${key}: ${viewport?.safeAreaInset?.[position]};`;\n });\n\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 :root {\n ${overriddenSafeAreaInsets.join('\\n')}\n }\n `;\n window.addEventListener('DOMContentLoaded', () => {\n document.head.appendChild(style);\n });\n }, viewport);\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\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 await collectCoverageIfAvailable({coveragePath});\n\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\n/**\n * A convenience method to defer an expectation\n */\nexport const wait = <T>(expectation: () => Promise<T> | T, timeout = 10000, interval = 50): Promise<T> => {\n const startTime = Date.now();\n const startStack = new Error().stack;\n\n return new Promise((resolve, reject) => {\n const rejectOrRerun = (error: unknown) => {\n if (Date.now() - startTime >= timeout) {\n if (error instanceof Error) {\n if (error.message === 'Element not removed') {\n error.stack = startStack;\n }\n }\n reject(error);\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n setTimeout(runExpectation, interval);\n };\n const runExpectation = () => {\n try {\n Promise.resolve(expectation())\n .then((r) => resolve(r))\n .catch(rejectOrRerun);\n } catch (error) {\n rejectOrRerun(error);\n }\n };\n setTimeout(runExpectation, 0);\n });\n};\n\nexport const waitForElementToBeRemoved = (\n element: ElementHandle<Element>,\n timeout = 10000,\n interval = 100\n): Promise<void> => {\n const startStack = new Error().stack;\n\n const wait = async () => {\n const t0 = Date.now();\n while (Date.now() - t0 < timeout) {\n // boundingBox returns null when the element is not in the DOM\n const box = await element.boundingBox();\n if (!box) {\n return;\n }\n await new Promise((resolve) => setTimeout(resolve, interval));\n }\n throw new Error('Element not removed');\n };\n\n return wait().catch((error) => {\n if (error.message === 'Element not removed') {\n error.stack = startStack;\n }\n throw error;\n });\n};\n"],"names":["getGlobalPage","global","page","getRootPath","rootPath","expect","getState","snapshotState","_rootDir","Error","prepareCoverageReportPath","_ref","coveragePath","ppidFile","path","join","ppid","process","toString","fs","existsSync","readFileSync","cwd","normalize","startsWith","rmSync","recursive","force","mkdirSync","writeFileSync","collectCoverageIfAvailable","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_ref2","coverage","nycOutputPath","wrap","_callee$","_context","prev","next","evaluate","window","__coverage__","sent","abrupt","Object","values","forEach","cov","hash","_JSON$stringify","JSON","stringify","stop","_x","apply","arguments","matchPath","spiedPath","currentPath","normalizedCurrentPath","pattern","globToRegExp","test","LINUX_DOCKER_HOST_IP","getGlobalBrowser","browser","isCi","argv","includes","env","CI","isUsingDockerizedChromium","URL","wsEndpoint","port","isWsl","platform","execSync","e","isWsl2","replace","split","map","line","trim","some","match","getWslHostIp","ips","serverHostName","rootDir","findRoot","pkg","parse","projectConfig","_pkg$acceptanceTests","acceptanceTests","server","ciServer","devServer","_projectConfig$covera","serverPort","toMatchImageSnapshot","configureToMatchImageSnapshot","failureThreshold","failureThresholdType","customSnapshotIdentifier","defaultIdentifier","calledToMatchImageSnapshotOutsideDocker","localToMatchImageSnapshot","message","pass","extend","afterEach","error","stack","waitForPaintEnd","element","_temp","_ref4","_ref4$fullPage","fullPage","captureBeyondViewport","MAX_WAIT","STEP_TIME","t0","buf1","buf2","Date","now","screenshot","normalizeSreenshotOptions","Promise","r","setTimeout","compare","_x2","_temp2","_ref5$captureBeyondVi","_ref5","options","_objectWithoutPropertiesLoose","_excluded","_extends","scrollIntoView","el","block","getPageApi","api","create","type","_ref6","_callee2","elementHandle","text","_callee2$","_context2","_x3","_x4","_x5","click","_ref7","_callee3","_callee3$","_context3","_x6","_x7","select","_ref8","_callee4","_len","_key","_args4","_callee4$","_context4","length","Array","_x8","_ref9","_callee5","_callee5$","_context5","skipNetworkWait","waitForNetworkIdle","_x9","clear","_ref10","_callee6","_callee6$","_context6","clickCount","press","_x10","setGeolocation","position","navigator","geolocation","getCurrentPosition","callback","coords","needsRequestInterception","requestHandlers","requestInterceptor","req","_ref11","_requestHandlers$find","find","_ref12","matcher","handler","response","respond","interceptRequest","spy","jest","fn","push","createApiEndpointMock","_temp3","origin","_ref13","baseUrl","originRegExp","_ref14","_URL","url","method","mockImplementation","status","headers","spyOn","_URL2","pathname","search","pathWithParams","spyResult","_spyResult$status","resBody","body","contentType","openPage","_ref16","_callee7","_ref15","userAgent","isDarkMode","viewport","cookies","urlConfig","currentUserAgent","connectionError","_callee7$","_context7","_excluded2","undefined","_urlConfig$path","_urlConfig$port","_urlConfig$protocol","protocol","_urlConfig$hostname","hostname","bringToFront","setViewport","setCookie","setUserAgent","emulateMediaFeatures","name","value","evaluateOnNewDocument","overriddenSafeAreaInsets","keys","_viewport$safeAreaIns","safeAreaInset","key","_viewport$safeAreaIns2","style","document","createElement","innerHTML","addEventListener","head","appendChild","setRequestInterception","on","t1","captureStackTrace","waitForFunction","_x11","buildQueryMethods","_temp4","_ref17","boundQueries","_loop","_Object$entries$_i","_Object$entries","_i","queryName","queryFn","_callee12","doc","_len2","args","_key2","queryArgs","newElementHandle","_args12","_callee12$","_context12","getDocument","$","concat","timeout","_ref19","_callee8","_callee8$","_context8","_x12","_ref20","_callee9","_callee9$","_context9","_x13","_ref21","_callee10","_callee10$","_context10","_x14","_x15","_callee11","_args11","_callee11$","_context11","entries","queries","getScreen","screen","within","beforeEach","_callee13","_callee13$","_context13","jestPuppeteer","resetPage","_callee14","_callee14$","_context14","off","prepareFile","filepath","isLocal","isHeadless","HEADLESS","usesDocker","dockerComposeFile","__dirname","containerId","newPath","basename","copyFileSync","wait","expectation","interval","startTime","startStack","resolve","reject","rejectOrRerun","runExpectation","then","waitForElementToBeRemoved","_ref25","_callee15","box","_callee15$","_context15","boundingBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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