@checksum-ai/runtime 1.1.44 → 1.1.46
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/cli.js +2 -2
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -142,10 +142,10 @@ show-report [options] [report] show HTML report
|
|
|
142
142
|
${variablesString}
|
|
143
143
|
return [${matcherParamsString}];
|
|
144
144
|
})()`):[];return{notPrefix,matcherMethodName,matcherParamsArray}},"parseMatcherClause");var sc=class sc{constructor(t=void 0){this.appRules=t}generateAssertionCode(t){return Ch(t)}static getOppositeMatcherClause(t){if(t.startsWith("not."))return t.replace(/^not\./,"");let r=[...sc.OPPOSITE_MATCHERS.keys()].find(i=>t.startsWith(i));if(!r)return`not.${t}`;let a=sc.OPPOSITE_MATCHERS.get(r);return t.replace(r,a)}};n(sc,"AssertionCodeGenerator"),sc.OPPOSITE_MATCHERS=new Map([["toBeDisabled","toBeEnabled"],["toBeEnabled","toBeDisabled"],["toBeVisible","toBeHidden"],["toBeHidden","toBeVisible"]]);var kh=sc;var mn=require("@playwright/test"),Fy=qe(WM());var Dy=class Dy{constructor(t){this.options=t;this.harData={methodIndex:{GET:0,POST:0,PUT:0,DELETE:0}};this.interceptors={recordHar:this.harInterceptor.bind(this),completeOriginHeader:this.completeOriginHeaderInterceptor.bind(this)};this.intercept=n(async(t,r,a)=>{let i=[],o=n(s=>{if(s)switch(s.type){case"abort":return t.abort(s.errorCode);case"fulfill":return t.fulfill(s.fulfillOptions);default:case"continue":i.push(s)}},"processResult");for(let[s,c]of Object.entries(this.interceptors))if(this.options[s]){let d=o(await c(t,r,a));if(d)return d}return this.applyContinueResults(t,i)},"intercept")}setOptions(t){this.options=t}mergeOptions(t){this.options={...this.options,...t}}applyContinueResults(t,r){let a=r.filter(o=>!!o),i={};return a.forEach(o=>{o.options&&(o.options.headers&&(i.headers={...i.headers,...o.options.headers}),o.options.method&&(i.method=o.options.method),o.options.postData&&(i.postData=o.options.postData),o.options.url&&(i.url=o.options.url))}),t.continue(i)}async harInterceptor(t){let r=t.request().headers(),a=t.request().method();return r["Checksum-Id"]=(++this.harData.methodIndex[a]).toString(),{options:{headers:r}}}async completeOriginHeaderInterceptor(t,r,{page:a}){let i=t.request().headers();if(!i.Origin){try{let o=new URL(a.url()).origin;i.Origin=o}catch{}return{options:{headers:i}}}}};n(Dy,"RouteInterceptors");var Dh=Dy;var Ly=class Ly{constructor(t={},r={}){this.browserConfig={devtools:!1,executablePath:process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH??void 0};this.options={fullScreenResolution:!1,defaultTimeout:3e4,defaultNavigationTimeout:3e4,disableWebSecurity:!0};this.contextClosePromise=void 0;this.eventListeners=[];this.lastSnapshot={selector:void 0,eventCode:void 0};this.snapshotTimeout=3e4;this.cacheScript=!1;this.pagesIndexToGuid={};this.framesMessageBroker=new dd;this.onRequestFinished=n(async t=>{try{let r=await t.response();if(!r.ok())return;let a=t.resourceType(),i=t.url(),o=n(async()=>{try{return await r.text()}catch{try{return await(await fetch(i)).text()}catch{return}}},"getBody");if(["document","script","stylesheet"].includes(a))try{let s=await o();if(!s)return;let c={url:i,source:s,type:a};await this.forEachEventListener(d=>{var u;return(u=d.onWebDriverResourceLoaded)==null?void 0:u.call(d,c)})}catch(s){console.error("[WebDriver] requestfinished event handler error",a,i,s)}}catch(r){console.error("[WebDriver] requestfinished event handler error",r)}},"onRequestFinished");this.onFrameNavigated=n(async t=>{let r=n(async a=>{await this.forEachEventListener(i=>{var o;return(o=i.onWebDriverFrameNavigated)==null?void 0:o.call(i,t,a)})},"notifyFrameNavigated");await r(!1),await this.injectedScriptManager.onFrameNavigated(t),await r(!0)},"onFrameNavigated");this.tracing=!1;this.tracingChunk=!1;this.chunkIndex=0;var a;if(this.options={...this.options,...t},this.browserConfig={...this.browserConfig,...r},this.injectedScriptManager=new ld(this.options),this.browserConfig.args||(this.browserConfig.args=[]),this.options.disableWebSecurity&&this.browserConfig.args.push("--disable-web-security"),this.options.allowFileAccess&&this.browserConfig.args.push("--allow-file-access-from-files"),this.browserConfig.args.push("--disable-site-isolation-trials"),this.browserConfig.args.push("--allow-running-insecure-content"),this.options.remoteDebugging&&this.browserConfig.args.push("--remote-debugging-port=9222"),this.options.forceHeadless&&(this.browserConfig.headless=!0,this.browserConfig.devtools=!1),this.options.useProxy)if((a=this.options.webProxy)!=null&&a.server){console.log("[WebDriver] using proxy");let{server:i,username:o,password:s}=this.options.webProxy;this.browserConfig.proxy={server:i,username:o,password:s},this.browserConfig.args.push("--proxy-bypass-list=localhost,127.0.0.1")}else console.error("[WebDriver] useProxy=true but proxy not configured");this.routeInterceptor=new Dh({completeOriginHeader:this.options.completeOriginHeader,recordHar:this.options.recordHAR})}async prepare({storageState:t,baseURL:r}={}){if(await this.shutdown(),this.options.useStealth){let i=require("puppeteer-extra-plugin-stealth");Fy.chromium.use(i()),this.browser=await Fy.chromium.launch(this.browserConfig)}else this.browser=await mn.chromium.launch(this.browserConfig);let a={};return a.bypassCSP=!0,a.ignoreHTTPSErrors=!0,a.baseURL=r??this.options.baseURL,this.options.timezoneId&&(a.timezoneId=this.options.timezoneId),this.options.viewport?a.viewport=this.options.viewport:this.options.fullScreenResolution?a.viewport={width:1280,height:720}:this.options.hostWindowViewport&&(a.viewport=null),t&&(a.storageState=t),this.context=await this.browser.newContext(a),this.options.defaultTimeout&&this.context.setDefaultTimeout(this.options.defaultTimeout),this.options.defaultNavigationTimeout&&this.context.setDefaultNavigationTimeout(this.options.defaultNavigationTimeout),this.context.on("page",async i=>{await this.onNewPage(i),await this.onFrameNavigated(i.mainFrame()),i.on("framenavigated",this.onFrameNavigated)}),this.context.on("close",async()=>{this.contextClosePromise=this.forEachEventListener(i=>{var o;return(o=i.onWebDriverContextClose)==null?void 0:o.call(i)})}),this.activePage=await this.context.newPage(),this.originalPage=this.activePage,this.options.trackLoadedResources&&this.page.on("requestfinished",this.onRequestFinished),this.options.useCDPSession&&(this.cdpSession=await this.context.newCDPSession(this.page)),!0}get frameMsgBroker(){return this.framesMessageBroker}async onNewPage(t){try{await(t==null?void 0:t.route("**/*",async(r,a)=>this.routeInterceptor.intercept(r,a,{page:t})))}catch(r){console.error("[WebDriver] onPage error",r)}}switchActivePage(t){let r=this.context.pages().find(a=>Zt(a)===t);return!r||r.isClosed()?(console.error(`[WebDriver] Page with guid ${t} not found or has been closed.`),!1):(this.previousPage=this.activePage,this.activePage=r,!0)}getDefaultTimeout(){return this.options.defaultTimeout}getDefaultNavigationTimeout(){return this.options.defaultNavigationTimeout}async addHARMockAPIRecordings(t){if(!this.activePage){console.warn("[addHARMockAPIRecordings] Active page is not set, skipping HAR recording.");return}await this.activePage.routeFromHAR(t,{url:/^(?!.*\.(js|mjs|ts|jsx|tsx|css|jpg|jpeg|png|gif|svg|webp|heif|heic|raw|cr2|nef|arw|bmp|tiff|tif|ico|woff|woff2|ttf|otf|doc|docx|pdf|ws|wasm|mp3|wav|aac|flac|mp4|avi|mov|wmv|flv|zip|rar|7z|tar\.gz|xml|html|py|java|cpp|xls|xlsx|ppt|pptx|gif)$)/i,update:!0,updateMode:"minimal"})}forEachEventListener(t){return Promise.all(this.eventListeners.map(async r=>{try{await t(r)}catch(a){console.log("WebDriver/forEachEventListener exception",a)}}))}registerEventListener(t){this.eventListeners.push(t)}async getScript(){async function t(r){let{exec:a}=require("child_process");return new Promise((i,o)=>{a(r,s=>{s?(console.log("error executing cmd, ",s),o(s)):i()})})}switch(n(t,"execCmd"),this.options.scriptSource){case"file":return this.options.scriptFile;case"url":if(this.cacheScript)return this.options.scriptFile;try{return await t(`curl -o ${this.options.scriptFile} '${this.options.scriptURL}'`),this.options.scriptFile}catch(r){console.log("[web-driver] Failed fetching frontend script",r)}break}}async startJSCoverageTracking(){return await this.page.coverage.startJSCoverage(),[];return await this.cdpSession.send("Debugger.enable"),await this.cdpSession.send("Profiler.enable"),await this.cdpSession.send("Profiler.startPreciseCoverage",{callCount:!1,detailed:!0}),this.getCurrentJSCoverage()}stopJSCoverageTracking(){return this.page.coverage.stopJSCoverage()}async getCurrentJSCoverage(){let t=await this.page.coverage.stopJSCoverage();return await this.page.coverage.startJSCoverage(),t;return(await this.cdpSession.send("Profiler.takePreciseCoverage")).result}async startCSSCoverageTracking(){return await this.cdpSession.send("DOM.enable"),await this.cdpSession.send("CSS.enable"),await this.cdpSession.send("CSS.startRuleUsageTracking"),this.getCurrentCSSCoverage()}async getCurrentCSSCoverage(){return(await this.cdpSession.send("CSS.takeCoverageDelta")).coverage}getCDPSession(){return this.cdpSession}async navigate(t){return this.page.goto(t)}async setViewportSize(t,r){return this.page.setViewportSize({width:t,height:r})}async getStorageState(){return this.page.context().storageState()}async shutdown(){try{this.page&&(await this.page.close(),this.activePage=void 0),this.context&&(await this.context.close(),this.context=void 0),this.browser&&(await this.browser.close(),this.browser=void 0)}catch(t){console.warn("[WebDriver] shutdown error",t)}}async wrapWithBrowserLogs(t,{disabled:r=!1,onErrorOnly:a=!1}={}){if(r)return t();let i=[],o=n(d=>{i.push(d.text())},"log");this.page.on("console",o);let s,c;try{c=await t()}catch(d){s=d}if(this.page.off("console",o),(!a||s)&&console.log("browser console messages:",i),s)throw s;return c}async takeElementSnapshot(t,r,a={},i={}){if(t===this.lastSnapshot.selector&&r===this.lastSnapshot.eventCode)return{};if(!t)return{};try{let{snapshot:o,elementLocator:s}=await this.takeSnapshot(t,i,{frameLocatorSelector:a.frameLocatorSelector});return this.lastSnapshot={selector:t,eventCode:r},{snapshot:o,elementLocator:s}}catch(o){return console.error("takeElementSnapshot error",o),{}}}getScreenshotTimeout(t=!1){return t?this.snapshotTimeout:this.snapshotTimeout+5e3}async takePageSnapshot(t){let r=this.page.screenshot({...t,timeout:this.getScreenshotTimeout()});return await Promise.race([r,xe(this.getScreenshotTimeout(!0))])}async takeSnapshot(t,r,{frameLocatorSelector:a}={}){let i=a?this.page.frameLocator(a).locator(t):this.page.locator(t),o=i.screenshot({...r,timeout:this.getScreenshotTimeout()});return{snapshot:await Promise.race([o,xe(this.getScreenshotTimeout(!0))]),elementLocator:i}}async getCurrentURL(){return this.page.url()}async getClientScreenResolution(){return await this.page.evaluate(async()=>({width:window.screen.width,height:window.screen.height}))}async awaitContextClose(){return this.contextClosePromise||await xe(100),this.contextClosePromise}get page(){return this.activePage}getPage(){return this.activePage}startPlaywrightTrace(){return this.tracing=!0,this.context.tracing.start({name:"trace",screenshots:!0,snapshots:!0})}startPlaywrightTraceChunk(){return this.tracingChunk=!0,this.context.tracing.startChunk({name:`trace-chunk-${this.chunkIndex}`})}stopPlaywrightTraceChunk(t){return this.tracingChunk=!1,this.context.tracing.stopChunk({path:`${t.replace(".zip",`.${this.chunkIndex++}.zip`)}`})}stopPlaywrightTrace(t){return this.tracing=!1,this.context.tracing.stop({path:t})}isTracing(){return this.tracing}isTracingChunk(){return this.tracingChunk}};n(Ly,"WebDriver");var Fh=Ly;var Jd=require("jsdom");var My=class My{constructor(t){this.activeDOMType="checksumIds";this.rawReducedHTMLDom=new Jd.JSDOM(t),this.process()}process(){this.expandedChecksumIdsReducedDom=new Jd.JSDOM(this.rawReducedHTMLDom.serialize()),this.reducedHTMLDom=new Jd.JSDOM(this.rawReducedHTMLDom.serialize()),this.rrwebIdsReducedDom=new Jd.JSDOM(this.rawReducedHTMLDom.serialize());let t=n(s=>{s.window.document.body.querySelectorAll("[checksumid]:not([checksuminteractable])").forEach(d=>{d.removeAttribute("checksumid")})},"removeChecksumIdAttributeFromNonInteractable"),r=n((s,c)=>c.window.document.body.querySelectorAll(`[${s}]`).forEach(d=>d.removeAttribute(s)),"removeAttributeFromAllElements"),a=n(s=>r("checksuminteractable",s),"removeChecksumInteractableAttribute"),i=n(s=>r("checksumid",s),"removeChecksumIdAttribute"),o=n(s=>r("rrwebid",s),"removeRrwebIdAttribute");t(this.reducedHTMLDom),a(this.expandedChecksumIdsReducedDom),a(this.reducedHTMLDom),a(this.rrwebIdsReducedDom),o(this.expandedChecksumIdsReducedDom),o(this.reducedHTMLDom),i(this.rrwebIdsReducedDom)}getDOMForType(t){switch(t){default:case"checksumIds":return this.reducedHTMLDom;case"expandedChecksumIds":return this.expandedChecksumIdsReducedDom;case"rrwebIds":return this.rrwebIdsReducedDom}}async enrich(t){return await t(this.rawReducedHTMLDom),this.process(),this}setActiveDomType(t){this.activeDOMType=t}getActiveDom(){return this.getDOMForType(this.activeDOMType)}getActiveDOMString(){return this.getActiveDom().serialize()}getRrwebIdsReducedDomString(){return this.rrwebIdsReducedDom.serialize()}getDOMStringForType(t){return this.getDOMForType(t).serialize()}get raw(){return this.rawReducedHTMLDom}};n(My,"ReducedHTMLDOM");var dc=My;var Ny=class Ny{constructor(t,r,a,i,o={logPerformance:!1}){this.timeMachine=t;this.actionsManager=r;this.apiService=a;this.remoteSessionId=i;this.options=o;this.currentChecksumId="0"}rewriteLastActionThought(t){throw new Error("Method not implemented.")}async generatePromptData(t,r,a){if(this.promptData)return{...this.promptData,assertionsData:r};let i=this.getActionTimestamps(t,a);if(!i)return;let o=await this.getReducedHTMLForTimestamp(i.before),s=await this.getReducedHTMLForTimestamp(i.after);return this.promptData={reduction:{reducedHTML:s,flashingHTML:[]},currentURL:"",previousReducedHTML:o,previousURL:"",actionId:t,assertionsData:r,timestamp:i.after},this.promptData}async callApi(t,r,a,i){let o=Date.now(),s=await this.generatePromptData(r,a,i);if(this.logPerformance(`- Generated prompt data for ${t}`,o),!s)return;o=Date.now();let c=await this.apiService.post(`assertions/${t}`,{sessionId:this.remoteSessionId,data:s});if(!c.ok){console.error(`Request for assertion generation ${t} failed with status ${c.status}`);return}let d=await c.json();return this.logPerformance(`- Received response for assertion generation ${t}`,o),d}async generateAssertions(t,r){try{let a=await this.callApi("generate",t,void 0,r);if(a)return a.timestamps=this.getActionTimestamps(t,r),a}catch(a){throw console.error(a),a}}async refactoringAssertions(t){try{return await this.callApi("refactor",t.actionId,t)}catch(r){throw console.error(r),r}}async filteringAssertions(t){try{return await this.callApi("filter",t.actionId,t)}catch(r){throw console.error(r),r}}async getReducedHTMLWithRetries(t,{retriesLeft:r=3,retryWaitMS:a=1e3}={}){try{let{reducedHTML:i,currentChecksumId:o}=await t.evaluate(async s=>{var c,d;return(d=(c=window==null?void 0:window.checksum)==null?void 0:c.testGenerator)==null?void 0:d.reduceHTML({},s)},{stopFlashingElementsDetection:!0,assignChecksumIdsToAllElements:!0,initialChecksumId:this.currentChecksumId,fromTimeMachine:!0});return this.currentChecksumId=o,{reducedHTML:i}}catch(i){if(r>0)return await xe(a),this.getReducedHTMLWithRetries(t,{retriesLeft:r-1,retryWaitMS:a});throw i}}async getReducedHTMLForTimestamp(t){return this.timeMachine.executeTask(async r=>{let a="",i=await this.getReducedHTMLWithRetries(r);return a=i==null?void 0:i.reducedHTML,new dc(a).getRrwebIdsReducedDomString()},t,{name:"getReducedHTMLForTimestamp"})}getVariables(){return[]}getVariablesString(t){return""}getActionTimestamps(t,r){let a=this.actionsManager.actions,i=a.findIndex(c=>c.id===t);if(i===-1){console.log(`[init] No action with id ${t} was found in executed actions`);return}let o=a[i],s=a[i+1];return{before:o.timestamp,after:(s==null?void 0:s.timestamp)??r}}logPerformance(t,r){this.options.logPerformance&&console.log(`${t} in`,Date.now()-r,"ms")}};n(Ny,"AssertionsAgent");var Lh=Ny;var JDe=mn.expect.configure({timeout:500}),_VtgAiAssertionsService=class _VtgAiAssertionsService extends no{constructor(t,r,a,i,o,s={logPerformance:!1}){super(t,r,a);this.actionsManager=t;this.apiService=r;this.userStoryService=a;this.timeMachine=i;this.webDriver=o;this.options=s;this.activeRemoteSessionIdByActionId=new Map}async init({retriesLeft:t=3,keepActionsWithoutDescription:r=!1,lastActionId:a=void 0}={}){await super.init({retriesLeft:t,keepActionsWithoutDescription:r,lastActionId:a}),this.activeRemoteSessionIdByActionId.set(a,this.remoteSessionId)}async generateAiAssertions({action:t,aiAssertionsGenerationStartedAt:r}){this.options.logPerformance&&console.log(`generateAiAssertions for action ${t.id}`);let a=n(async(i=[],o=!1)=>{let s=i.map((c,d)=>({...c,id:(Date.now()+d).toString()})).filter(c=>{var d;return!["withChecksumAI()","withChecksumAI"].includes(c.matcher)&&!((d=c.usedVariablesNames)!=null&&d.length)});return await this.webDriver.page.evaluate(({assertions:c,actionId:d,error:u})=>{window.vtg.onAIAssertionsGenerated(d,c,u)},{assertions:s,actionId:t.id,error:o}),s.forEach(c=>{this.actionsManager.addOrUpdateAssertionByActionId(t.id,c)}),s},"sendResultToVTG");if(this.isRunning(t.id))return console.log("Already generating assertions for this action"),a();try{let i=Date.now();if(await this.init({keepActionsWithoutDescription:!0,lastActionId:t.id}),this.logPerformance(`init for action ${t.id}`,i),!this.isRunning(t.id))return a();let o=new Lh(this.timeMachine,this.actionsManager,this.apiService,this.remoteSessionId),s=await this.generateAssertions(o,t.id,r);if(!s||!this.isRunning(t.id))return a();if(s.assertions.length===0){let{smartAssertion:c}=s;return c?(c.isSelected=!0,a([c])):a()}return ze.vtg.aiAssertions.allowRefactoring&&(s=await this.refactoringAssertions(o,s)),!this.isRunning(t.id)||(s=await this.filteringAssertions(o,s),!this.isRunning(t.id))?a():(this.logPerformance(`---------------- Overall - Generated assertions for action ${t.id} in`,i),a(wM(s)))}catch(i){return console.error("Error in AI assertions generation",i),a([],!0)}finally{this.activeRemoteSessionIdByActionId.delete(t.id)}}stopGenerateAiAssertions({action:t}){this.activeRemoteSessionIdByActionId.delete(t.id)}isRunning(t){return this.activeRemoteSessionIdByActionId.has(t)}async generateAssertions(t,r,a=void 0){let i=Date.now(),o=i,s=await t.generateAssertions(r,a);if(this.logPerformance(`- generateAssertions for action ${r}`,i),!!s)return i=Date.now(),await this.setSelectionDataForAssertions(s),this.logPerformance(`- setSelectionData for action ${r}`,i),i=Date.now(),await this.validateAssertions(s.assertions,s.timestamps,t),this.logPerformance(`- validate assertions for action ${r}`,i),this.logPerformance(`Overall - Generated assertions for action ${r}`,o),s}async refactoringAssertions(t,r){let a=Date.now(),i=a;try{this.options.logPerformance&&console.log(`Refactoring assertions for action ${r.actionId}`),r=await t.refactoringAssertions(r),this.logPerformance(`- refactoringAssertions for action ${r.actionId}`,a),a=Date.now(),await this.validateAssertions(r.assertions,r.timestamps,t),this.logPerformance(`- validate assertions after refactoring for action ${r.actionId}`,a),this.logPerformance(`Overall - Refactored assertions for action ${r.actionId}`,i)}catch(o){console.error("[refactoringAssertions] Error in assertions refactoring",o)}return r}async filteringAssertions(t,r){try{let a=Date.now();this.options.logPerformance&&console.log(`Filtering assertions for action ${r.actionId}`);let i=await t.filteringAssertions(r);return this.logPerformance(`Overall - filteringAssertions for action ${r.actionId}`,a),i}catch(a){console.error("[filteringAssertions] Error in assertions filtering",a)}}async executeAssertion(assertion,timeMachine,agent){let variablesString=agent.getVariablesString(!0),page=timeMachine,executeMatcherCode=`
|
|
145
|
-
(async () => {
|
|
145
|
+
(async (expect) => {
|
|
146
146
|
${variablesString}
|
|
147
147
|
${vy(Ch(assertion))}
|
|
148
|
-
})()
|
|
148
|
+
})(expect)
|
|
149
149
|
`;await eval(executeMatcherCode)}async validateLocatorMappedToCorrectRrwebId(t,r,a){if(t.locatorMappedToCorrectRrwebId)return;if(!await this.isLocatorMappedToCorrectRrwebId(t,r,a))return t.locatorMappedToCorrectRrwebId=!1,this.handleAssertionValidityError(new Error(`Locator not mapped to correct rrweb id for assertion: ${t.matcher}`),t,"locator not mapped to correct rrweb id")}async validateAssertionOnPreviousState(t,r,a){try{let i=await this.getLocatorsForLocatorString(t,r,a);if(i.length===0){if(my(t)&&!t.appliedBeforeAction)throw new Error(`Element not found before action for assertion: ${t.matcher}`);return}await Promise.all(i.map(async o=>{let s={...t,locator:o.toString(),matcher:t.appliedBeforeAction?t.matcher:kh.getOppositeMatcherClause(t.matcher)};await this.executeAssertion(s,r,a)}))}catch(i){this.handleAssertionValidityError(i,t,t.appliedBeforeAction?"didn't apply BEFORE the action was executed and it should have":"applied BEFORE the action was executed and it shouldn't have")}}async validateAssertionOnCurrentState(t,r,a){try{await this.executeAssertion(t,r,a)}catch(i){this.handleAssertionValidityError(i,t,"didn't apply AFTER the action")}}async getLocatorRrwebIds(t,r,a){let i=await this.getLocatorsForLocatorString(t,r,a);return await Promise.all(i.map(o=>o.evaluate(s=>s._rrwebid)))}async getLocatorsForLocatorString(assertion,timeMachine,agent){if(Hd(assertion))return[];let locator=assertion.locator;if(!locator)return[];let variablesString=agent.getVariablesString(!0),page=timeMachine,getLocatorsScript=`
|
|
150
150
|
(async () => {
|
|
151
151
|
${variablesString}
|