@checksum-ai/runtime 1.2.6-alpha → 1.2.7-alpha
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/.env +1 -1
- package/index.js +94 -94
- package/package.json +1 -1
- package/test-run-monitor.js +17 -15
- package/vtg-pw-bridge-runner.js +1 -1
package/vtg-pw-bridge-runner.js
CHANGED
|
@@ -1810,7 +1810,7 @@ Executing locator ${this.getCurrentLocatorInChain().type} with ${typeof t=="stri
|
|
|
1810
1810
|
`,rda=c_t.encode(E4e),nda=2,SMr=class SMr{constructor(t,n){let{escapeName:a}=this.constructor,o=dp.isString(n),c=`Content-Disposition: form-data; name="${a(t)}"${!o&&n.name?`; filename="${a(n.name)}"`:""}${E4e}`;o?n=c_t.encode(String(n).replace(/\r?\n|\r\n?/g,E4e)):c+=`Content-Type: ${n.type||"application/octet-stream"}${E4e}`,this.headers=c_t.encode(c+E4e),this.contentLength=o?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+nda,this.name=t,this.value=n}async*encode(){yield this.headers;let{value:t}=this;dp.isTypedArray(t)?yield t:yield*Hqt(t),yield rda}static escapeName(t){return String(t).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}};e(SMr,"FormDataPart");var wMr=SMr,ida=e((i,t,n)=>{let{tag:a="form-data-boundary",size:o=25,boundary:c=a+"-"+dp.generateString(o,tda)}=n||{};if(!dp.isFormData(i))throw TypeError("FormData instance required");if(c.length<1||c.length>70)throw Error("boundary must be 10-70 characters long");let f=c_t.encode("--"+c+E4e),m=c_t.encode("--"+c+"--"+E4e+E4e),x=m.byteLength,C=Array.from(i.entries()).map(([k,I])=>{let M=new wMr(k,I);return x+=M.size,M});x+=f.byteLength*C.length,x=dp.toFiniteNumber(x);let S={"Content-Type":`multipart/form-data; boundary=${c}`};return Number.isFinite(x)&&(S["Content-Length"]=x),t&&t(S),kRn.Readable.from(async function*(){for(let k of C)yield f,yield*k.encode();yield m}())},"formDataToStream"),IRn=ida;var PRn=Ad(require("stream"),1);var TMr=class TMr extends PRn.default.Transform{__transform(t,n,a){this.push(t),a()}_transform(t,n,a){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let o=Buffer.alloc(2);o[0]=120,o[1]=156,this.push(o,n)}this.__transform(t,n,a)}};e(TMr,"ZlibHeaderTransformStream");var DMr=TMr,FRn=DMr;var ada=e((i,t)=>dp.isAsyncFn(i)?function(...n){let a=n.pop();i.apply(this,n).then(o=>{try{t?a(null,...t(o)):a(null,o)}catch(c){a(c)}},a)}:i,"callbackify"),NRn=ada;function sda(i,t){i=i||10;let n=new Array(i),a=new Array(i),o=0,c=0,f;return t=t!==void 0?t:1e3,e(function(x){let C=Date.now(),S=a[c];f||(f=C),n[o]=x,a[o]=C;let k=c,I=0;for(;k!==o;)I+=n[k++],k=k%i;if(o=(o+1)%i,o===c&&(c=(c+1)%i),C-f<t)return;let M=S&&C-S;return M?Math.round(I*1e3/M):void 0},"push")}e(sda,"speedometer");var ORn=sda;function oda(i,t){let n=0,a=1e3/t,o,c,f=e((C,S=Date.now())=>{n=S,o=null,c&&(clearTimeout(c),c=null),i.apply(null,C)},"invoke");return[e((...C)=>{let S=Date.now(),k=S-n;k>=a?f(C,S):(o=C,c||(c=setTimeout(()=>{c=null,f(o)},a-k)))},"throttled"),e(()=>o&&f(o),"flush")]}e(oda,"throttle");var BRn=oda;var kve=e((i,t,n=3)=>{let a=0,o=ORn(50,250);return BRn(c=>{let f=c.loaded,m=c.lengthComputable?c.total:void 0,x=f-a,C=o(x),S=f<=m;a=f;let k={loaded:f,total:m,progress:m?f/m:void 0,bytes:x,rate:C||void 0,estimated:C&&m&&S?(m-f)/C:void 0,event:c,lengthComputable:m!=null,[t?"download":"upload"]:!0};i(k)},n)},"progressEventReducer"),Oze=e((i,t)=>{let n=i!=null;return[a=>t[0]({lengthComputable:n,total:i,loaded:a}),t[1]]},"progressEventDecorator"),Bze=e(i=>(...t)=>dp.asap(()=>i(...t)),"asyncDecorator");var RRn={flush:Ive.default.constants.Z_SYNC_FLUSH,finishFlush:Ive.default.constants.Z_SYNC_FLUSH},uda={flush:Ive.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ive.default.constants.BROTLI_OPERATION_FLUSH},LRn=dp.isFunction(Ive.default.createBrotliDecompress),{http:cda,https:lda}=JRn.default,pda=/https:?/,MRn=t4.protocols.map(i=>i+":"),jRn=e((i,[t,n])=>(i.on("end",n).on("error",n),t),"flushOnFinish");function fda(i,t){i.beforeRedirects.proxy&&i.beforeRedirects.proxy(i),i.beforeRedirects.config&&i.beforeRedirects.config(i,t)}e(fda,"dispatchBeforeRedirect");function WRn(i,t,n){let a=t;if(!a&&a!==!1){let o=qRn.default.getProxyForUrl(n);o&&(a=new URL(o))}if(a){if(a.username&&(a.auth=(a.username||"")+":"+(a.password||"")),a.auth){(a.auth.username||a.auth.password)&&(a.auth=(a.auth.username||"")+":"+(a.auth.password||""));let c=Buffer.from(a.auth,"utf8").toString("base64");i.headers["Proxy-Authorization"]="Basic "+c}i.headers.host=i.hostname+(i.port?":"+i.port:"");let o=a.hostname||a.host;i.hostname=o,i.host=o,i.port=a.port,i.path=n,a.protocol&&(i.protocol=a.protocol.includes(":")?a.protocol:`${a.protocol}:`)}i.beforeRedirects.proxy=e(function(c){WRn(c,t,c.href)},"beforeRedirect")}e(WRn,"setProxy");var dda=typeof process<"u"&&dp.kindOf(process)==="process",_da=e(i=>new Promise((t,n)=>{let a,o,c=e((x,C)=>{o||(o=!0,a&&a(x,C))},"done"),f=e(x=>{c(x),t(x)},"_resolve"),m=e(x=>{c(x,!0),n(x)},"_reject");i(f,m,x=>a=x).catch(m)}),"wrapAsync"),mda=e(({address:i,family:t})=>{if(!dp.isString(i))throw TypeError("address must be a string");return{address:i,family:t||(i.indexOf(".")<0?6:4)}},"resolveFamily"),URn=e((i,t)=>mda(dp.isObject(i)?i:{address:i,family:t}),"buildAddressEntry"),HRn=dda&&e(function(t){return _da(e(async function(a,o,c){let{data:f,lookup:m,family:x}=t,{responseType:C,responseEncoding:S}=t,k=t.method.toUpperCase(),I,M=!1,B;if(m){let Ue=NRn(m,Nt=>dp.isArray(Nt)?Nt:[Nt]);m=e((Nt,At,Vt)=>{Ue(Nt,At,(pr,Cr,Ct)=>{if(pr)return Vt(pr);let gi=dp.isArray(Cr)?Cr.map(Tn=>URn(Tn)):[URn(Cr,Ct)];At.all?Vt(pr,gi):Vt(pr,gi[0].address,gi[0].family)})},"lookup")}let $=new zRn.EventEmitter,W=e(()=>{t.cancelToken&&t.cancelToken.unsubscribe(re),t.signal&&t.signal.removeEventListener("abort",re),$.removeAllListeners()},"onFinished");c((Ue,Nt)=>{I=!0,Nt&&(M=!0,W())});function re(Ue){$.emit("abort",!Ue||Ue.type?new hZ(null,t,B):Ue)}e(re,"abort"),$.once("abort",o),(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(re),t.signal&&(t.signal.aborted?re():t.signal.addEventListener("abort",re)));let oe=WIe(t.baseURL,t.url),pe=new URL(oe,t4.hasBrowserEnv?t4.origin:void 0),_e=pe.protocol||MRn[0];if(_e==="data:"){let Ue;if(k!=="GET")return J_e(a,o,{status:405,statusText:"method not allowed",headers:{},config:t});try{Ue=bMr(t.url,C==="blob",{Blob:t.env&&t.env.Blob})}catch(Nt){throw F1.from(Nt,F1.ERR_BAD_REQUEST,t)}return C==="text"?(Ue=Ue.toString(S),(!S||S==="utf8")&&(Ue=dp.stripBOM(Ue))):C==="stream"&&(Ue=YIe.default.Readable.from(Ue)),J_e(a,o,{data:Ue,status:200,statusText:"OK",headers:new JT,config:t})}if(MRn.indexOf(_e)===-1)return o(new F1("Unsupported protocol "+_e,F1.ERR_BAD_REQUEST,t));let Ee=JT.from(t.headers).normalize();Ee.set("User-Agent","axios/"+KIe,!1);let{onUploadProgress:Pe,onDownloadProgress:je}=t,Fe=t.maxRate,Re,ct;if(dp.isSpecCompliantForm(f)){let Ue=Ee.getContentType(/boundary=([-_\w\d]{10,70})/i);f=IRn(f,Nt=>{Ee.set(Nt)},{tag:`axios-${KIe}-boundary`,boundary:Ue&&Ue[1]||void 0})}else if(dp.isFormData(f)&&dp.isFunction(f.getHeaders)){if(Ee.set(f.getHeaders()),!Ee.hasContentLength())try{let Ue=await VRn.default.promisify(f.getLength).call(f);Number.isFinite(Ue)&&Ue>=0&&Ee.setContentLength(Ue)}catch{}}else if(dp.isBlob(f)||dp.isFile(f))f.size&&Ee.setContentType(f.type||"application/octet-stream"),Ee.setContentLength(f.size||0),f=YIe.default.Readable.from(Hqt(f));else if(f&&!dp.isStream(f)){if(!Buffer.isBuffer(f))if(dp.isArrayBuffer(f))f=Buffer.from(new Uint8Array(f));else if(dp.isString(f))f=Buffer.from(f,"utf-8");else return o(new F1("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",F1.ERR_BAD_REQUEST,t));if(Ee.setContentLength(f.length,!1),t.maxBodyLength>-1&&f.length>t.maxBodyLength)return o(new F1("Request body larger than maxBodyLength limit",F1.ERR_BAD_REQUEST,t))}let Le=dp.toFiniteNumber(Ee.getContentLength());dp.isArray(Fe)?(Re=Fe[0],ct=Fe[1]):Re=ct=Fe,f&&(Pe||Re)&&(dp.isStream(f)||(f=YIe.default.Readable.from(f,{objectMode:!1})),f=YIe.default.pipeline([f,new EMr({maxRate:dp.toFiniteNumber(Re)})],dp.noop),Pe&&f.on("progress",jRn(f,Oze(Le,kve(Bze(Pe),!1,3)))));let Ve;if(t.auth){let Ue=t.auth.username||"",Nt=t.auth.password||"";Ve=Ue+":"+Nt}if(!Ve&&pe.username){let Ue=pe.username,Nt=pe.password;Ve=Ue+":"+Nt}Ve&&Ee.delete("authorization");let Qe;try{Qe=zIe(pe.pathname+pe.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(Ue){let Nt=new Error(Ue.message);return Nt.config=t,Nt.url=t.url,Nt.exists=!0,o(Nt)}Ee.set("Accept-Encoding","gzip, compress, deflate"+(LRn?", br":""),!1);let $e={path:Qe,method:k,headers:Ee.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:Ve,protocol:_e,family:x,beforeRedirect:fda,beforeRedirects:{}};!dp.isUndefined(m)&&($e.lookup=m),t.socketPath?$e.socketPath=t.socketPath:($e.hostname=pe.hostname.startsWith("[")?pe.hostname.slice(1,-1):pe.hostname,$e.port=pe.port,WRn($e,t.proxy,_e+"//"+pe.hostname+(pe.port?":"+pe.port:"")+$e.path));let We,tt=pda.test($e.protocol);if($e.agent=tt?t.httpsAgent:t.httpAgent,t.transport?We=t.transport:t.maxRedirects===0?We=tt?$Rn.default:QRn.default:(t.maxRedirects&&($e.maxRedirects=t.maxRedirects),t.beforeRedirect&&($e.beforeRedirects.config=t.beforeRedirect),We=tt?lda:cda),t.maxBodyLength>-1?$e.maxBodyLength=t.maxBodyLength:$e.maxBodyLength=1/0,t.insecureHTTPParser&&($e.insecureHTTPParser=t.insecureHTTPParser),B=We.request($e,e(function(Nt){if(B.destroyed)return;let At=[Nt],Vt=+Nt.headers["content-length"];if(je||ct){let Tn=new EMr({maxRate:dp.toFiniteNumber(ct)});je&&Tn.on("progress",jRn(Tn,Oze(Vt,kve(Bze(je),!0,3)))),At.push(Tn)}let pr=Nt,Cr=Nt.req||B;if(t.decompress!==!1&&Nt.headers["content-encoding"])switch((k==="HEAD"||Nt.statusCode===204)&&delete Nt.headers["content-encoding"],(Nt.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":At.push(Ive.default.createUnzip(RRn)),delete Nt.headers["content-encoding"];break;case"deflate":At.push(new FRn),At.push(Ive.default.createUnzip(RRn)),delete Nt.headers["content-encoding"];break;case"br":LRn&&(At.push(Ive.default.createBrotliDecompress(uda)),delete Nt.headers["content-encoding"])}pr=At.length>1?YIe.default.pipeline(At,dp.noop):At[0];let Ct=YIe.default.finished(pr,()=>{Ct(),W()}),gi={status:Nt.statusCode,statusText:Nt.statusMessage,headers:new JT(Nt.headers),config:t,request:Cr};if(C==="stream")gi.data=pr,J_e(a,o,gi);else{let Tn=[],or=0;pr.on("data",e(function(An){Tn.push(An),or+=An.length,t.maxContentLength>-1&&or>t.maxContentLength&&(M=!0,pr.destroy(),o(new F1("maxContentLength size of "+t.maxContentLength+" exceeded",F1.ERR_BAD_RESPONSE,t,Cr)))},"handleStreamData")),pr.on("aborted",e(function(){if(M)return;let An=new F1("stream has been aborted",F1.ERR_BAD_RESPONSE,t,Cr);pr.destroy(An),o(An)},"handlerStreamAborted")),pr.on("error",e(function(An){B.destroyed||o(F1.from(An,null,t,Cr))},"handleStreamError")),pr.on("end",e(function(){try{let An=Tn.length===1?Tn[0]:Buffer.concat(Tn);C!=="arraybuffer"&&(An=An.toString(S),(!S||S==="utf8")&&(An=dp.stripBOM(An))),gi.data=An}catch(An){return o(F1.from(An,null,t,gi.request,gi))}J_e(a,o,gi)},"handleStreamEnd"))}$.once("abort",Tn=>{pr.destroyed||(pr.emit("error",Tn),pr.destroy())})},"handleResponse")),$.once("abort",Ue=>{o(Ue),B.destroy(Ue)}),B.on("error",e(function(Nt){o(F1.from(Nt,null,t,B))},"handleRequestError")),B.on("socket",e(function(Nt){Nt.setKeepAlive(!0,1e3*60)},"handleRequestSocket")),t.timeout){let Ue=parseInt(t.timeout,10);if(Number.isNaN(Ue)){o(new F1("error trying to parse `config.timeout` to int",F1.ERR_BAD_OPTION_VALUE,t,B));return}B.setTimeout(Ue,e(function(){if(I)return;let At=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",Vt=t.transitional||Ize;t.timeoutErrorMessage&&(At=t.timeoutErrorMessage),o(new F1(At,Vt.clarifyTimeoutError?F1.ETIMEDOUT:F1.ECONNABORTED,t,B)),re()},"handleRequestTimeout"))}if(dp.isStream(f)){let Ue=!1,Nt=!1;f.on("end",()=>{Ue=!0}),f.once("error",At=>{Nt=!0,B.destroy(At)}),f.on("close",()=>{!Ue&&!Nt&&re(new hZ("Request stream has been aborted",t,B))}),f.pipe(B)}else B.end(f)},"dispatchHttpRequest"))},"httpAdapter");var GRn=t4.hasStandardBrowserEnv?((i,t)=>n=>(n=new URL(n,t4.origin),i.protocol===n.protocol&&i.host===n.host&&(t||i.port===n.port)))(new URL(t4.origin),t4.navigator&&/(msie|trident)/i.test(t4.navigator.userAgent)):()=>!0;var KRn=t4.hasStandardBrowserEnv?{write(i,t,n,a,o,c){let f=[i+"="+encodeURIComponent(t)];dp.isNumber(n)&&f.push("expires="+new Date(n).toGMTString()),dp.isString(a)&&f.push("path="+a),dp.isString(o)&&f.push("domain="+o),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read(i){let t=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(i){this.write(i,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var YRn=e(i=>i instanceof JT?{...i}:i,"headersToObject");function Cce(i,t){t=t||{};let n={};function a(C,S,k,I){return dp.isPlainObject(C)&&dp.isPlainObject(S)?dp.merge.call({caseless:I},C,S):dp.isPlainObject(S)?dp.merge({},S):dp.isArray(S)?S.slice():S}e(a,"getMergedValue");function o(C,S,k,I){if(dp.isUndefined(S)){if(!dp.isUndefined(C))return a(void 0,C,k,I)}else return a(C,S,k,I)}e(o,"mergeDeepProperties");function c(C,S){if(!dp.isUndefined(S))return a(void 0,S)}e(c,"valueFromConfig2");function f(C,S){if(dp.isUndefined(S)){if(!dp.isUndefined(C))return a(void 0,C)}else return a(void 0,S)}e(f,"defaultToConfig2");function m(C,S,k){if(k in t)return a(C,S);if(k in i)return a(void 0,C)}e(m,"mergeDirectKeys");let x={url:c,method:c,data:c,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,responseEncoding:f,validateStatus:m,headers:e((C,S,k)=>o(YRn(C),YRn(S),k,!0),"headers")};return dp.forEach(Object.keys(Object.assign({},i,t)),e(function(S){let k=x[S]||o,I=k(i[S],t[S],S);dp.isUndefined(I)&&k!==m||(n[S]=I)},"computeConfigValue")),n}e(Cce,"mergeConfig");var Gqt=e(i=>{let t=Cce({},i),{data:n,withXSRFToken:a,xsrfHeaderName:o,xsrfCookieName:c,headers:f,auth:m}=t;t.headers=f=JT.from(f),t.url=zIe(WIe(t.baseURL,t.url),i.params,i.paramsSerializer),m&&f.set("Authorization","Basic "+btoa((m.username||"")+":"+(m.password?unescape(encodeURIComponent(m.password)):"")));let x;if(dp.isFormData(n)){if(t4.hasStandardBrowserEnv||t4.hasStandardBrowserWebWorkerEnv)f.setContentType(void 0);else if((x=f.getContentType())!==!1){let[C,...S]=x?x.split(";").map(k=>k.trim()).filter(Boolean):[];f.setContentType([C||"multipart/form-data",...S].join("; "))}}if(t4.hasStandardBrowserEnv&&(a&&dp.isFunction(a)&&(a=a(t)),a||a!==!1&&GRn(t.url))){let C=o&&c&&KRn.read(c);C&&f.set(o,C)}return t},"default");var hda=typeof XMLHttpRequest<"u",XRn=hda&&function(i){return new Promise(e(function(n,a){let o=Gqt(i),c=o.data,f=JT.from(o.headers).normalize(),{responseType:m,onUploadProgress:x,onDownloadProgress:C}=o,S,k,I,M,B;function $(){M&&M(),B&&B(),o.cancelToken&&o.cancelToken.unsubscribe(S),o.signal&&o.signal.removeEventListener("abort",S)}e($,"done");let W=new XMLHttpRequest;W.open(o.method.toUpperCase(),o.url,!0),W.timeout=o.timeout;function re(){if(!W)return;let pe=JT.from("getAllResponseHeaders"in W&&W.getAllResponseHeaders()),Ee={data:!m||m==="text"||m==="json"?W.responseText:W.response,status:W.status,statusText:W.statusText,headers:pe,config:i,request:W};J_e(e(function(je){n(je),$()},"_resolve"),e(function(je){a(je),$()},"_reject"),Ee),W=null}e(re,"onloadend"),"onloadend"in W?W.onloadend=re:W.onreadystatechange=e(function(){!W||W.readyState!==4||W.status===0&&!(W.responseURL&&W.responseURL.indexOf("file:")===0)||setTimeout(re)},"handleLoad"),W.onabort=e(function(){W&&(a(new F1("Request aborted",F1.ECONNABORTED,i,W)),W=null)},"handleAbort"),W.onerror=e(function(){a(new F1("Network Error",F1.ERR_NETWORK,i,W)),W=null},"handleError"),W.ontimeout=e(function(){let _e=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",Ee=o.transitional||Ize;o.timeoutErrorMessage&&(_e=o.timeoutErrorMessage),a(new F1(_e,Ee.clarifyTimeoutError?F1.ETIMEDOUT:F1.ECONNABORTED,i,W)),W=null},"handleTimeout"),c===void 0&&f.setContentType(null),"setRequestHeader"in W&&dp.forEach(f.toJSON(),e(function(_e,Ee){W.setRequestHeader(Ee,_e)},"setRequestHeader")),dp.isUndefined(o.withCredentials)||(W.withCredentials=!!o.withCredentials),m&&m!=="json"&&(W.responseType=o.responseType),C&&([I,B]=kve(C,!0),W.addEventListener("progress",I)),x&&W.upload&&([k,M]=kve(x),W.upload.addEventListener("progress",k),W.upload.addEventListener("loadend",M)),(o.cancelToken||o.signal)&&(S=e(pe=>{W&&(a(!pe||pe.type?new hZ(null,i,W):pe),W.abort(),W=null)},"onCanceled"),o.cancelToken&&o.cancelToken.subscribe(S),o.signal&&(o.signal.aborted?S():o.signal.addEventListener("abort",S)));let oe=u_t(o.url);if(oe&&t4.protocols.indexOf(oe)===-1){a(new F1("Unsupported protocol "+oe+":",F1.ERR_BAD_REQUEST,i));return}W.send(c||null)},"dispatchXhrRequest"))};var gda=e((i,t)=>{let{length:n}=i=i?i.filter(Boolean):[];if(t||n){let a=new AbortController,o,c=e(function(C){if(!o){o=!0,m();let S=C instanceof Error?C:this.reason;a.abort(S instanceof F1?S:new hZ(S instanceof Error?S.message:S))}},"onabort"),f=t&&setTimeout(()=>{f=null,c(new F1(`timeout ${t} of ms exceeded`,F1.ETIMEDOUT))},t),m=e(()=>{i&&(f&&clearTimeout(f),f=null,i.forEach(C=>{C.unsubscribe?C.unsubscribe(c):C.removeEventListener("abort",c)}),i=null)},"unsubscribe");i.forEach(C=>C.addEventListener("abort",c));let{signal:x}=a;return x.unsubscribe=()=>dp.asap(m),x}},"composeSignals"),ZRn=gda;var yda=e(function*(i,t){let n=i.byteLength;if(!t||n<t){yield i;return}let a=0,o;for(;a<n;)o=a+t,yield i.slice(a,o),a=o},"streamChunk"),vda=e(async function*(i,t){for await(let n of bda(i))yield*yda(n,t)},"readBytes"),bda=e(async function*(i){if(i[Symbol.asyncIterator]){yield*i;return}let t=i.getReader();try{for(;;){let{done:n,value:a}=await t.read();if(n)break;yield a}}finally{await t.cancel()}},"readStream"),kMr=e((i,t,n,a)=>{let o=vda(i,t),c=0,f,m=e(x=>{f||(f=!0,a&&a(x))},"_onFinish");return new ReadableStream({async pull(x){try{let{done:C,value:S}=await o.next();if(C){m(),x.close();return}let k=S.byteLength;if(n){let I=c+=k;n(I)}x.enqueue(new Uint8Array(S))}catch(C){throw m(C),C}},cancel(x){return m(x),o.return()}},{highWaterMark:2})},"trackStream");var Yqt=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",tLn=Yqt&&typeof ReadableStream=="function",xda=Yqt&&(typeof TextEncoder=="function"?(i=>t=>i.encode(t))(new TextEncoder):async i=>new Uint8Array(await new Response(i).arrayBuffer())),rLn=e((i,...t)=>{try{return!!i(...t)}catch{return!1}},"test"),Ada=tLn&&rLn(()=>{let i=!1,t=new Request(t4.origin,{body:new ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type");return i&&!t}),eLn=64*1024,IMr=tLn&&rLn(()=>dp.isReadableStream(new Response("").body)),Kqt={stream:IMr&&(i=>i.body)};Yqt&&(i=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Kqt[t]&&(Kqt[t]=dp.isFunction(i[t])?n=>n[t]():(n,a)=>{throw new F1(`Response type '${t}' is not supported`,F1.ERR_NOT_SUPPORT,a)})})})(new Response);var Eda=e(async i=>{if(i==null)return 0;if(dp.isBlob(i))return i.size;if(dp.isSpecCompliantForm(i))return(await new Request(t4.origin,{method:"POST",body:i}).arrayBuffer()).byteLength;if(dp.isArrayBufferView(i)||dp.isArrayBuffer(i))return i.byteLength;if(dp.isURLSearchParams(i)&&(i=i+""),dp.isString(i))return(await xda(i)).byteLength},"getBodyLength"),Cda=e(async(i,t)=>{let n=dp.toFiniteNumber(i.getContentLength());return n??Eda(t)},"resolveBodyLength"),nLn=Yqt&&(async i=>{let{url:t,method:n,data:a,signal:o,cancelToken:c,timeout:f,onDownloadProgress:m,onUploadProgress:x,responseType:C,headers:S,withCredentials:k="same-origin",fetchOptions:I}=Gqt(i);C=C?(C+"").toLowerCase():"text";let M=ZRn([o,c&&c.toAbortSignal()],f),B,$=M&&M.unsubscribe&&(()=>{M.unsubscribe()}),W;try{if(x&&Ada&&n!=="get"&&n!=="head"&&(W=await Cda(S,a))!==0){let Ee=new Request(t,{method:"POST",body:a,duplex:"half"}),Pe;if(dp.isFormData(a)&&(Pe=Ee.headers.get("content-type"))&&S.setContentType(Pe),Ee.body){let[je,Fe]=Oze(W,kve(Bze(x)));a=kMr(Ee.body,eLn,je,Fe)}}dp.isString(k)||(k=k?"include":"omit");let re="credentials"in Request.prototype;B=new Request(t,{...I,signal:M,method:n.toUpperCase(),headers:S.normalize().toJSON(),body:a,duplex:"half",credentials:re?k:void 0});let oe=await fetch(B),pe=IMr&&(C==="stream"||C==="response");if(IMr&&(m||pe&&$)){let Ee={};["status","statusText","headers"].forEach(Re=>{Ee[Re]=oe[Re]});let Pe=dp.toFiniteNumber(oe.headers.get("content-length")),[je,Fe]=m&&Oze(Pe,kve(Bze(m),!0))||[];oe=new Response(kMr(oe.body,eLn,je,()=>{Fe&&Fe(),$&&$()}),Ee)}C=C||"text";let _e=await Kqt[dp.findKey(Kqt,C)||"text"](oe,i);return!pe&&$&&$(),await new Promise((Ee,Pe)=>{J_e(Ee,Pe,{data:_e,headers:JT.from(oe.headers),status:oe.status,statusText:oe.statusText,config:i,request:B})})}catch(re){throw $&&$(),re&&re.name==="TypeError"&&/fetch/i.test(re.message)?Object.assign(new F1("Network Error",F1.ERR_NETWORK,i,B),{cause:re.cause||re}):F1.from(re,re&&re.code,i,B)}});var PMr={http:HRn,xhr:XRn,fetch:nLn};dp.forEach(PMr,(i,t)=>{if(i){try{Object.defineProperty(i,"name",{value:t})}catch{}Object.defineProperty(i,"adapterName",{value:t})}});var iLn=e(i=>`- ${i}`,"renderReason"),wda=e(i=>dp.isFunction(i)||i===null||i===!1,"isResolvedHandle"),Xqt={getAdapter:e(i=>{i=dp.isArray(i)?i:[i];let{length:t}=i,n,a,o={};for(let c=0;c<t;c++){n=i[c];let f;if(a=n,!wda(n)&&(a=PMr[(f=String(n)).toLowerCase()],a===void 0))throw new F1(`Unknown adapter '${f}'`);if(a)break;o[f||"#"+c]=a}if(!a){let c=Object.entries(o).map(([m,x])=>`adapter ${m} `+(x===!1?"is not supported by the environment":"is not available in the build")),f=t?c.length>1?`since :
|
|
1811
1811
|
`+c.map(iLn).join(`
|
|
1812
1812
|
`):" "+iLn(c[0]):"as no adapter specified";throw new F1("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return a},"getAdapter"),adapters:PMr};function FMr(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new hZ(null,i)}e(FMr,"throwIfCancellationRequested");function Zqt(i){return FMr(i),i.headers=JT.from(i.headers),i.data=r_t.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),Xqt.getAdapter(i.adapter||Pze.adapter)(i).then(e(function(a){return FMr(i),a.data=r_t.call(i,i.transformResponse,a),a.headers=JT.from(a.headers),a},"onAdapterResolution"),e(function(a){return n_t(a)||(FMr(i),a&&a.response&&(a.response.data=r_t.call(i,i.transformResponse,a.response),a.response.headers=JT.from(a.response.headers))),Promise.reject(a)},"onAdapterRejection"))}e(Zqt,"dispatchRequest");var eQt={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{eQt[i]=e(function(a){return typeof a===i||"a"+(t<1?"n ":" ")+i},"validator")});var aLn={};eQt.transitional=e(function(t,n,a){function o(c,f){return"[Axios v"+KIe+"] Transitional option '"+c+"'"+f+(a?". "+a:"")}return e(o,"formatMessage"),(c,f,m)=>{if(t===!1)throw new F1(o(f," has been removed"+(n?" in "+n:"")),F1.ERR_DEPRECATED);return n&&!aLn[f]&&(aLn[f]=!0,console.warn(o(f," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(c,f,m):!0}},"transitional");eQt.spelling=e(function(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)},"spelling");function Sda(i,t,n){if(typeof i!="object")throw new F1("options must be an object",F1.ERR_BAD_OPTION_VALUE);let a=Object.keys(i),o=a.length;for(;o-- >0;){let c=a[o],f=t[c];if(f){let m=i[c],x=m===void 0||f(m,c,i);if(x!==!0)throw new F1("option "+c+" must be "+x,F1.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new F1("Unknown option "+c,F1.ERR_BAD_OPTION)}}e(Sda,"assertOptions");var l_t={assertOptions:Sda,validators:eQt};var z_e=l_t.validators,NMr=class NMr{constructor(t){this.defaults=t,this.interceptors={request:new YLr,response:new YLr}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;let c=o.stack?o.stack.replace(/^.+\n/,""):"";try{a.stack?c&&!String(a.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
1813
|
-
`+c):a.stack=c}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Cce(this.defaults,n);let{transitional:a,paramsSerializer:o,headers:c}=n;a!==void 0&&l_t.assertOptions(a,{silentJSONParsing:z_e.transitional(z_e.boolean),forcedJSONParsing:z_e.transitional(z_e.boolean),clarifyTimeoutError:z_e.transitional(z_e.boolean)},!1),o!=null&&(dp.isFunction(o)?n.paramsSerializer={serialize:o}:l_t.assertOptions(o,{encode:z_e.function,serialize:z_e.function},!0)),l_t.assertOptions(n,{baseUrl:z_e.spelling("baseURL"),withXsrfToken:z_e.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let f=c&&dp.merge(c.common,c[n.method]);c&&dp.forEach(["delete","get","head","post","put","patch","common"],B=>{delete c[B]}),n.headers=JT.concat(f,c);let m=[],x=!0;this.interceptors.request.forEach(e(function($){typeof $.runWhen=="function"&&$.runWhen(n)===!1||(x=x&&$.synchronous,m.unshift($.fulfilled,$.rejected))},"unshiftRequestInterceptors"));let C=[];this.interceptors.response.forEach(e(function($){C.push($.fulfilled,$.rejected)},"pushResponseInterceptors"));let S,k=0,I;if(!x){let B=[Zqt.bind(this),void 0];for(B.unshift.apply(B,m),B.push.apply(B,C),I=B.length,S=Promise.resolve(n);k<I;)S=S.then(B[k++],B[k++]);return S}I=m.length;let M=n;for(k=0;k<I;){let B=m[k++],$=m[k++];try{M=B(M)}catch(W){$.call(this,W);break}}try{S=Zqt.call(this,M)}catch(B){return Promise.reject(B)}for(k=0,I=C.length;k<I;)S=S.then(C[k++],C[k++]);return S}getUri(t){t=Cce(this.defaults,t);let n=WIe(t.baseURL,t.url);return zIe(n,t.params,t.paramsSerializer)}};e(NMr,"Axios");var Rze=NMr;dp.forEach(["delete","get","head","options"],e(function(t){Rze.prototype[t]=function(n,a){return this.request(Cce(a||{},{method:t,url:n,data:(a||{}).data}))}},"forEachMethodNoData"));dp.forEach(["post","put","patch"],e(function(t){function n(a){return e(function(c,f,m){return this.request(Cce(m||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))},"httpMethod")}e(n,"generateHTTPMethod"),Rze.prototype[t]=n(),Rze.prototype[t+"Form"]=n(!0)},"forEachMethodWithData"));var p_t=Rze;var tQt=class tQt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(e(function(c){n=c},"promiseExecutor"));let a=this;this.promise.then(o=>{if(!a._listeners)return;let c=a._listeners.length;for(;c-- >0;)a._listeners[c](o);a._listeners=null}),this.promise.then=o=>{let c,f=new Promise(m=>{a.subscribe(m),c=m}).then(o);return f.cancel=e(function(){a.unsubscribe(c)},"reject"),f},t(e(function(c,f,m){a.reason||(a.reason=new hZ(c,f,m),n(a.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){let t=new AbortController,n=e(a=>{t.abort(a)},"abort");return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new tQt(e(function(o){t=o},"executor")),cancel:t}}};e(tQt,"CancelToken");var OMr=tQt,sLn=OMr;function BMr(i){return e(function(n){return i.apply(null,n)},"wrap")}e(BMr,"spread");function RMr(i){return dp.isObject(i)&&i.isAxiosError===!0}e(RMr,"isAxiosError");var LMr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(LMr).forEach(([i,t])=>{LMr[t]=i});var oLn=LMr;function uLn(i){let t=new p_t(i),n=X0t(p_t.prototype.request,t);return dp.extend(n,p_t.prototype,t,{allOwnKeys:!0}),dp.extend(n,t,null,{allOwnKeys:!0}),n.create=e(function(o){return uLn(Cce(i,o))},"create"),n}e(uLn,"createInstance");var rF=uLn(Pze);rF.Axios=p_t;rF.CanceledError=hZ;rF.CancelToken=sLn;rF.isCancel=n_t;rF.VERSION=KIe;rF.toFormData=A4e;rF.AxiosError=F1;rF.Cancel=rF.CanceledError;rF.all=e(function(t){return Promise.all(t)},"all");rF.spread=BMr;rF.isAxiosError=RMr;rF.mergeConfig=Cce;rF.AxiosHeaders=JT;rF.formToJSON=i=>zqt(dp.isHTMLForm(i)?new FormData(i):i);rF.getAdapter=Xqt.getAdapter;rF.HttpStatusCode=oLn;rF.default=rF;var rQt=rF;var{Axios:nvs,AxiosError:ivs,CanceledError:avs,isCancel:svs,CancelToken:ovs,VERSION:uvs,all:cvs,Cancel:lvs,isAxiosError:pvs,spread:fvs,toFormData:dvs,AxiosHeaders:_vs,HttpStatusCode:mvs,formToJSON:hvs,getAdapter:gvs,mergeConfig:yvs}=rQt;var Lze=require("fs");var MMr=class MMr{constructor(t,n,a,o,c=!1,f={start:e(m=>{},"start"),complete:e(m=>{},"complete"),error:e((m,x)=>{},"error")}){this.apiBaseURL=t;this.apiKey=n;this.uploadTimeout=a;this.makeGetUploadUrlAPIPath=o;this.isolationMode=c;this.reporter=f}async uploadAsset(t){if(t.uploadStarted=!0,this.isolationMode){t.lastProgress=Date.now(),t.loadedBytes=0,t.sizeBytes=100,t.response=new Promise(o=>{setTimeout(()=>{t.complete=!0,t.lastProgress=Date.now(),t.loadedBytes=100,o({statusCode:200,ok:!0,body:"OK"})},10)});return}let{path:n}=t.info,a=null;try{let c=(0,Lze.statSync)(n).size;if(t.sizeBytes=c,t.loadedBytes=0,t.lastProgress=Date.now(),this.reporter.start(n),await this.getSignedURLForUpload(t),!t.uploadURL){t.error=!0;return}a=(0,Lze.createReadStream)(n);let f=await rQt.put(t.uploadURL,a,{headers:{"Content-Type":L7n[t.info.type]??""},maxBodyLength:1/0,maxContentLength:1/0,onUploadProgress:e(m=>{t.lastProgress=m.loaded>t.loadedBytes?Date.now():t.lastProgress,t.loadedBytes=m.loaded,t.sizeBytes=m.total??c},"onUploadProgress"),timeout:this.uploadTimeout??void 0});if(f.status!==200)throw new Error(`Upload failed with status ${f.status}`);this.reporter.complete(n),t.complete=!0,t.response=f.data,t.removeAfterUpload&&(0,Lze.unlinkSync)(n)}catch(o){this.reporter.error(n,o),t.error=!0}finally{if(a)try{typeof a.destroy=="function"?a.destroy():typeof a.close=="function"&&a.close()}catch{}a=null}}async getSignedURLForUpload(t){try{let n=JSON.stringify(t.info),a=`${this.apiBaseURL}/${this.makeGetUploadUrlAPIPath(t)}`,o={Accept:"application/json","Content-Type":"application/json",ChecksumAppCode:this.apiKey},c=await fetch(a,{method:"POST",headers:o,body:n}),{url:f}=await c.json();t.uploadURL=f}catch(n){return this.reporter.error(t.info.path,"Error getting signed URL for artifact"+String(n)),null}}};e(MMr,"TestAssetUploader");var nQt=MMr;var I4e=require("fs"),tWe=require("path");var zT=Ad(VT());var N1=Ad(VT());var jMr={toBeAttached:[0],toBeChecked:[0],toBeDisabled:[0],toBeEditable:[0],toBeEmpty:[0],toBeEnabled:[0],toBeFocused:[0],toBeHidden:[0],toBeInViewport:[0],toBeVisible:[0],toContainText:[1],toHaveAccessibleDescription:[1],toHaveAccessibleName:[1],toHaveAttribute:[1,2],toHaveClass:[1],toHaveCount:[1],toHaveCSS:[1,2],toHaveId:[1],toHaveJSProperty:[1,2],toHaveRole:[1],toHaveScreenshot:[0,1],toHaveText:[1],toHaveValue:[1],toHaveValues:[1],toMatchAriaSnapshot:[0],toHaveTitle:[1],toHaveURL:[1]};var W_e=require("crypto");var _VtgTestMirror=class _VtgTestMirror{constructor(i,t,n,a,o,c){this.title=i;this.internalTestId=t;this.storyId=n;this.sourceFile=a;this.testBody=o;this.hooks=c;this.stepsOutput=[]}translateStatementsToSteps(i={}){let n=this.sortStatementsAndExpressionByExecutionOrder().map(a=>this.getStep(a));return i.mergeCustomCodeSteps&&(n=this.mergeCustomCodeSteps(n)),n}translateStatementsToActions(i={}){let t=this.translateStatementsToSteps(i),n=e(a=>!!a.eventCode,"isAction");return t.reduce((a,o)=>{if(n(o))a.push(o);else{let c=a[a.length-1];c.assertions??(c.assertions=[]),c.assertions.push({...o,actionId:c.id})}return a},[])}mergeCustomCodeSteps(i){let t=e(n=>(n==null?void 0:n.eventCode)==="custom_code","isCustomCode");return i.reduce((n,a)=>{let o=n[n.length-1];return t(a)&&t(o)&&a.thought===o.thought?(o.fillValue+=`
|
|
1813
|
+
`+c):a.stack=c}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Cce(this.defaults,n);let{transitional:a,paramsSerializer:o,headers:c}=n;a!==void 0&&l_t.assertOptions(a,{silentJSONParsing:z_e.transitional(z_e.boolean),forcedJSONParsing:z_e.transitional(z_e.boolean),clarifyTimeoutError:z_e.transitional(z_e.boolean)},!1),o!=null&&(dp.isFunction(o)?n.paramsSerializer={serialize:o}:l_t.assertOptions(o,{encode:z_e.function,serialize:z_e.function},!0)),l_t.assertOptions(n,{baseUrl:z_e.spelling("baseURL"),withXsrfToken:z_e.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let f=c&&dp.merge(c.common,c[n.method]);c&&dp.forEach(["delete","get","head","post","put","patch","common"],B=>{delete c[B]}),n.headers=JT.concat(f,c);let m=[],x=!0;this.interceptors.request.forEach(e(function($){typeof $.runWhen=="function"&&$.runWhen(n)===!1||(x=x&&$.synchronous,m.unshift($.fulfilled,$.rejected))},"unshiftRequestInterceptors"));let C=[];this.interceptors.response.forEach(e(function($){C.push($.fulfilled,$.rejected)},"pushResponseInterceptors"));let S,k=0,I;if(!x){let B=[Zqt.bind(this),void 0];for(B.unshift.apply(B,m),B.push.apply(B,C),I=B.length,S=Promise.resolve(n);k<I;)S=S.then(B[k++],B[k++]);return S}I=m.length;let M=n;for(k=0;k<I;){let B=m[k++],$=m[k++];try{M=B(M)}catch(W){$.call(this,W);break}}try{S=Zqt.call(this,M)}catch(B){return Promise.reject(B)}for(k=0,I=C.length;k<I;)S=S.then(C[k++],C[k++]);return S}getUri(t){t=Cce(this.defaults,t);let n=WIe(t.baseURL,t.url);return zIe(n,t.params,t.paramsSerializer)}};e(NMr,"Axios");var Rze=NMr;dp.forEach(["delete","get","head","options"],e(function(t){Rze.prototype[t]=function(n,a){return this.request(Cce(a||{},{method:t,url:n,data:(a||{}).data}))}},"forEachMethodNoData"));dp.forEach(["post","put","patch"],e(function(t){function n(a){return e(function(c,f,m){return this.request(Cce(m||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))},"httpMethod")}e(n,"generateHTTPMethod"),Rze.prototype[t]=n(),Rze.prototype[t+"Form"]=n(!0)},"forEachMethodWithData"));var p_t=Rze;var tQt=class tQt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(e(function(c){n=c},"promiseExecutor"));let a=this;this.promise.then(o=>{if(!a._listeners)return;let c=a._listeners.length;for(;c-- >0;)a._listeners[c](o);a._listeners=null}),this.promise.then=o=>{let c,f=new Promise(m=>{a.subscribe(m),c=m}).then(o);return f.cancel=e(function(){a.unsubscribe(c)},"reject"),f},t(e(function(c,f,m){a.reason||(a.reason=new hZ(c,f,m),n(a.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){let t=new AbortController,n=e(a=>{t.abort(a)},"abort");return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new tQt(e(function(o){t=o},"executor")),cancel:t}}};e(tQt,"CancelToken");var OMr=tQt,sLn=OMr;function BMr(i){return e(function(n){return i.apply(null,n)},"wrap")}e(BMr,"spread");function RMr(i){return dp.isObject(i)&&i.isAxiosError===!0}e(RMr,"isAxiosError");var LMr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(LMr).forEach(([i,t])=>{LMr[t]=i});var oLn=LMr;function uLn(i){let t=new p_t(i),n=X0t(p_t.prototype.request,t);return dp.extend(n,p_t.prototype,t,{allOwnKeys:!0}),dp.extend(n,t,null,{allOwnKeys:!0}),n.create=e(function(o){return uLn(Cce(i,o))},"create"),n}e(uLn,"createInstance");var rF=uLn(Pze);rF.Axios=p_t;rF.CanceledError=hZ;rF.CancelToken=sLn;rF.isCancel=n_t;rF.VERSION=KIe;rF.toFormData=A4e;rF.AxiosError=F1;rF.Cancel=rF.CanceledError;rF.all=e(function(t){return Promise.all(t)},"all");rF.spread=BMr;rF.isAxiosError=RMr;rF.mergeConfig=Cce;rF.AxiosHeaders=JT;rF.formToJSON=i=>zqt(dp.isHTMLForm(i)?new FormData(i):i);rF.getAdapter=Xqt.getAdapter;rF.HttpStatusCode=oLn;rF.default=rF;var rQt=rF;var{Axios:nvs,AxiosError:ivs,CanceledError:avs,isCancel:svs,CancelToken:ovs,VERSION:uvs,all:cvs,Cancel:lvs,isAxiosError:pvs,spread:fvs,toFormData:dvs,AxiosHeaders:_vs,HttpStatusCode:mvs,formToJSON:hvs,getAdapter:gvs,mergeConfig:yvs}=rQt;var Lze=require("fs");var MMr=class MMr{constructor(t,n,a,o,c=!1,f={start:e(m=>{},"start"),complete:e(m=>{},"complete"),error:e((m,x)=>{},"error")}){this.apiBaseURL=t;this.apiKey=n;this.uploadTimeout=a;this.makeGetUploadUrlAPIPath=o;this.isolationMode=c;this.reporter=f}async uploadAsset(t){if(t.uploadStarted=!0,this.isolationMode){t.lastProgress=Date.now(),t.loadedBytes=0,t.sizeBytes=100,t.response=new Promise(o=>{setTimeout(()=>{t.complete=!0,t.lastProgress=Date.now(),t.loadedBytes=100,o({statusCode:200,ok:!0,body:"OK"})},10)});return}let{path:n}=t.info,a=null;try{let c=(0,Lze.statSync)(n).size;if(t.sizeBytes=c,t.loadedBytes=0,t.lastProgress=Date.now(),this.reporter.start(n),await this.getSignedURLForUpload(t),!t.uploadURL){t.error=!0;return}a=(0,Lze.createReadStream)(n);let f=await rQt.put(t.uploadURL,a,{headers:{"Content-Type":L7n[t.info.type]??"",Connection:"close"},maxBodyLength:1/0,maxContentLength:1/0,onUploadProgress:e(m=>{t.lastProgress=m.loaded>t.loadedBytes?Date.now():t.lastProgress,t.loadedBytes=m.loaded,t.sizeBytes=m.total??c},"onUploadProgress"),timeout:this.uploadTimeout??void 0,httpAgent:!1,httpsAgent:!1});if(f.status!==200)throw new Error(`Upload failed with status ${f.status}`);this.reporter.complete(n),t.complete=!0,t.response=f.data,t.removeAfterUpload&&(0,Lze.unlinkSync)(n)}catch(o){this.reporter.error(n,o),t.error=!0}finally{if(a)try{typeof a.destroy=="function"?a.destroy():typeof a.close=="function"&&a.close()}catch{}a=null}}async getSignedURLForUpload(t){try{let n=JSON.stringify(t.info),a=`${this.apiBaseURL}/${this.makeGetUploadUrlAPIPath(t)}`,o={Accept:"application/json","Content-Type":"application/json",ChecksumAppCode:this.apiKey},c=await fetch(a,{method:"POST",headers:o,body:n}),{url:f}=await c.json();t.uploadURL=f}catch(n){return this.reporter.error(t.info.path,"Error getting signed URL for artifact"+String(n)),null}}};e(MMr,"TestAssetUploader");var nQt=MMr;var I4e=require("fs"),tWe=require("path");var zT=Ad(VT());var N1=Ad(VT());var jMr={toBeAttached:[0],toBeChecked:[0],toBeDisabled:[0],toBeEditable:[0],toBeEmpty:[0],toBeEnabled:[0],toBeFocused:[0],toBeHidden:[0],toBeInViewport:[0],toBeVisible:[0],toContainText:[1],toHaveAccessibleDescription:[1],toHaveAccessibleName:[1],toHaveAttribute:[1,2],toHaveClass:[1],toHaveCount:[1],toHaveCSS:[1,2],toHaveId:[1],toHaveJSProperty:[1,2],toHaveRole:[1],toHaveScreenshot:[0,1],toHaveText:[1],toHaveValue:[1],toHaveValues:[1],toMatchAriaSnapshot:[0],toHaveTitle:[1],toHaveURL:[1]};var W_e=require("crypto");var _VtgTestMirror=class _VtgTestMirror{constructor(i,t,n,a,o,c){this.title=i;this.internalTestId=t;this.storyId=n;this.sourceFile=a;this.testBody=o;this.hooks=c;this.stepsOutput=[]}translateStatementsToSteps(i={}){let n=this.sortStatementsAndExpressionByExecutionOrder().map(a=>this.getStep(a));return i.mergeCustomCodeSteps&&(n=this.mergeCustomCodeSteps(n)),n}translateStatementsToActions(i={}){let t=this.translateStatementsToSteps(i),n=e(a=>!!a.eventCode,"isAction");return t.reduce((a,o)=>{if(n(o))a.push(o);else{let c=a[a.length-1];c.assertions??(c.assertions=[]),c.assertions.push({...o,actionId:c.id})}return a},[])}mergeCustomCodeSteps(i){let t=e(n=>(n==null?void 0:n.eventCode)==="custom_code","isCustomCode");return i.reduce((n,a)=>{let o=n[n.length-1];return t(a)&&t(o)&&a.thought===o.thought?(o.fillValue+=`
|
|
1814
1814
|
`+a.fillValue,n):[...n,a]},[])}sortStatementsAndExpressionByExecutionOrder(i=!1){if(!i)return N1.isBlock(this.testBody)?[...this.testBody.statements]:[this.testBody];let t=e(c=>this.hooks.filter(f=>f.type===c),"getHooksByType"),n=e(c=>{let f=c.reduce((m,x)=>{let C=m.get(x.nestedLevel)||[];return m.set(x.nestedLevel,[...C,x]),m},new Map);return Array.from(f.values())},"groupHooksByNestedLevel"),a=e(c=>n(c).reverse().flat(),"getBodiesByReversedNestedLevel");return[...t("beforeAll"),...t("beforeEach"),{body:this.testBody},...a(t("afterEach")),...a(t("afterAll"))].map(c=>c.body).map(c=>N1.isBlock(c)?[...c.statements]:[c]).flat()}getStep(i,{insideImplicitChecksumAIPromise:t}={}){let n={eventCode:"custom_code",fillValue:this.getText(i),id:(0,W_e.randomUUID)(),codeContext:{frameTargetName:null},source:"manual",...t?{isChecksumAiWithDirectExpression:!0}:{}};return N1.isExpressionStatement(i)&&(i=i.expression),N1.isBinaryExpression(i)?this.getSwitchTabAction(i)??n:N1.isAwaitExpression(i)&&N1.isCallExpression(i.expression)?this.getAwaitCallExpressionType(i.expression)??n:t&&N1.isCallExpression(i)?{...this.getAwaitCallExpressionType(i)??n,isChecksumAiWithDirectExpression:!0}:n}getText(i,{keepTextNodeQuotationMarks:t}={}){return i?!t&&"text"in i?i.text.toString():i.getText(this.sourceFile):""}getSwitchTabAction(i){if(this.getText(i.left)!=="page"||!N1.isAwaitExpression(i.right)||!N1.isCallExpression(i.right.expression))return;let t=i.right.expression;if(!N1.isCallExpression(t)||!N1.isPropertyAccessExpression(t.expression)||!N1.isIdentifier(t.expression.name)||t.expression.name.text!=="getPage"||t.arguments.length!==1)return;let n=this.getText(t.expression.expression),a=this.getText(t.arguments[0]);if(/^\d+$/.test(a))return{id:(0,W_e.randomUUID)(),source:"manual",eventCode:"switch_tab",switchToTab:{index:parseInt(a,10),id:""},codeContext:{frameTargetName:n&&n!=="page"?n:null}}}getAwaitCallExpressionType(i){if(N1.isIdentifier(i.expression))switch(this.getText(i.expression)){case"login":return this.getLoginAction(i);case"checksumAI":return this.translateChecksumAIToAction(i);default:return}return N1.isPropertyAccessExpression(i.expression)?this.getText(i.expression)==="test.step"?this.getTestStepAction(i):this.getText(i.expression)==="checksumAI.withDialog"?this.translateChecksumAIToAction(i):/^(expect|expect\.soft|expect\[.soft\]\.checksumAI)\(/.test(this.getText(i.expression))?this.processPossibleAwaitExpect(i):this.getAction(i):void 0}getTestStepAction(i){let[t,n]=i.arguments,a=this.getText(t);if(!N1.isArrowFunction(n)&&!N1.isFunctionExpression(n))return;let o=n.body,c=N1.isExpression(o)?this.getText(o):o.statements.map(f=>this.getText(f)).join(`
|
|
1815
1815
|
`);return{id:(0,W_e.randomUUID)(),source:"manual",eventCode:"custom_code",codeContext:{frameTargetName:null},thought:a,fillValue:c}}processPropertyAccessExpression(i){let t="",n=i;for(;N1.isPropertyAccessExpression(n);n=n.expression)t=`${this.getText(n.name)}${t?`.${t}`:""}`;return{propertyAccess:t,propertyAccessCalleeNode:n}}processPossibleAwaitExpect(i){let t,n,{propertyAccess:a,propertyAccessCalleeNode:o}=this.processPropertyAccessExpression(i.expression);if(!N1.isCallExpression(o)||this.isUnknownMatcher(a))return;if(["expect","expect.soft"].includes(this.getText(o.expression)))t=o;else if(N1.isPropertyAccessExpression(o.expression)&&N1.isCallExpression(o.expression.expression)&&this.getText(o.expression.name)==="checksumAI"&&["expect","expect.soft"].includes(this.getText(o.expression.expression.expression)))n=this.getText(o.arguments[0]),t=o.expression.expression;else return;let{expression:c,arguments:f}=t,m=this.getText(c)==="expect.soft",{locator:x,codeContext:C}=this.processLocatorCallExpression(f[0]);if(n??(n=f[1]?this.getText(f[1]):void 0),!this.assertionMatcherHasValidArgumentsCount(i.arguments,a))return;let{matcher:S,matcherOptions:k}=this.resolveAssertionMatcherAndMatcherOptions(i,a);return{id:(0,W_e.randomUUID)(),locator:x,matcher:S,...n!==void 0?{thought:n}:{},isSoft:m,source:"manual",actionId:"",selected:!0,matcherOptions:k,codeContext:C}}resolveAssertionMatcherAndMatcherOptions(i,t){let{argumentNodes:n,optionsArgumentNode:a}=this.resolveAssertionsArgumentNodesAndOptionsNode(i,t);return{matcher:this.createAssertionMatcher(t,n),matcherOptions:a?this.getText(a,{keepTextNodeQuotationMarks:!0}):void 0}}isUnknownMatcher(i){let t=i.replace(/^not\./,"");return!jMr[t]}getPossibleOptionsIndicesByMatcher(i){let t=i.replace(/^not\./,"");return jMr[t]??[]}assertionMatcherHasValidArgumentsCount(i,t){return this.getPossibleOptionsIndicesByMatcher(t).flatMap(o=>[o,o+1]).includes(i.length)}resolveAssertionsArgumentNodesAndOptionsNode(i,t){let n=[...i.arguments],a,o=this.getPossibleOptionsIndicesByMatcher(t);if(o.length===0)return{argumentNodes:n,optionsArgumentNode:void 0};if(o.length===1){let c=o[0];c<n.length&&(a=n[c],n=n.filter((m,x)=>x!==c))}if(o.length===2){let c=Math.max(...o);c<n.length?(a=n[c],n=n.filter((m,x)=>x!==c)):Math.min(...o)<n.length&&(c=Math.min(...o),N1.isObjectLiteralExpression(n[c])&&(a=n[c],n=n.filter((m,x)=>x!==c)))}return{argumentNodes:n,optionsArgumentNode:a}}createAssertionMatcher(i,t){let n=t.map(a=>this.getText(a,{keepTextNodeQuotationMarks:!0})).join(", ");return`${i}(${n})`}processLocatorCallExpression(i){var S;let t=this.getText(i),n=[...Object.values(N_e),"compoundSelection"],o=new RegExp(`\\.(${n.join("|")})\\s*\\(`,"g").exec(t),c=o?{locator:o[1],index:o.index}:null,f,m;c?(f=t.slice(c.index+1),m=t.slice(0,c.index).replace(/^checksumSelector\("([^)]+)"\)\.?/,"")):(f="",m=t);let x=/\.checksumAI\("([^)]+)"\)/,C;return m.match(x)&&(C=(S=m.match(x))==null?void 0:S[1],m=m.replace(x,"")),{locator:f,...C?{thought:C}:{},codeContext:{frameTargetName:m!=="page"?m:null}}}getLoginAction(i){if(!this.validateActionArguments("login",i.arguments))return;let t=this.getText(i.arguments[0]),n={frameTargetName:t!=="page"?t:null},a=G$e.login,o={eventCode:"login",isInitialAction:!0,id:(0,W_e.randomUUID)(),source:"manual",codeContext:n},c=i.arguments[a],f={role:void 0,environment:void 0};if(!c)return{...o,login:f};if(!e(C=>N1.isObjectLiteralExpression(C)?C.properties.every(S=>{if(!N1.isPropertyAssignment(S))return!1;let{name:k,initializer:I}=S;return N1.isIdentifier(k)?["role","environment"].includes(k.text):!1}):!1,"isSupportedLoginOptionsNode")(c)){let C=this.getText(c);return{...o,login:f,...C?{actionOptions:C}:{}}}let x={...f,...this.extractValue(c)};return{...o,login:x}}translateChecksumAIToAction(i){let[t,n]=i.arguments;if(!N1.isArrowFunction(n)&&!N1.isFunctionExpression(n))return;let a;if(N1.isExpression(n.body))a=this.getStep(n.body,{insideImplicitChecksumAIPromise:!0});else if(n.body.statements.length===1){let c=n.body.statements[0];a=this.getStep(c)}else n.body.statements.length===2&&(a=this.getActionThenTypeAction(n.body));a??(a={eventCode:"custom_code",fillValue:this.getText(n.body).replace(/^\s*\{\s*/,"").replace(/\s*\}\s*$/,""),id:(0,W_e.randomUUID)(),source:"manual",codeContext:{frameTargetName:null}});let o=this.getText(t);return{...a,thought:o}}getActionThenTypeAction(i){let[t,n]=i.statements,a=e($=>!N1.isExpressionStatement($)||!N1.isAwaitExpression($.expression)||!N1.isCallExpression($.expression.expression)?{}:this.getLocatorAndPageMethodNameAndArgs($.expression.expression),"getStatementLocatorAndPageMethodName"),{locator:o,pageMethodName:c,args:f,codeContext:m}=a(t),{locator:x,pageMethodName:C,args:S,codeContext:k}=a(n),M={click:"click_and_type",clear:"clear_and_type"}[c],B=m==null?void 0:m.frameTargetName;if(o&&M&&Array.isArray(f)&&f.length===0&&Array.isArray(S)&&S.length===1&&C==="pressSequentially"&&o===x&&B===(k==null?void 0:k.frameTargetName))return{eventCode:M,locator:o,id:(0,W_e.randomUUID)(),source:"manual",fillValue:S[0],codeContext:{frameTargetName:B&&B!=="page"?B:null}}}getDialogAction(i){let t,n=e(S=>Object.values(iDr).includes(S),"isNativeDialogType");if(!N1.isPropertyAccessExpression(i.expression)||!N1.isCallExpression(i.expression.expression)||!N1.isPropertyAccessExpression(i.expression.expression.expression))return;let a=i.expression.expression.expression.expression;t=this.getText(a);let o=i.arguments[0];if(!o||!N1.isArrowFunction(o)||!N1.isBlock(o.body)||!N1.isExpressionStatement(o.body.statements[0])||!N1.isAwaitExpression(o.body.statements[0].expression))return;let c=o.body.statements[0].expression.expression;if(!N1.isCallExpression(c)||!N1.isPropertyAccessExpression(c.expression))return;let m={accept:"native_accept",dismiss:"native_dismiss"}[this.getText(c.expression.name)];if(!m||c.arguments.length>(m==="native_accept"?1:0))return;let x=this.getText(c.arguments[0]),C=this.getText(c.expression.expression);if(n(C))return{id:(0,W_e.randomUUID)(),source:"manual",eventCode:m,nativeDialog:{dialogType:C,dialogResult:x},codeContext:{frameTargetName:t!=="page"?t:null}}}getLocatorAndPageMethodNameAndArgs(i){if(!N1.isPropertyAccessExpression(i.expression))return{};let t=i.expression.expression,n=this.getText(i.expression.name);n==="press"&&N1.isPropertyAccessExpression(t)&&this.getText(t.name)==="keyboard"&&(t=t.expression,n="keyboard.press");let{locator:a,thought:o,codeContext:c}=this.processLocatorCallExpression(t),f=i.arguments.map(m=>this.extractValue(m));return{locator:a,pageMethodName:n,args:f,thought:o,codeContext:c}}getAction(i){if(!N1.isPropertyAccessExpression(i.expression))return;if(/\.waitForDialog\(\)\s*\.then/.test(this.getText(i.expression)))return this.getDialogAction(i);let{locator:n,pageMethodName:a,args:o,thought:c,codeContext:f}=this.getLocatorAndPageMethodNameAndArgs(i),m=Ykr[a];if(!m||!this.validateActionArguments(m,i.arguments))return;let x=i.arguments,C=this.getActionParams(m,x,o,f);return{source:"manual",id:(0,W_e.randomUUID)(),...n?{locator:n}:{},...c?{thought:c}:{},eventCode:m,...C,codeContext:f}}validateActionArguments(i,t){if(!U7n[i].includes(t.length))return!1;let a=G$e[i];return a!==-1&&t[a]&&!N1.isObjectLiteralExpression(t[a])?!1:i==="upload_files"?N1.isCallExpression(t[0])&&this.getText(t[0].expression)==="page.resolveAssetsFolder"&&t[0].arguments.length===1&&N1.isArrayLiteralExpression(t[0].arguments[0]):!0}getActionParams(i,t,n,a){let o=G$e[i],c;switch(o<n.length&&t[o]&&(c=this.getText(t[o])),i){case"input":case"selectoption":case"keystroke":case"navigation":return{fillValue:n[0],...c?{actionOptions:c}:{}};case"wait":return{codeContext:a,fillValue:n[0].toString(),...c?{actionOptions:c}:{}};case"drag_and_drop":{let f=this.getText(t[0]),m=(a==null?void 0:a.frameTargetName)??"page",x=new RegExp(`^${m}.`);return{codeContext:a,dropTarget:{locator:f.replace(x,"")},...c?{actionOptions:c}:{}}}case"upload_files":return{codeContext:a,files:t[0].arguments[0].elements.map(f=>this.extractValue(f)),...c?{actionOptions:c}:{}};case"canvas_click":{let[f,m]=n;return{codeContext:a,canvas:{canvasText:f,...m!==void 0?{rectSizeIndex:m}:{}}}}case"logout_and_login":{let f=this.getText(t[0]);return{codeContext:a,userRole:f,isInitialAction:!1}}default:return{codeContext:a,...c?{actionOptions:c}:{}}}}getObjectLiteralValue(i){return!i||!N1.isObjectLiteralExpression(i)?{}:i.properties.reduce((t,n)=>{if(N1.isPropertyAssignment(n)){let{name:a,initializer:o}=n,c=this.getText(a),f=this.extractValue(o);t[c]=f}return t},{})}extractValue(node){var i;if(node&&!(!N1.isExpression(node)&&!N1.isLiteralTypeLiteral(node))){if(N1.isStringLiteral(node)||N1.isNoSubstitutionTemplateLiteral(node))return this.getText(node);if(N1.isLiteralExpression(node)||N1.isLiteralTypeLiteral(node))return eval(this.getText(node));if(N1.isObjectLiteralExpression(node))return this.getObjectLiteralValue(node);if(N1.isArrayLiteralExpression(node))return node.elements.map(t=>this.extractValue(t));if(N1.isTemplateExpression(node)){let t=this.getText(node);return((i=this.getText(node).match(/^\`(.+)\`$/))==null?void 0:i[1])??t}else return"${"+this.getText(node)+"}"}}};e(_VtgTestMirror,"VtgTestMirror");var Mze=_VtgTestMirror;var u5=Ad(VT()),wjn=Ad(Ejn());var E_t=require("fs"),rPe=Ad(require("path"));var Cjn=`require("${process.env.CHECKSUM_RUNTIME_DEV_MODE==="true"?`${process.cwd()}/src/init.ts`:"@checksum-ai/runtime"}");`,Abs=`const { checksumHotRequire } = ${Cjn}`,Ebs=`const {
|
|
1816
1816
|
init,
|