@appsurify-testmap/rrweb-cypress-plugin 2.1.1-alpha.7 → 2.1.2-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/Readme.md +63 -0
- package/dist/index.js +93 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +93 -21
- package/dist/index.mjs.map +1 -1
- package/dist/reporter.d.ts +1 -7
- package/dist/reporter.js +1 -1
- package/dist/reporter.js.map +1 -1
- package/dist/reporter.mjs +1 -1
- package/dist/reporter.mjs.map +1 -1
- package/package.json +6 -7
package/Readme.md
CHANGED
|
@@ -1,2 +1,65 @@
|
|
|
1
1
|
# @appsurify-testmap/rrweb-cypress-plugin
|
|
2
2
|
|
|
3
|
+
## Notes
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
// file: cypress.config.ts
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
fixturesFolder: false,
|
|
10
|
+
env: {
|
|
11
|
+
testmap: {
|
|
12
|
+
recordingOpts: {
|
|
13
|
+
checkoutEveryNvm: 5,
|
|
14
|
+
// excludeAttribute: /data-(cy|test(id)?|cypress|highlight-el|cypress-el)/i,
|
|
15
|
+
maskInputOptions: { password: true },
|
|
16
|
+
sampling: {
|
|
17
|
+
mousemove: false,
|
|
18
|
+
mouseInteraction: {
|
|
19
|
+
MouseUp: false,
|
|
20
|
+
MouseDown: false,
|
|
21
|
+
Click: true,
|
|
22
|
+
ContextMenu: true,
|
|
23
|
+
DblClick: true,
|
|
24
|
+
Focus: true,
|
|
25
|
+
Blur: true,
|
|
26
|
+
TouchStart: false,
|
|
27
|
+
TouchEnd: false,
|
|
28
|
+
},
|
|
29
|
+
scroll: 100,
|
|
30
|
+
media: 100,
|
|
31
|
+
input: 'last',
|
|
32
|
+
canvas: 'all',
|
|
33
|
+
visibility: {
|
|
34
|
+
mode: 'debounce',
|
|
35
|
+
debounce: 100,
|
|
36
|
+
threshold: 0.5,
|
|
37
|
+
sensitivity: 0.05,
|
|
38
|
+
rafThrottle: 100
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
flushCustomEvent: 'after',
|
|
42
|
+
// recordAfter: 'DOMContentStabilized',
|
|
43
|
+
recordAfter: 'DOMContentLoaded',
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
e2e: {
|
|
48
|
+
setupNodeEvents(on, config) {
|
|
49
|
+
registerRRWebReportTasks(on, {...config, outputReportDir: 'test-results/cypress/ui'});
|
|
50
|
+
return config;
|
|
51
|
+
},
|
|
52
|
+
baseUrl: 'http://localhost:8888',
|
|
53
|
+
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
// file: support.js
|
|
61
|
+
const { initializeTestmap } = require('@appsurify-testmap/rrweb-cypress-plugin')
|
|
62
|
+
|
|
63
|
+
initializeTestmap()
|
|
64
|
+
|
|
65
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var g=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var r in t)g(e,r,{get:t[r],enumerable:!0})},L=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of A(t))!O.call(e,s)&&s!==r&&g(e,s,{get:()=>t[s],enumerable:!(n=N(t,s))||n.enumerable});return e};var D=e=>L(g({},"__esModule",{value:!0}),e);var le={};P(le,{initializeTestmap:()=>M});module.exports=D(le);var b=new Map;function v(e,t){b.set(e,t)}function l(e){return b.get(e)}function p(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 w(e){let t=e?.[0];if(!t)return null;let r=t.tagName.toLowerCase(),n=t.id?`#${t.id}`:"",s=Array.from(t.classList).map(o=>`.${o}`).join("");return`${r}${n}${s}`}function a(e){return e.titlePath().join(" > ")}function F(e){if(e)return{id:e.id,file:e.file,invocationDetails:k(e.invocationDetails),pending:e.pending,root:e.root,title:e.title,type:e.type}}function k(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:U(e.spec),browser:W(e.browser),test:z(e.test),recorderEvents:Array.isArray(e.recorderEvents)?e.recorderEvents:[]}}function U(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 W(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:F(e.parent),file:e.file??"",duration:e.duration??0,id:e.id??"",invocationDetails:k(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 $=require("@appsurify-testmap/rrweb"),C=require("@appsurify-testmap/rrweb-plugin-sequential-id-record");var x=`(function (g, f) {
|
|
2
2
|
if ("object" == typeof exports && "object" == typeof module) {
|
|
3
3
|
module.exports = f();
|
|
4
4
|
} else if ("function" == typeof define && define.amd) {
|
|
@@ -10859,6 +10859,8 @@ function initViewportResizeObserver({ viewportResizeCb }, { win }) {
|
|
|
10859
10859
|
}
|
|
10860
10860
|
const INPUT_TAGS = ["INPUT", "TEXTAREA", "SELECT"];
|
|
10861
10861
|
const lastInputValueMap = /* @__PURE__ */ new WeakMap();
|
|
10862
|
+
const FINALIZING_KEYS = ["Enter", "Tab", "Escape", "ArrowDown", "ArrowUp", "Delete"];
|
|
10863
|
+
const lastKeyInputValueMap = /* @__PURE__ */ new WeakMap();
|
|
10862
10864
|
function initInputObserver({
|
|
10863
10865
|
inputCb,
|
|
10864
10866
|
doc,
|
|
@@ -10931,6 +10933,22 @@ function initInputObserver({
|
|
|
10931
10933
|
const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
|
|
10932
10934
|
const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
|
|
10933
10935
|
if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
|
|
10936
|
+
console.debug(
|
|
10937
|
+
\`[\${nowTimestamp()}] [rrweb:record/observer] \\u26D4 phantom input ignored\`,
|
|
10938
|
+
{
|
|
10939
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
|
|
10940
|
+
node: index.describeNode(el),
|
|
10941
|
+
tag: el.tagName,
|
|
10942
|
+
nodeType: el.nodeType,
|
|
10943
|
+
attribute: el.attributes,
|
|
10944
|
+
value: el.value,
|
|
10945
|
+
isLikelyPhantom,
|
|
10946
|
+
isRenderDrivenTextInput,
|
|
10947
|
+
isValueFromDefault,
|
|
10948
|
+
isPhantomCheckbox,
|
|
10949
|
+
isPhantomRadio
|
|
10950
|
+
}
|
|
10951
|
+
);
|
|
10934
10952
|
return;
|
|
10935
10953
|
}
|
|
10936
10954
|
if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) {
|
|
@@ -10945,6 +10963,62 @@ function initInputObserver({
|
|
|
10945
10963
|
const handlers = events.map(
|
|
10946
10964
|
(eventName) => on(eventName, callbackWrapper(eventHandler), doc)
|
|
10947
10965
|
);
|
|
10966
|
+
const keyboardHandler = (event) => {
|
|
10967
|
+
const target = getEventTarget(event);
|
|
10968
|
+
if (!target || !target.tagName)
|
|
10969
|
+
return;
|
|
10970
|
+
if (sampling.input === "all") {
|
|
10971
|
+
eventHandler(event);
|
|
10972
|
+
return;
|
|
10973
|
+
}
|
|
10974
|
+
const tag = target.tagName;
|
|
10975
|
+
const key = event.key;
|
|
10976
|
+
const isFinalizingKey = FINALIZING_KEYS.includes(key);
|
|
10977
|
+
const isTextarea = tag === "TEXTAREA";
|
|
10978
|
+
const isFocused = doc.activeElement === target;
|
|
10979
|
+
const valueNow = target.value;
|
|
10980
|
+
const valueBefore = lastKeyInputValueMap.get(target);
|
|
10981
|
+
lastKeyInputValueMap.set(target, valueNow);
|
|
10982
|
+
if (!isFocused) {
|
|
10983
|
+
eventHandler(event);
|
|
10984
|
+
return;
|
|
10985
|
+
}
|
|
10986
|
+
if (isFinalizingKey) {
|
|
10987
|
+
if (!isTextarea) {
|
|
10988
|
+
eventHandler(event);
|
|
10989
|
+
return;
|
|
10990
|
+
}
|
|
10991
|
+
let lastValue = valueBefore != null ? valueBefore : "";
|
|
10992
|
+
let unchangedCount = 0;
|
|
10993
|
+
const REQUIRED_STABLE_FRAMES = 2;
|
|
10994
|
+
const checkFinal = () => {
|
|
10995
|
+
const currentValue = target.value;
|
|
10996
|
+
const stillFocused = doc.activeElement === target;
|
|
10997
|
+
const changed = currentValue !== lastValue;
|
|
10998
|
+
if (!stillFocused) {
|
|
10999
|
+
eventHandler(event);
|
|
11000
|
+
return;
|
|
11001
|
+
}
|
|
11002
|
+
if (!changed) {
|
|
11003
|
+
unchangedCount++;
|
|
11004
|
+
if (unchangedCount >= REQUIRED_STABLE_FRAMES) {
|
|
11005
|
+
eventHandler(event);
|
|
11006
|
+
return;
|
|
11007
|
+
}
|
|
11008
|
+
} else {
|
|
11009
|
+
unchangedCount = 0;
|
|
11010
|
+
lastValue = currentValue;
|
|
11011
|
+
}
|
|
11012
|
+
requestAnimationFrame(checkFinal);
|
|
11013
|
+
};
|
|
11014
|
+
requestAnimationFrame(checkFinal);
|
|
11015
|
+
return;
|
|
11016
|
+
}
|
|
11017
|
+
};
|
|
11018
|
+
handlers.push(
|
|
11019
|
+
on("keydown", callbackWrapper(keyboardHandler), doc)
|
|
11020
|
+
// on('keypress', callbackWrapper(keyboardHandler), doc),
|
|
11021
|
+
);
|
|
10948
11022
|
const currentWindow = doc.defaultView;
|
|
10949
11023
|
if (!currentWindow) {
|
|
10950
11024
|
return () => {
|
|
@@ -12932,13 +13006,14 @@ class VisibilityManager {
|
|
|
12932
13006
|
cancelAnimationFrame(this.rafId);
|
|
12933
13007
|
}
|
|
12934
13008
|
}
|
|
13009
|
+
const version$1 = "2.1.2-alpha.1";
|
|
12935
13010
|
let wrappedEmit;
|
|
12936
13011
|
let takeFullSnapshot$1;
|
|
12937
13012
|
let canvasManager;
|
|
12938
13013
|
let visibilityManager;
|
|
12939
13014
|
let recording = false;
|
|
12940
13015
|
const customEventQueue = [];
|
|
12941
|
-
let flushCustomEventQueue;
|
|
13016
|
+
let flushCustomEventQueue$1;
|
|
12942
13017
|
function waitForDOMStabilization(win) {
|
|
12943
13018
|
const maxWaitMs = 5e3;
|
|
12944
13019
|
return new Promise((resolve2) => {
|
|
@@ -13303,7 +13378,7 @@ function record(options = {}) {
|
|
|
13303
13378
|
mirror.getId(document)
|
|
13304
13379
|
);
|
|
13305
13380
|
};
|
|
13306
|
-
flushCustomEventQueue = () => {
|
|
13381
|
+
flushCustomEventQueue$1 = () => {
|
|
13307
13382
|
for (const e2 of customEventQueue) {
|
|
13308
13383
|
wrappedEmit(e2);
|
|
13309
13384
|
}
|
|
@@ -13437,37 +13512,34 @@ function record(options = {}) {
|
|
|
13437
13512
|
});
|
|
13438
13513
|
const init = () => {
|
|
13439
13514
|
if (flushCustomEvent === "before") {
|
|
13440
|
-
flushCustomEventQueue();
|
|
13515
|
+
flushCustomEventQueue$1();
|
|
13441
13516
|
}
|
|
13442
13517
|
takeFullSnapshot$1();
|
|
13443
13518
|
handlers.push(observe(document));
|
|
13444
13519
|
recording = true;
|
|
13445
13520
|
if (flushCustomEvent === "after") {
|
|
13446
|
-
flushCustomEventQueue();
|
|
13521
|
+
flushCustomEventQueue$1();
|
|
13447
13522
|
}
|
|
13448
13523
|
};
|
|
13449
13524
|
const runInit = async () => {
|
|
13450
13525
|
if (flushCustomEvent === "before") {
|
|
13451
|
-
flushCustomEventQueue();
|
|
13526
|
+
flushCustomEventQueue$1();
|
|
13452
13527
|
}
|
|
13453
13528
|
if (recordAfter === "DOMContentStabilized") {
|
|
13454
|
-
console.
|
|
13529
|
+
console.debug(\`[\${nowTimestamp()}] [rrweb:record] \\u{1F7E2} Waiting for DOM stabilization...\`);
|
|
13455
13530
|
await waitForDOMStabilization(window);
|
|
13456
|
-
console.
|
|
13531
|
+
console.debug(\`[\${nowTimestamp()}] [rrweb:record] \\u2705 DOM stabilized, starting recording\`);
|
|
13457
13532
|
}
|
|
13533
|
+
console.debug(\`[\${nowTimestamp()}] [rrweb:record] \\u2705 Init dom and takeFullSnapshot \`);
|
|
13458
13534
|
takeFullSnapshot$1();
|
|
13459
13535
|
handlers.push(observe(document));
|
|
13460
13536
|
recording = true;
|
|
13461
13537
|
if (flushCustomEvent === "after") {
|
|
13462
|
-
flushCustomEventQueue();
|
|
13538
|
+
flushCustomEventQueue$1();
|
|
13463
13539
|
}
|
|
13464
13540
|
};
|
|
13465
13541
|
if (document.readyState === "interactive" || document.readyState === "complete") {
|
|
13466
|
-
|
|
13467
|
-
void runInit();
|
|
13468
|
-
} else {
|
|
13469
|
-
init();
|
|
13470
|
-
}
|
|
13542
|
+
init();
|
|
13471
13543
|
} else {
|
|
13472
13544
|
handlers.push(
|
|
13473
13545
|
on("DOMContentLoaded", () => {
|
|
@@ -13475,9 +13547,8 @@ function record(options = {}) {
|
|
|
13475
13547
|
type: EventType.DomContentLoaded,
|
|
13476
13548
|
data: {}
|
|
13477
13549
|
});
|
|
13478
|
-
if (recordAfter === "DOMContentLoaded"
|
|
13479
|
-
|
|
13480
|
-
}
|
|
13550
|
+
if (recordAfter === "DOMContentLoaded")
|
|
13551
|
+
init();
|
|
13481
13552
|
})
|
|
13482
13553
|
);
|
|
13483
13554
|
handlers.push(
|
|
@@ -13489,14 +13560,14 @@ function record(options = {}) {
|
|
|
13489
13560
|
data: {}
|
|
13490
13561
|
});
|
|
13491
13562
|
if (recordAfter === "load")
|
|
13492
|
-
|
|
13563
|
+
init();
|
|
13493
13564
|
},
|
|
13494
13565
|
window
|
|
13495
13566
|
)
|
|
13496
13567
|
);
|
|
13497
13568
|
}
|
|
13498
13569
|
return () => {
|
|
13499
|
-
flushCustomEventQueue();
|
|
13570
|
+
flushCustomEventQueue$1();
|
|
13500
13571
|
handlers.forEach((h) => h());
|
|
13501
13572
|
processedNodeManager.destroy();
|
|
13502
13573
|
recording = false;
|
|
@@ -13506,10 +13577,11 @@ function record(options = {}) {
|
|
|
13506
13577
|
console.warn(error);
|
|
13507
13578
|
}
|
|
13508
13579
|
}
|
|
13580
|
+
record.getVersion = () => version$1;
|
|
13509
13581
|
record.isRecording = () => recording;
|
|
13510
13582
|
record.flushCustomEventQueue = () => {
|
|
13511
13583
|
console.warn(\`[rrweb] CustomEvent flushing: \${customEventQueue.length} events\`);
|
|
13512
|
-
flushCustomEventQueue();
|
|
13584
|
+
flushCustomEventQueue$1();
|
|
13513
13585
|
};
|
|
13514
13586
|
record.addCustomEvent = (tag, payload) => {
|
|
13515
13587
|
const customEvent = {
|
|
@@ -13559,5 +13631,5 @@ if (typeof module.exports == "object" && typeof exports == "object") {
|
|
|
13559
13631
|
return module.exports;
|
|
13560
13632
|
}))
|
|
13561
13633
|
//# sourceMappingURL=rrweb-record.umd.cjs.map
|
|
13562
|
-
`;var h=class{recordFn=null;stopFn=null;targetWindow=null;context;eventCounter=0;events=[];pendingEvents=[];constructor(){this.context={pushEvent:
|
|
13634
|
+
`;var j={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:"debounce",debounce:50,threshold:.5,sensitivity:.05,rafThrottle:50}},flushCustomEvent:"after",recordAfter:"DOMContentLoaded",userTriggeredOnInput:!0};function I(e,t){let r={...e};for(let n in t){let s=t[n],o=e[n];s&&typeof s=="object"&&!Array.isArray(s)&&o&&typeof o=="object"&&!Array.isArray(o)?r[n]=I(o,s):s!==void 0&&(r[n]=s)}return r}var h=class{recordFn=null;stopFn=null;targetWindow=null;context;eventCounter=0;events=[];recordOptions;pendingEvents=[];recorderScriptVersion="unknown";recorderLibVersion=$.version;constructor(t){this.recordOptions=I(j,t??{}),this.context={pushEvent:r=>this.events.push(r)}}handleEmit(t){if(t.type===0||t.type===1)return;let r={...t};this.context.pushEvent(r)}inject(t){let r=t;if(this.targetWindow=t,r.rrweb){this.recordFn=r.rrweb.record??null;return}let n=t.document.createElement("script");n.type="text/javascript",n.innerHTML=x,t.document.head.appendChild(n);let s=t.rrweb;if(!s||!s.record){console.error(`[${Date.now()}] [recorder] Failed to load rrweb.record`);return}this.recordFn=s.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,C.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 r of this.pendingEvents)try{this.recordFn.addCustomEvent(r.tag,r.payload)}catch{console.debug(`[${Date.now()}] [recorder] flush failed for custom event: ${r.tag}`),t.push(r)}this.pendingEvents=t}addCustomEvent(t,r){let n={tag:t,payload:r};if(!this.recordFn||!this.stopFn){console.debug(`[${Date.now()}] [recorder] queued custom event (recorder not ready): ${t}`),this.pendingEvents.push(n);return}try{this.recordFn.addCustomEvent(t,r)}catch(s){console.debug(`[${Date.now()}] [recorder] error adding custom event: ${t}`,s),this.pendingEvents.push(n)}}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 f=h;var y=Cypress.env("testmap")??{},V=typeof y=="object"&&"recordingOpts"in y?y.recordingOpts:f,i=new f(V),E=()=>{Cypress.on("test:before:run",H).on("log:added",G).on("log:changed",K).on("window:before:load",J).on("window:before:unload",Y).on("window:unload",Z).on("window:load",q).on("command:enqueued",Q).on("command:start",ee).on("command:end",te).on("command:retry",X).on("skipped:command:end",re).on("test:after:run",ie).on("command:failed",ne).on("command:queue:end",se).on("fail",oe),afterEach(()=>{let e=Cypress.currentTest;if(!e)return;let t=a({titlePath:()=>e.titlePath}),r=l(t);if(!r)return;r.recorderEvents.map(s=>{if(s.type!==5)return s;let o=r.commandLiveRefs.get(s.data.payload.id);return s.data.payload.state=o?.state??"unknown",s.data.payload.args=p(o?.get("args")),s.data.payload.query=o?.get("query"),s.data.payload.timeout=o?.get("timeout"),s.data.payload.name=o?.get("name"),s.data.payload.type=o?.get("type"),o?.get("prev")&&(s.data.payload.prev={state:o?.get("prev").state,name:o?.get("prev").get("name"),args:p(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")&&(s.data.payload.next={state:o?.get("next").state,name:o?.get("next").get("name"),args:p(o?.get("next").get("args")),type:o?.get("next").get("type"),query:o?.get("next").get("query"),id:o?.get("next").get("id")}),s}),console.debug(`[${Date.now()}] [cypress] afterEach:`,r.recorderEvents);let n=S(r);try{cy.task("saveRRWebReport",{testRunResult:n},{log:!1})}catch(s){console.error(`[${Date.now()}] [cypress] afterEach:saveRRWebReport`,s)}})},H=(e,t)=>{let r=a(t),n={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(r,n),i.bind({pushEvent:s=>{if(console.debug(`[${Date.now()}] [cypress] pushEvent`,s),n.recorderEvents.push(s),s.type===5){let u=n.commandLiveRefs.get(s.data.payload.id)?.get("subject"),m=u?.selector??w(u),d=i.getMirror()?.getMeta(u?.[0]);s.data.payload.element={...d,selector:m,childNodes:[]}}}})},G=(e,t)=>{},K=(e,t)=>{},Y=e=>{},Z=e=>{try{i.stop()}catch{}},J=e=>{i.inject(e);let t=Cypress.currentTest;if(!t)return;let r=a({titlePath:()=>t.titlePath}),n=l(r);n&&(n.runner.recorder.scriptVersion=i.getScriptVersion(),n.autWindow=e,n.paintComplete=!1)},q=e=>{console.debug(`[${Date.now()}] [cypress] onWindowLoad`,e);let t=Cypress.currentTest;if(!t)return;let r=a({titlePath:()=>t.titlePath}),n=l(r);n&&(n.autWindow||(n.autWindow=e,n.paintComplete=!1),n.waitForPaint=s=>new Promise(o=>{let m=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{o(s)})})},c=(()=>{let d=!1;return()=>{d||(d=!0,m())}})();["interactive","complete"].includes(e.document.readyState)?c():(e.addEventListener("DOMContentLoaded",c,{once:!0}),e.addEventListener("load",c,{once:!0}),setTimeout(()=>{console.warn("\u23F3 Timeout: forcing resolution"),c()},5e3))}),n.waitForPaint().then(async()=>{n.paintComplete=!0,i.inject(e),i.start()}))},Q=e=>{let t=Cypress.currentTest;if(!t)return;let r=a({titlePath:()=>t.titlePath}),n=l(r);n&&n.commandLiveRefs.set(e.id,e)},X=e=>{},ee=e=>{let t=Cypress.currentTest;if(!t)return;let r=a({titlePath:()=>t.titlePath}),n=l(r);n&&n.commandLiveRefs.set(e.attributes.id,e)},te=e=>{console.debug(`[${Date.now()}] [cypress] onCommandEnd`,e);let t=Cypress.currentTest;if(!t)return;let r=a({titlePath:()=>t.titlePath}),n=l(r);if(!n)return;(async()=>{!n.paintComplete&&typeof n.waitForPaint=="function"&&(await n.waitForPaint(),n.paintComplete=!0)})(),i.addCustomEvent(`${e.attributes.name}`,{id:e.attributes.id})},ne=(e,t)=>{console.debug(`[${Date.now()}] [cypress] onCommandFailed`,e),i.addCustomEvent(`${e.attributes.name}`,{id:e.attributes.id})},re=e=>{console.debug(`[${Date.now()}] [cypress] onSkippedCommandEnd`,e);let t=Cypress.currentTest;if(!t)return;let r=a({titlePath:()=>t.titlePath}),n=l(r);n&&(n.commandLiveRefs.set(e.attributes.id,e),i.addCustomEvent(`${e.attributes.name}`,{id:e.attributes.id}))},se=()=>{},oe=(e,t)=>{throw e},ie=async(e,t)=>{console.debug(`[${Date.now()}] [cypress] onTestAfterRun`,e,t),i.stop()};var _=()=>{Cypress.mocha.getRunner().on("hook",ae)},ae=()=>{},R=()=>{beforeEach("",()=>{}),afterEach("",()=>{})};var T=()=>{E(),_(),R()};var M=()=>{T()};0&&(module.exports={initializeTestmap});
|
|
13563
13635
|
//# sourceMappingURL=index.js.map
|