/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ([ /* 0 */ /***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { "use strict"; /* harmony import */ var _packages_driver_src_cross_origin_cypress__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); // this is the entry point for the cross-origin version of the driver /***/ }), /* 1 */ /***/ ((__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) => { "use strict"; /* harmony import */ var setimmediate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var setimmediate__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(setimmediate__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _config_bluebird__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); /* harmony import */ var _config_jquery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6); /* harmony import */ var _config_lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); /* harmony import */ var _cypress__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(107); /* harmony import */ var _cypress_cy__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(671); /* harmony import */ var _cypress_location__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(228); /* harmony import */ var _cypress_commands__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(426); /* harmony import */ var _cypress_error_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(260); /* harmony import */ var _cypress_log__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(609); /* harmony import */ var _cy_listeners__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(685); /* harmony import */ var _origin_fn__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(927); /* harmony import */ var _cy_snapshots__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(611); /* harmony import */ var _events_logs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(933); /* harmony import */ var _events_socket__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(934); /* harmony import */ var _events_spec_window__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(928); /* harmony import */ var _events_errors__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(929); /* harmony import */ var _events_screenshots__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(935); /* harmony import */ var _events_test__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(936); /* harmony import */ var _events_misc__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(930); /* harmony import */ var _unsupported_apis__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(931); /* harmony import */ var _patches_submit__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(932); /* harmony import */ var _packages_runner_injection_patches_fetch__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(937); /* harmony import */ var _packages_runner_injection_patches_xmlHttpRequest__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(939); /* harmony import */ var _cypress_mocha__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(700); const createCypress = () => { // @ts-ignore const Cypress = window.Cypress = new _cypress__WEBPACK_IMPORTED_MODULE_4__["default"](); Cypress.specBridgeCommunicator.once('initialize:cypress', ({ config, env }) => { // eventually, setup will get called again on rerun and cy will get re-created setup(config, env); }); Cypress.specBridgeCommunicator.on('attach:to:window', () => { // It would be ideal to get a window identifier and attach to that window specifically instead of searching all parent windows. // This will be implemented for iFrames. const findWindow = () => { for (let index = 0; index < window.parent.frames.length; index++) { const frame = window.parent.frames[index]; try { // the AUT would be the frame with a matching origin, but not the same exact href. if (window.location.origin === frame.location.origin && window.location.href !== frame.location.href) { return frame; } } catch (error) { // Catch DOMException: Blocked a frame from accessing a cross-origin frame. if (error.name !== 'SecurityError') { throw error; } } } return undefined; }; const autWindow = findWindow(); // If Cypress is present on the autWindow, it has already been attached // This commonly happens if the spec bridge was created in a prior to // running this specific instance of the cy.origin command. if (autWindow && !autWindow.Cypress) { attachToWindow(autWindow); } }); Cypress.specBridgeCommunicator.on('generate:final:snapshot', snapshotUrl => { const currentAutOrigin = cy.state('autLocation').origin; const requestedSnapshotUrlLocation = _cypress_location__WEBPACK_IMPORTED_MODULE_6__.$Location.create(snapshotUrl); if (requestedSnapshotUrlLocation.origin === currentAutOrigin) { // if true, this is the correct spec bridge to take the snapshot and send it back const finalSnapshot = cy.createSnapshot(_cy_snapshots__WEBPACK_IMPORTED_MODULE_12__.FINAL_SNAPSHOT_NAME); Cypress.specBridgeCommunicator.toPrimary('snapshot:final:generated', finalSnapshot); } }); Cypress.specBridgeCommunicator.on('snapshot:generate:for:log', ({ name }, { responseEvent }) => { // if the snapshot cannot be taken (in a transitory space), set to an empty object in order to not fail serialization let requestedCrossOriginSnapshot = {}; // don't attempt to take snapshots after the spec bridge has been unloaded. Instead, send an empty snapshot back to the primary // to display current state of dom if (cy.state('document') !== undefined) { requestedCrossOriginSnapshot = cy.createSnapshot(name) || {}; } Cypress.specBridgeCommunicator.toPrimary(responseEvent, requestedCrossOriginSnapshot); }); Cypress.specBridgeCommunicator.toPrimary('bridge:ready'); }; const setup = (cypressConfig, env) => { const Cypress = window.Cypress; Cypress.configure({ ...cypressConfig, env, // never turn on video for a spec bridge when syncing the config. This is handled in the primary. video: false, isCrossOriginSpecBridge: true, // cross origin spec bridges cannot be used in component testing and is only valid for e2e. // This value is not synced with the config because it is omitted on big Cypress creation, as well as a few other key properties testingType: 'e2e' }); // @ts-ignore const cy = window.cy = new _cypress_cy__WEBPACK_IMPORTED_MODULE_5__.$Cy(window, Cypress, Cypress.Cookies, Cypress.state, Cypress.config, false); // @ts-ignore Cypress.log = (0,_cypress_log__WEBPACK_IMPORTED_MODULE_9__.create)(Cypress, cy, Cypress.state, Cypress.config); Cypress.mocha = _cypress_mocha__WEBPACK_IMPORTED_MODULE_18__["default"].create(window, Cypress, Cypress.config); // @ts-ignore Cypress.runner = { addLog() {} }; Cypress.cy = cy; // @ts-ignore Cypress.events.proxyTo(Cypress.cy); const { state, config } = Cypress; // @ts-ignore Cypress.Commands = _cypress_commands__WEBPACK_IMPORTED_MODULE_7__["default"].create(Cypress, cy, state, config); // @ts-ignore Cypress.isCy = cy.isCy; // this is "valid" inside the cy.origin() callback (as long as the experimental // flag is enabled), but it should be replaced by the preprocessor at runtime // with an actual require() before it's run in the browser. if it's not, // something unexpected has gone wrong // @ts-expect-error Cypress.require = () => { // @ts-ignore if (!Cypress.config('experimentalOriginDependencies')) { _cypress_error_utils__WEBPACK_IMPORTED_MODULE_8__["default"].throwErrByPath('require.invalid_without_flag'); } _cypress_error_utils__WEBPACK_IMPORTED_MODULE_8__["default"].throwErrByPath('require.invalid_inside_origin'); }; (0,_origin_fn__WEBPACK_IMPORTED_MODULE_11__.handleOriginFn)(Cypress, cy); (0,_events_logs__WEBPACK_IMPORTED_MODULE_19__.handleLogs)(Cypress); (0,_events_socket__WEBPACK_IMPORTED_MODULE_20__.handleSocketEvents)(Cypress); (0,_events_spec_window__WEBPACK_IMPORTED_MODULE_13__.handleSpecWindowEvents)(cy); (0,_events_misc__WEBPACK_IMPORTED_MODULE_15__.handleMiscEvents)(Cypress, cy); (0,_events_screenshots__WEBPACK_IMPORTED_MODULE_21__.handleScreenshots)(Cypress); (0,_events_test__WEBPACK_IMPORTED_MODULE_22__.handleTestEvents)(Cypress); (0,_unsupported_apis__WEBPACK_IMPORTED_MODULE_16__.handleUnsupportedAPIs)(Cypress, cy); cy.onBeforeAppWindowLoad = onBeforeAppWindowLoad(Cypress, cy); }; // eslint-disable-next-line @cypress/dev/arrow-body-multiline-braces const onBeforeAppWindowLoad = (Cypress, cy) => autWindow => { autWindow.Cypress = Cypress; attachToWindow(autWindow); }; const attachToWindow = autWindow => { autWindow.Cypress = Cypress; const cy = Cypress.cy; // this communicates to the injection code that Cypress is now available so // it can safely subscribe to Cypress events, etc // @ts-ignore autWindow.__attachToCypress ? autWindow.__attachToCypress(Cypress) : undefined; Cypress.state('window', autWindow); Cypress.state('document', autWindow.document); if (Cypress && Cypress.config('experimentalModifyObstructiveThirdPartyCode')) { (0,_patches_submit__WEBPACK_IMPORTED_MODULE_17__.patchFormElementSubmit)(autWindow); } cy.urlNavigationEvent('before:load'); cy.overrides.wrapNativeMethods(autWindow); // place after override incase fetch is polyfilled in the AUT injection // this can be in the beforeLoad code as we only want to patch fetch/xmlHttpRequest // when the cy.origin block is active to track credential use (0,_packages_runner_injection_patches_fetch__WEBPACK_IMPORTED_MODULE_23__.patchFetch)(window); (0,_packages_runner_injection_patches_xmlHttpRequest__WEBPACK_IMPORTED_MODULE_24__.patchXmlHttpRequest)(window); // TODO: DRY this up with the mostly-the-same code in src/cypress/cy.js // https://github.com/cypress-io/cypress/issues/20972 (0,_cy_listeners__WEBPACK_IMPORTED_MODULE_10__.bindToListeners)(autWindow, { onError: (0,_events_errors__WEBPACK_IMPORTED_MODULE_14__.handleErrorEvent)(cy, 'app'), onHistoryNav() {}, onSubmit(e) { return Cypress.action('app:form:submitted', e); }, onBeforeUnload(e) { // The before unload event is propagated to primary through code injected into the AUT. cy.isStable(false, 'beforeunload'); // NOTE: we intentionally do not set the cy.Cookies.setInitial() inside the spec bridge as we are not doing full injection and this leads to cookie side effects cy.resetTimer(); Cypress.action('app:window:before:unload', e); // return undefined so our beforeunload handler // doesn't trigger a confirmation dialog return undefined; }, onLoad() { cy.urlNavigationEvent('load'); const remoteLocation = cy.getRemoteLocation(); cy.state('autLocation', remoteLocation); Cypress.action('app:window:load', autWindow, remoteLocation.href); Cypress.specBridgeCommunicator.toPrimary('window:load', { url: remoteLocation.href }); cy.isStable(true, 'load'); }, onUnload(e) { cy.state('window', undefined); cy.state('document', undefined); return Cypress.action('app:window:unload', e); }, onNavigation(...args) { return Cypress.action('app:navigation:changed', ...args); }, onAlert(str) { return Cypress.action('app:window:alert', str); }, onConfirm(str) { const results = Cypress.action('app:window:confirm', str); // return false if ANY results are false const ret = !results.some(result => result === false); Cypress.action('app:window:confirmed', str, ret); return ret; } }); }; // only bind the message handler one time when the spec bridge is created window.addEventListener('message', ({ data }) => { var _Cypress; (_Cypress = Cypress) === null || _Cypress === void 0 ? void 0 : _Cypress.specBridgeCommunicator.onMessage({ data }); }, false); createCypress(); /***/ }), /* 2 */ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { /* provided dependency */ var process = __webpack_require__(3); (function (global, undefined) { "use strict"; if (global.setImmediate) { return; } var nextHandle = 1; // Spec says greater than zero var tasksByHandle = {}; var currentlyRunningATask = false; var doc = global.document; var registerImmediate; function setImmediate(callback) { // Callback can either be a function or a string if (typeof callback !== "function") { callback = new Function("" + callback); } // Copy function arguments var args = new Array(arguments.length - 1); for (var i = 0; i < args.length; i++) { args[i] = arguments[i + 1]; } // Store and register the task var task = { callback: callback, args: args }; tasksByHandle[nextHandle] = task; registerImmediate(nextHandle); return nextHandle++; } function clearImmediate(handle) { delete tasksByHandle[handle]; } function run(task) { var callback = task.callback; var args = task.args; switch (args.length) { case 0: callback(); break; case 1: callback(args[0]); break; case 2: callback(args[0], args[1]); break; case 3: callback(args[0], args[1], args[2]); break; default: callback.apply(undefined, args); break; } } function runIfPresent(handle) { // From the spec: "Wait until any invocations of this algorithm started before this one have completed." // So if we're currently running a task, we'll need to delay this invocation. if (currentlyRunningATask) { // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a // "too much recursion" error. setTimeout(runIfPresent, 0, handle); } else { var task = tasksByHandle[handle]; if (task) { currentlyRunningATask = true; try { run(task); } finally { clearImmediate(handle); currentlyRunningATask = false; } } } } function installNextTickImplementation() { registerImmediate = function(handle) { process.nextTick(function () { runIfPresent(handle); }); }; } function canUsePostMessage() { // The test against `importScripts` prevents this implementation from being installed inside a web worker, // where `global.postMessage` means something completely different and can't be used for this purpose. if (global.postMessage && !global.importScripts) { var postMessageIsAsynchronous = true; var oldOnMessage = global.onmessage; global.onmessage = function() { postMessageIsAsynchronous = false; }; global.postMessage("", "*"); global.onmessage = oldOnMessage; return postMessageIsAsynchronous; } } function installPostMessageImplementation() { // Installs an event handler on `global` for the `message` event: see // * https://developer.mozilla.org/en/DOM/window.postMessage // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages var messagePrefix = "setImmediate$" + Math.random() + "$"; var onGlobalMessage = function(event) { if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) { runIfPresent(+event.data.slice(messagePrefix.length)); } }; if (global.addEventListener) { global.addEventListener("message", onGlobalMessage, false); } else { global.attachEvent("onmessage", onGlobalMessage); } registerImmediate = function(handle) { global.postMessage(messagePrefix + handle, "*"); }; } function installMessageChannelImplementation() { var channel = new MessageChannel(); channel.port1.onmessage = function(event) { var handle = event.data; runIfPresent(handle); }; registerImmediate = function(handle) { channel.port2.postMessage(handle); }; } function installReadyStateChangeImplementation() { var html = doc.documentElement; registerImmediate = function(handle) { // Create a