@appsurify-testmap/rrweb-cypress-plugin 3.2.0-alpha.1 → 3.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +230 -58
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +230 -58
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var g=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var O=(e,t)=>{for(var
|
|
1
|
+
"use strict";var g=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var O=(e,t)=>{for(var s in t)g(e,s,{get:t[s],enumerable:!0})},P=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of M(t))!N.call(e,n)&&n!==s&&g(e,n,{get:()=>t[n],enumerable:!(r=A(t,n))||r.enumerable});return e};var L=e=>P(g({},"__esModule",{value:!0}),e);var X={};O(X,{initializeTestmap:()=>T});module.exports=L(X);var b=new Map;function v(e,t){b.set(e,t)}function u(e){return b.get(e)}function d(e){return e.filter(t=>typeof t=="object"&&t!==null&&"log"in t&&t.log===!1?!1:typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null)}function l(e){return e.titlePath().join(" > ")}function D(e){if(e)return{id:e.id,file:e.file,invocationDetails:w(e.invocationDetails),pending:e.pending,root:e.root,title:e.title,type:e.type}}function w(e){return{absoluteFile:e?.absoluteFile??"",column:e?.column??0,fileUrl:e?.fileUrl??"",function:e?.function??"",line:e?.line??0,originalFile:e?.originalFile??"",relativeFile:e?.relativeFile??""}}function S(e){return{runner:e.runner,spec:F(e.spec),browser:U(e.browser),test:z(e.test),recorderEvents:Array.isArray(e.recorderEvents)?e.recorderEvents:[]}}function F(e){return{name:e.name??"",absolute:e.absolute??"",relative:e.relative??"",specFilter:e.specFilter??"",specType:e.specType??"integration",baseName:e.baseName??"",fileExtension:e.fileExtension??"",fileName:e.fileName??"",id:e.id??""}}function U(e){return{name:e.name??"",version:e.version??"",displayName:e.displayName??"",family:e.family??"",majorVersion:e.majorVersion??"",channel:e.channel??"",path:e.path??""}}function z(e){return{suite:D(e.parent),file:e.file??"",duration:e.duration??0,id:e.id??"",invocationDetails:w(e.invocationDetails),pending:e.pending??!1,state:e.state??"unknown",sync:e.sync??!1,timedOut:e.timedOut??!1,title:e.title??"",titlePath:typeof e.titlePath=="function"?e.titlePath():[],fullTitle:typeof e.fullTitle=="function"?e.fullTitle():"",type:e.type??"test"}}var k=require("@appsurify-testmap/rrweb"),$=require("@appsurify-testmap/rrweb-plugin-sequential-id-record");var x=`(function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("rrweb", [], f);} else if ("object" == typeof exports) {exports["rrweb"] = f();} else {g["rrweb"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports };
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __defProps = Object.defineProperties;
|
|
@@ -14273,6 +14273,7 @@ function initNavigationObserver({
|
|
|
14273
14273
|
doc,
|
|
14274
14274
|
sampling
|
|
14275
14275
|
}) {
|
|
14276
|
+
var _a2;
|
|
14276
14277
|
if (sampling.navigation === false) {
|
|
14277
14278
|
return () => {
|
|
14278
14279
|
};
|
|
@@ -14323,6 +14324,30 @@ function initNavigationObserver({
|
|
|
14323
14324
|
handlers.push(restoreReplaceState);
|
|
14324
14325
|
handlers.push(on("popstate", () => emitNavigation("popstate"), win));
|
|
14325
14326
|
handlers.push(on("hashchange", () => emitNavigation("hashchange"), win));
|
|
14327
|
+
const useNavigationAPI = typeof sampling.navigation === "object" ? (_a2 = sampling.navigation.useNavigationAPI) != null ? _a2 : true : true;
|
|
14328
|
+
if (useNavigationAPI && "navigation" in win) {
|
|
14329
|
+
try {
|
|
14330
|
+
const nav = win.navigation;
|
|
14331
|
+
const handler = (event) => {
|
|
14332
|
+
var _a22;
|
|
14333
|
+
const navEvent = event;
|
|
14334
|
+
if (navEvent.navigationType === "push" || navEvent.navigationType === "replace") {
|
|
14335
|
+
const destUrl = (_a22 = navEvent.destination) == null ? void 0 : _a22.url;
|
|
14336
|
+
if (destUrl && destUrl !== lastHref) {
|
|
14337
|
+
navigationCb({
|
|
14338
|
+
href: destUrl,
|
|
14339
|
+
oldHref: lastHref,
|
|
14340
|
+
navigationType: "navigate"
|
|
14341
|
+
});
|
|
14342
|
+
lastHref = destUrl;
|
|
14343
|
+
}
|
|
14344
|
+
}
|
|
14345
|
+
};
|
|
14346
|
+
nav.addEventListener("navigate", handler);
|
|
14347
|
+
handlers.push(() => nav.removeEventListener("navigate", handler));
|
|
14348
|
+
} catch (e) {
|
|
14349
|
+
}
|
|
14350
|
+
}
|
|
14326
14351
|
return callbackWrapper(() => {
|
|
14327
14352
|
handlers.forEach((h) => h());
|
|
14328
14353
|
});
|
|
@@ -16451,6 +16476,170 @@ class VisibilityManager {
|
|
|
16451
16476
|
}
|
|
16452
16477
|
}
|
|
16453
16478
|
}
|
|
16479
|
+
const DEFAULT_SETTLE_TIMEOUT = 150;
|
|
16480
|
+
const DEFAULT_MAX_WAIT = 5e3;
|
|
16481
|
+
const DEFAULT_DEBOUNCE = 100;
|
|
16482
|
+
class NavigationManager {
|
|
16483
|
+
constructor(options) {
|
|
16484
|
+
var _a2, _b, _c;
|
|
16485
|
+
__publicField(this, "frozen", false);
|
|
16486
|
+
__publicField(this, "locked", false);
|
|
16487
|
+
__publicField(this, "disabled", false);
|
|
16488
|
+
__publicField(this, "settleTimeout");
|
|
16489
|
+
__publicField(this, "maxWait");
|
|
16490
|
+
__publicField(this, "debounceMs");
|
|
16491
|
+
__publicField(this, "settlingObserver", null);
|
|
16492
|
+
__publicField(this, "debounceTimer", null);
|
|
16493
|
+
__publicField(this, "settleCheckTimer", null);
|
|
16494
|
+
__publicField(this, "maxWaitTimer", null);
|
|
16495
|
+
__publicField(this, "lastMutationTime", 0);
|
|
16496
|
+
__publicField(this, "pendingNavigation", null);
|
|
16497
|
+
__publicField(this, "doc");
|
|
16498
|
+
__publicField(this, "onSnapshot");
|
|
16499
|
+
const { doc, config, onSnapshot } = options;
|
|
16500
|
+
this.doc = doc;
|
|
16501
|
+
this.onSnapshot = callbackWrapper(onSnapshot);
|
|
16502
|
+
this.settleTimeout = (_a2 = config.settleTimeout) != null ? _a2 : DEFAULT_SETTLE_TIMEOUT;
|
|
16503
|
+
this.maxWait = (_b = config.maxWait) != null ? _b : DEFAULT_MAX_WAIT;
|
|
16504
|
+
this.debounceMs = (_c = config.debounce) != null ? _c : DEFAULT_DEBOUNCE;
|
|
16505
|
+
}
|
|
16506
|
+
handleNavigation(data) {
|
|
16507
|
+
if (this.disabled)
|
|
16508
|
+
return;
|
|
16509
|
+
if (this.locked)
|
|
16510
|
+
return;
|
|
16511
|
+
this.cancelTimers();
|
|
16512
|
+
this.disconnectSettlingObserver();
|
|
16513
|
+
this.pendingNavigation = data;
|
|
16514
|
+
if (this.frozen) {
|
|
16515
|
+
return;
|
|
16516
|
+
}
|
|
16517
|
+
this.startDebounce();
|
|
16518
|
+
}
|
|
16519
|
+
cancelPending() {
|
|
16520
|
+
this.cancelTimers();
|
|
16521
|
+
this.disconnectSettlingObserver();
|
|
16522
|
+
this.pendingNavigation = null;
|
|
16523
|
+
}
|
|
16524
|
+
freeze() {
|
|
16525
|
+
this.frozen = true;
|
|
16526
|
+
this.cancelTimers();
|
|
16527
|
+
this.disconnectSettlingObserver();
|
|
16528
|
+
}
|
|
16529
|
+
unfreeze() {
|
|
16530
|
+
this.frozen = false;
|
|
16531
|
+
if (this.pendingNavigation && !this.locked && !this.disabled) {
|
|
16532
|
+
this.startDebounce();
|
|
16533
|
+
}
|
|
16534
|
+
}
|
|
16535
|
+
lock() {
|
|
16536
|
+
this.locked = true;
|
|
16537
|
+
this.cancelTimers();
|
|
16538
|
+
this.disconnectSettlingObserver();
|
|
16539
|
+
}
|
|
16540
|
+
unlock() {
|
|
16541
|
+
this.locked = false;
|
|
16542
|
+
this.pendingNavigation = null;
|
|
16543
|
+
}
|
|
16544
|
+
unsetFrozen() {
|
|
16545
|
+
this.frozen = false;
|
|
16546
|
+
}
|
|
16547
|
+
reset() {
|
|
16548
|
+
this.cancelTimers();
|
|
16549
|
+
this.disconnectSettlingObserver();
|
|
16550
|
+
this.pendingNavigation = null;
|
|
16551
|
+
this.frozen = false;
|
|
16552
|
+
this.locked = false;
|
|
16553
|
+
}
|
|
16554
|
+
destroy() {
|
|
16555
|
+
this.reset();
|
|
16556
|
+
this.disabled = true;
|
|
16557
|
+
}
|
|
16558
|
+
startDebounce() {
|
|
16559
|
+
this.debounceTimer = setTimeout(() => {
|
|
16560
|
+
this.debounceTimer = null;
|
|
16561
|
+
this.startDOMSettling();
|
|
16562
|
+
}, this.debounceMs);
|
|
16563
|
+
}
|
|
16564
|
+
startDOMSettling() {
|
|
16565
|
+
if (this.frozen || this.locked || this.disabled)
|
|
16566
|
+
return;
|
|
16567
|
+
this.lastMutationTime = performance.now();
|
|
16568
|
+
const ObserverCtor = mutationObserverCtor();
|
|
16569
|
+
this.settlingObserver = new ObserverCtor(() => {
|
|
16570
|
+
this.lastMutationTime = performance.now();
|
|
16571
|
+
if (this.settleCheckTimer !== null) {
|
|
16572
|
+
clearTimeout(this.settleCheckTimer);
|
|
16573
|
+
}
|
|
16574
|
+
this.settleCheckTimer = setTimeout(
|
|
16575
|
+
() => this.checkSettled(),
|
|
16576
|
+
this.settleTimeout
|
|
16577
|
+
);
|
|
16578
|
+
});
|
|
16579
|
+
this.settlingObserver.observe(this.doc, {
|
|
16580
|
+
childList: true,
|
|
16581
|
+
subtree: true,
|
|
16582
|
+
attributes: true,
|
|
16583
|
+
characterData: true
|
|
16584
|
+
});
|
|
16585
|
+
this.settleCheckTimer = setTimeout(
|
|
16586
|
+
() => this.checkSettled(),
|
|
16587
|
+
this.settleTimeout
|
|
16588
|
+
);
|
|
16589
|
+
this.maxWaitTimer = setTimeout(() => {
|
|
16590
|
+
this.maxWaitTimer = null;
|
|
16591
|
+
this.completeSettling();
|
|
16592
|
+
}, this.maxWait);
|
|
16593
|
+
}
|
|
16594
|
+
checkSettled() {
|
|
16595
|
+
this.settleCheckTimer = null;
|
|
16596
|
+
const elapsed = performance.now() - this.lastMutationTime;
|
|
16597
|
+
if (elapsed >= this.settleTimeout) {
|
|
16598
|
+
this.completeSettling();
|
|
16599
|
+
} else {
|
|
16600
|
+
this.settleCheckTimer = setTimeout(
|
|
16601
|
+
() => this.checkSettled(),
|
|
16602
|
+
this.settleTimeout - elapsed
|
|
16603
|
+
);
|
|
16604
|
+
}
|
|
16605
|
+
}
|
|
16606
|
+
completeSettling() {
|
|
16607
|
+
if (this.frozen || this.locked || this.disabled)
|
|
16608
|
+
return;
|
|
16609
|
+
if (!this.pendingNavigation)
|
|
16610
|
+
return;
|
|
16611
|
+
this.cancelTimers();
|
|
16612
|
+
this.disconnectSettlingObserver();
|
|
16613
|
+
this.pendingNavigation = null;
|
|
16614
|
+
requestAnimationFrame(() => {
|
|
16615
|
+
requestAnimationFrame(() => {
|
|
16616
|
+
if (!this.frozen && !this.locked && !this.disabled) {
|
|
16617
|
+
this.onSnapshot(true);
|
|
16618
|
+
}
|
|
16619
|
+
});
|
|
16620
|
+
});
|
|
16621
|
+
}
|
|
16622
|
+
cancelTimers() {
|
|
16623
|
+
if (this.debounceTimer !== null) {
|
|
16624
|
+
clearTimeout(this.debounceTimer);
|
|
16625
|
+
this.debounceTimer = null;
|
|
16626
|
+
}
|
|
16627
|
+
if (this.settleCheckTimer !== null) {
|
|
16628
|
+
clearTimeout(this.settleCheckTimer);
|
|
16629
|
+
this.settleCheckTimer = null;
|
|
16630
|
+
}
|
|
16631
|
+
if (this.maxWaitTimer !== null) {
|
|
16632
|
+
clearTimeout(this.maxWaitTimer);
|
|
16633
|
+
this.maxWaitTimer = null;
|
|
16634
|
+
}
|
|
16635
|
+
}
|
|
16636
|
+
disconnectSettlingObserver() {
|
|
16637
|
+
if (this.settlingObserver) {
|
|
16638
|
+
this.settlingObserver.disconnect();
|
|
16639
|
+
this.settlingObserver = null;
|
|
16640
|
+
}
|
|
16641
|
+
}
|
|
16642
|
+
}
|
|
16454
16643
|
class StylesheetManager {
|
|
16455
16644
|
constructor(options) {
|
|
16456
16645
|
__publicField(this, "trackedLinkElements", /* @__PURE__ */ new WeakSet());
|
|
@@ -16538,43 +16727,13 @@ class ProcessedNodeManager {
|
|
|
16538
16727
|
destroy() {
|
|
16539
16728
|
}
|
|
16540
16729
|
}
|
|
16541
|
-
const version$1 = "3.
|
|
16730
|
+
const version$1 = "3.3.0-alpha.1";
|
|
16542
16731
|
let wrappedEmit;
|
|
16543
16732
|
let takeFullSnapshot$1;
|
|
16544
16733
|
let canvasManager;
|
|
16545
16734
|
let recording = false;
|
|
16546
16735
|
const customEventQueue = [];
|
|
16547
16736
|
let flushCustomEventQueue$1;
|
|
16548
|
-
function waitForDOMStabilization(win) {
|
|
16549
|
-
const maxWaitMs = 5e3;
|
|
16550
|
-
return new Promise((resolve2) => {
|
|
16551
|
-
const captureAfterPaint = () => {
|
|
16552
|
-
requestAnimationFrame(() => {
|
|
16553
|
-
requestAnimationFrame(() => {
|
|
16554
|
-
resolve2();
|
|
16555
|
-
});
|
|
16556
|
-
});
|
|
16557
|
-
};
|
|
16558
|
-
const safeResolve = /* @__PURE__ */ (() => {
|
|
16559
|
-
let called = false;
|
|
16560
|
-
return () => {
|
|
16561
|
-
if (!called) {
|
|
16562
|
-
called = true;
|
|
16563
|
-
captureAfterPaint();
|
|
16564
|
-
}
|
|
16565
|
-
};
|
|
16566
|
-
})();
|
|
16567
|
-
if (["interactive", "complete"].includes(win.document.readyState)) {
|
|
16568
|
-
safeResolve();
|
|
16569
|
-
} else {
|
|
16570
|
-
win.addEventListener("DOMContentLoaded", safeResolve, { once: true });
|
|
16571
|
-
win.addEventListener("load", safeResolve, { once: true });
|
|
16572
|
-
setTimeout(() => {
|
|
16573
|
-
safeResolve();
|
|
16574
|
-
}, maxWaitMs);
|
|
16575
|
-
}
|
|
16576
|
-
});
|
|
16577
|
-
}
|
|
16578
16737
|
try {
|
|
16579
16738
|
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
16580
16739
|
const cleanFrame = document.createElement("iframe");
|
|
@@ -16707,6 +16866,7 @@ function record(options = {}) {
|
|
|
16707
16866
|
checkoutDebounceTimer = null;
|
|
16708
16867
|
checkoutPending = false;
|
|
16709
16868
|
checkoutFreezeTimestamp = null;
|
|
16869
|
+
navigationManager == null ? void 0 : navigationManager.cancelPending();
|
|
16710
16870
|
takeFullSnapshot$1(true);
|
|
16711
16871
|
mutationBuffers.forEach((buf) => {
|
|
16712
16872
|
buf.resetBuffers();
|
|
@@ -16715,6 +16875,9 @@ function record(options = {}) {
|
|
|
16715
16875
|
if (visibilityManager) {
|
|
16716
16876
|
visibilityManager.unsetFrozen();
|
|
16717
16877
|
}
|
|
16878
|
+
if (navigationManager) {
|
|
16879
|
+
navigationManager.unsetFrozen();
|
|
16880
|
+
}
|
|
16718
16881
|
};
|
|
16719
16882
|
wrappedEmit = (r2, isCheckout) => {
|
|
16720
16883
|
var _a2;
|
|
@@ -16724,6 +16887,7 @@ function record(options = {}) {
|
|
|
16724
16887
|
if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && !checkoutPending && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
16725
16888
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
16726
16889
|
visibilityManager == null ? void 0 : visibilityManager.unfreeze();
|
|
16890
|
+
navigationManager == null ? void 0 : navigationManager.unfreeze();
|
|
16727
16891
|
}
|
|
16728
16892
|
if (inEmittingFrame) {
|
|
16729
16893
|
emit == null ? void 0 : emit(eventProcessor(e2), isCheckout);
|
|
@@ -16928,6 +17092,7 @@ function record(options = {}) {
|
|
|
16928
17092
|
shadowDomManager.init();
|
|
16929
17093
|
mutationBuffers.forEach((buf) => buf.lock());
|
|
16930
17094
|
visibilityManager == null ? void 0 : visibilityManager.lock();
|
|
17095
|
+
navigationManager == null ? void 0 : navigationManager.lock();
|
|
16931
17096
|
const node2 = snapshot(document, {
|
|
16932
17097
|
mirror,
|
|
16933
17098
|
blockClass,
|
|
@@ -16979,6 +17144,7 @@ function record(options = {}) {
|
|
|
16979
17144
|
);
|
|
16980
17145
|
mutationBuffers.forEach((buf) => buf.unlock());
|
|
16981
17146
|
visibilityManager == null ? void 0 : visibilityManager.unlock();
|
|
17147
|
+
navigationManager == null ? void 0 : navigationManager.unlock();
|
|
16982
17148
|
if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
|
|
16983
17149
|
stylesheetManager.adoptStyleSheets(
|
|
16984
17150
|
document.adoptedStyleSheets,
|
|
@@ -16991,6 +17157,31 @@ function record(options = {}) {
|
|
|
16991
17157
|
}
|
|
16992
17158
|
customEventQueue.length = 0;
|
|
16993
17159
|
};
|
|
17160
|
+
let navigationManager;
|
|
17161
|
+
const navigationSampling = sampling.navigation;
|
|
17162
|
+
if (navigationSampling !== false) {
|
|
17163
|
+
const navConfig = typeof navigationSampling === "object" ? navigationSampling : {};
|
|
17164
|
+
navigationManager = new NavigationManager({
|
|
17165
|
+
doc: document,
|
|
17166
|
+
config: navConfig,
|
|
17167
|
+
onSnapshot: (isCheckout) => {
|
|
17168
|
+
if (checkoutPending) {
|
|
17169
|
+
if (checkoutDebounceTimer) {
|
|
17170
|
+
clearTimeout(checkoutDebounceTimer);
|
|
17171
|
+
checkoutDebounceTimer = null;
|
|
17172
|
+
}
|
|
17173
|
+
checkoutPending = false;
|
|
17174
|
+
checkoutFreezeTimestamp = null;
|
|
17175
|
+
mutationBuffers.forEach((buf) => {
|
|
17176
|
+
buf.resetBuffers();
|
|
17177
|
+
buf.unsetFrozen();
|
|
17178
|
+
});
|
|
17179
|
+
visibilityManager == null ? void 0 : visibilityManager.unsetFrozen();
|
|
17180
|
+
}
|
|
17181
|
+
takeFullSnapshot$1(isCheckout);
|
|
17182
|
+
}
|
|
17183
|
+
});
|
|
17184
|
+
}
|
|
16994
17185
|
try {
|
|
16995
17186
|
const handlers = [];
|
|
16996
17187
|
const observe = (doc) => {
|
|
@@ -17019,14 +17210,11 @@ function record(options = {}) {
|
|
|
17019
17210
|
}, d)
|
|
17020
17211
|
}),
|
|
17021
17212
|
navigationCb: (navData) => {
|
|
17022
|
-
|
|
17023
|
-
|
|
17024
|
-
|
|
17025
|
-
|
|
17026
|
-
|
|
17027
|
-
navData.href
|
|
17028
|
-
);
|
|
17029
|
-
takeFullSnapshot$1(true);
|
|
17213
|
+
if (navigationManager) {
|
|
17214
|
+
navigationManager.handleNavigation(navData);
|
|
17215
|
+
} else {
|
|
17216
|
+
takeFullSnapshot$1(true);
|
|
17217
|
+
}
|
|
17030
17218
|
},
|
|
17031
17219
|
inputCb: (v2) => wrappedEmit({
|
|
17032
17220
|
type: EventType.IncrementalSnapshot,
|
|
@@ -17138,23 +17326,6 @@ function record(options = {}) {
|
|
|
17138
17326
|
flushCustomEventQueue$1();
|
|
17139
17327
|
}
|
|
17140
17328
|
};
|
|
17141
|
-
const runInit = async () => {
|
|
17142
|
-
if (flushCustomEvent === "before") {
|
|
17143
|
-
flushCustomEventQueue$1();
|
|
17144
|
-
}
|
|
17145
|
-
if (recordAfter === "DOMContentStabilized") {
|
|
17146
|
-
console.debug(\`[\${nowTimestamp()}] [rrweb:record] \\u{1F7E2} Waiting for DOM stabilization...\`);
|
|
17147
|
-
await waitForDOMStabilization(window);
|
|
17148
|
-
console.debug(\`[\${nowTimestamp()}] [rrweb:record] \\u2705 DOM stabilized, starting recording\`);
|
|
17149
|
-
}
|
|
17150
|
-
console.debug(\`[\${nowTimestamp()}] [rrweb:record] \\u2705 Init dom and takeFullSnapshot \`);
|
|
17151
|
-
takeFullSnapshot$1();
|
|
17152
|
-
handlers.push(observe(document));
|
|
17153
|
-
recording = true;
|
|
17154
|
-
if (flushCustomEvent === "after") {
|
|
17155
|
-
flushCustomEventQueue$1();
|
|
17156
|
-
}
|
|
17157
|
-
};
|
|
17158
17329
|
if (document.readyState === "interactive" || document.readyState === "complete") {
|
|
17159
17330
|
init();
|
|
17160
17331
|
} else {
|
|
@@ -17190,6 +17361,7 @@ function record(options = {}) {
|
|
|
17190
17361
|
}
|
|
17191
17362
|
flushCustomEventQueue$1();
|
|
17192
17363
|
handlers.forEach((h) => h());
|
|
17364
|
+
navigationManager == null ? void 0 : navigationManager.destroy();
|
|
17193
17365
|
processedNodeManager.destroy();
|
|
17194
17366
|
recording = false;
|
|
17195
17367
|
unregisterErrorHandler();
|
|
@@ -17258,5 +17430,5 @@ exports.record = record;
|
|
|
17258
17430
|
return module.exports;
|
|
17259
17431
|
}))
|
|
17260
17432
|
//# sourceMappingURL=rrweb-record.umd.cjs.map
|
|
17261
|
-
`;var B={slimDOMOptions:"all",inlineStylesheet:!0,recordDOM:!0,recordCanvas:!0,collectFonts:!0,inlineImages:!0,maskInputOptions:{password:!0},sampling:{mousemove:!1,mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!1,TouchEnd:!1},scroll:100,media:100,input:"last",canvas:"all",visibility:{mode:"none",debounce:50,threshold:.5,sensitivity:.05,rafThrottle:50}},flushCustomEvent:"after",recordAfter:"DOMContentLoaded",userTriggeredOnInput:!0};function C(e,t){let
|
|
17433
|
+
`;var B={slimDOMOptions:"all",inlineStylesheet:!0,recordDOM:!0,recordCanvas:!0,collectFonts:!0,inlineImages:!0,maskInputOptions:{password:!0},sampling:{mousemove:!1,mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!0,DblClick:!0,Focus:!0,Blur:!0,TouchStart:!1,TouchEnd:!1},scroll:100,media:100,input:"last",canvas:"all",visibility:{mode:"none",debounce:50,threshold:.5,sensitivity:.05,rafThrottle:50}},flushCustomEvent:"after",recordAfter:"DOMContentLoaded",userTriggeredOnInput:!0};function C(e,t){let s={...e};for(let r in t){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?s[r]=C(o,n):n!==void 0&&(s[r]=n)}return s}var p=class{recordFn=null;stopFn=null;targetWindow=null;context;eventCounter=0;events=[];recordOptions;pendingEvents=[];recorderScriptVersion="unknown";recorderLibVersion=k.version;constructor(t){this.recordOptions=C(B,t??{}),this.context={pushEvent:s=>this.events.push(s)}}handleEmit(t){if(t.type===0||t.type===1)return;let s={...t};this.context.pushEvent(s)}inject(t){let s=t;if(this.targetWindow=t,s.rrweb){this.recordFn=s.rrweb.record??null;return}let r=t.document.createElement("script");r.type="text/javascript",r.innerHTML=x,t.document.head.appendChild(r);let n=t.rrweb;if(!n||!n.record){console.error(`[${Date.now()}] [recorder] Failed to load rrweb.record`);return}this.recordFn=n.record,this.recorderScriptVersion=this.recordFn.getVersion()}start(){if(!this.targetWindow||!this.recordFn){console.debug(`[${Date.now()}] [recorder] Not ready to start`);return}if(this.stopFn){console.debug(`[${Date.now()}] [recorder] Already recording`);return}this.stopFn=this.recordFn({emit:t=>this.handleEmit(t),plugins:[(0,$.getRecordSequentialIdPlugin)({key:"id",getId:()=>++this.eventCounter})],...this.recordOptions}),this.flush()}stop(){this.flush(),this.stopFn?.(),this.stopFn=null}reset(){this.eventCounter=0,this.events=[],this.stop(),this.context={pushEvent:t=>this.events.push(t)}}flush(){if(!this.recordFn)return;let t=[];for(let s of this.pendingEvents)try{this.recordFn.addCustomEvent(s.tag,s.payload)}catch{console.debug(`[${Date.now()}] [recorder] flush failed for custom event: ${s.tag}`),t.push(s)}this.pendingEvents=t}addCustomEvent(t,s){let r={tag:t,payload:s};if(!this.recordFn||!this.stopFn){console.debug(`[${Date.now()}] [recorder] queued custom event (recorder not ready): ${t}`),this.pendingEvents.push(r);return}try{this.recordFn.addCustomEvent(t,s)}catch(n){console.debug(`[${Date.now()}] [recorder] error adding custom event: ${t}`,n),this.pendingEvents.push(r)}}isRecordingReady(){return!!this.recordFn&&!!this.stopFn}isRecording(){return this.recordFn?.isRecording()||!1}getScriptVersion(){return`@appsurify-testmap/rrweb-record:${this.recorderScriptVersion}`}getLibVersion(){return`@appsurify-testmap/rrweb:${this.recorderLibVersion}`}getEvents(){return this.events}getMirror(){return this.recordFn?.mirror}bind(t){this.context=t}setEventCounter(t){this.eventCounter=t}};var h=p;var y=Cypress.env("testmap")??{},H=typeof y=="object"&&"recordingOpts"in y?y.recordingOpts:h,i=new h(H),_=()=>{Cypress.on("test:before:run",j).on("window:before:load",K).on("window:before:unload",V).on("window:unload",G).on("window:load",Y).on("test:after:run",J).on("command:queue:end",q).on("fail",Z),afterEach(()=>{let e=Cypress.currentTest;if(!e)return;let t=l({titlePath:()=>e.titlePath}),s=u(t);if(!s)return;s.recorderEvents.map(n=>{if(n.type!==5)return n;let o=s.commandLiveRefs.get(n.data.payload.id);return n.data.payload.state=o?.state??"unknown",n.data.payload.args=d(o?.get("args")),n.data.payload.query=o?.get("query"),n.data.payload.timeout=o?.get("timeout"),n.data.payload.name=o?.get("name"),n.data.payload.type=o?.get("type"),o?.get("prev")&&(n.data.payload.prev={state:o?.get("prev").state,name:o?.get("prev").get("name"),args:d(o?.get("prev").get("args")),type:o?.get("prev").get("type"),query:o?.get("prev").get("query"),id:o?.get("prev").get("id")}),o?.get("next")&&(n.data.payload.next={state:o?.get("next").state,name:o?.get("next").get("name"),args:d(o?.get("next").get("args")),type:o?.get("next").get("type"),query:o?.get("next").get("query"),id:o?.get("next").get("id")}),n}),console.debug(`[${Date.now()}] [cypress] afterEach:`,s.recorderEvents);let r=S(s);try{cy.task("saveRRWebReport",{testRunResult:r},{log:!1})}catch(n){console.error(`[${Date.now()}] [cypress] afterEach:saveRRWebReport`,n)}})},j=(e,t)=>{let s=l(t),r={runner:{source:"cypress",type:Cypress.testingType,version:Cypress.version,platform:Cypress.platform,arch:Cypress.arch,recorder:{scriptVersion:i.getLibVersion()||"unknown",libVersion:i.getLibVersion()||"unknown"}},spec:Cypress.spec,test:t,browser:Cypress.browser,autWindow:null,waitForPaint:()=>Promise.resolve(void 0),paintComplete:!1,recorderEvents:[],commandLiveRefs:new Map};v(s,r),i.bind({pushEvent:n=>{if(console.debug(`[${Date.now()}] [cypress] pushEvent`,n),r.recorderEvents.push(n),n.type===5){let f=r.commandLiveRefs.get(n.data.payload.id)?.get("subject"),m=f?.selector,c=i.getMirror()?.getMeta(f?.[0]);n.data.payload.element={...c,selector:m,childNodes:[]}}}})};var V=e=>{},G=e=>{try{i.stop()}catch{}},K=e=>{i.inject(e);let t=Cypress.currentTest;if(!t)return;let s=l({titlePath:()=>t.titlePath}),r=u(s);r&&(r.runner.recorder.scriptVersion=i.getScriptVersion(),r.autWindow=e,r.paintComplete=!1)},Y=e=>{console.debug(`[${Date.now()}] [cypress] onWindowLoad`,e);let t=Cypress.currentTest;if(!t)return;let s=l({titlePath:()=>t.titlePath}),r=u(s);r&&(r.autWindow||(r.autWindow=e,r.paintComplete=!1),r.waitForPaint=n=>new Promise(o=>{let m=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o(n)})})},a=(()=>{let c=!1;return()=>{c||(c=!0,m())}})();["interactive","complete"].includes(e.document.readyState)?a():(e.addEventListener("DOMContentLoaded",a,{once:!0}),e.addEventListener("load",a,{once:!0}),setTimeout(()=>{console.warn("\u23F3 Timeout: forcing resolution"),a()},5e3))}),r.waitForPaint().then(async()=>{r.paintComplete=!0,i.inject(e),i.start()}))};var q=()=>{},Z=(e,t)=>{throw e},J=async(e,t)=>{console.debug(`[${Date.now()}] [cypress] onTestAfterRun`,e,t),i.stop()};var E=()=>{Cypress.mocha.getRunner().on("hook",Q)},Q=()=>{},I=()=>{beforeEach("",()=>{}),afterEach("",()=>{})};var R=()=>{_(),E(),I()};var T=()=>{R()};0&&(module.exports={initializeTestmap});
|
|
17262
17434
|
//# sourceMappingURL=index.js.map
|