@checkly/playwright-core 1.48.22-beta.1 → 1.48.22
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/lib/generated/clockSource.js +1 -2
- package/lib/generated/consoleApiSource.js +1 -2
- package/lib/generated/injectedScriptSource.js +1 -2
- package/lib/generated/pollingRecorderSource.js +1 -2
- package/lib/generated/utilityScriptSource.js +1 -2
- package/lib/generated/webSocketMockSource.js +1 -2
- package/lib/vite/{traceViewer/assets/codeMirrorModule-xvopPhZ4.js → recorder/assets/codeMirrorModule-d0KhC1qL.js} +1 -1
- package/lib/vite/recorder/assets/codeMirrorModule-ez37Vkbh.css +1 -0
- package/lib/vite/recorder/assets/index-BW-aOBcL.css +1 -0
- package/lib/vite/recorder/assets/index-Bxxcmxlu.js +42 -0
- package/lib/vite/recorder/index.html +2 -2
- package/lib/vite/traceViewer/assets/codeMirrorModule-pBPtArIT.js +24 -0
- package/lib/vite/traceViewer/assets/codeMirrorModule-tzBrK1V4.js +24 -0
- package/lib/vite/traceViewer/assets/{inspectorTab-wfvwpMHs.js → inspectorTab-BuJ3wAX_.js} +3 -3
- package/lib/vite/traceViewer/assets/{inspectorTab-BPzhNk9r.js → inspectorTab-Soeeuvzv.js} +3 -3
- package/lib/vite/traceViewer/assets/{workbench-DLv_q9ji.js → workbench-DdmJ9AJV.js} +1 -1
- package/lib/vite/traceViewer/assets/{workbench-LKskf2Iy.js → workbench-lypYlf00.js} +1 -1
- package/lib/vite/traceViewer/{embedded.BIubxTi3.js → embedded.BkvOrz5Z.js} +1 -1
- package/lib/vite/traceViewer/{embedded.BXYl5zRv.js → embedded.DInvAijy.js} +1 -1
- package/lib/vite/traceViewer/embedded.html +6 -6
- package/lib/vite/traceViewer/{index.DPD22sZn.js → index.Dha3cgqs.js} +1 -1
- package/lib/vite/traceViewer/{index.DZkJsFod.js → index._Iolt-uE.js} +1 -1
- package/lib/vite/traceViewer/index.html +7 -7
- package/lib/vite/traceViewer/{recorder.BVExlUUk.js → recorder.DNMfnSiu.js} +1 -1
- package/lib/vite/traceViewer/{recorder.BaRuS6Pc.js → recorder.DTSaNaly.js} +1 -1
- package/lib/vite/traceViewer/recorder.html +4 -4
- package/lib/vite/traceViewer/{uiMode.DjTS7tqC.js → uiMode.BM7yhjzl.js} +1 -1
- package/lib/vite/traceViewer/{uiMode.B11wexdJ.js → uiMode.Cr1tvTWS.js} +1 -1
- package/lib/vite/traceViewer/uiMode.html +7 -7
- package/package.json +1 -1
- package/lib/cli/cli.js +0 -61
- package/lib/common/debugLogger.js +0 -90
- package/lib/generated/recorderSource.js +0 -7
- package/lib/server/recorder/codeGenerator.js +0 -154
- package/lib/server/recorder/csharp.js +0 -311
- package/lib/server/recorder/java.js +0 -217
- package/lib/server/recorder/javascript.js +0 -230
- package/lib/server/recorder/jsonl.js +0 -48
- package/lib/server/recorder/language.js +0 -45
- package/lib/server/recorder/python.js +0 -276
- package/lib/server/recorder/recorderActions.js +0 -6
- package/lib/server/recorder/utils.js +0 -46
- package/lib/utils/glob.js +0 -84
- package/lib/utils/mimeType.js +0 -30
- package/lib/vite/recorder/assets/codeMirrorModule--bQcPrZ2.js +0 -16437
- package/lib/vite/recorder/assets/codeMirrorModule-Cy8X9Wtw.css +0 -344
- package/lib/vite/recorder/assets/index-BMeslH8X.js +0 -9946
- package/lib/vite/recorder/assets/index-BjXmTggo.css +0 -2515
- package/lib/vite/traceViewer/assets/codeMirrorModule-75b0ca4f.js +0 -24
- package/lib/vite/traceViewer/assets/codeMirrorModule-BTYWvxEC.js +0 -16437
- package/lib/vite/traceViewer/assets/codeMirrorModule-CBokkFJ2.js +0 -16431
- package/lib/vite/traceViewer/assets/codeMirrorModule-CNHvVrFd.js +0 -16437
- package/lib/vite/traceViewer/assets/codeMirrorModule-CpGx_S8D.js +0 -16443
- package/lib/vite/traceViewer/assets/codeMirrorModule-DGE2kpkE.js +0 -16443
- package/lib/vite/traceViewer/assets/codeMirrorModule-DblsdhjA.js +0 -16449
- package/lib/vite/traceViewer/assets/codeMirrorModule-DtXZtbmO.js +0 -16437
- package/lib/vite/traceViewer/assets/codeMirrorModule-SomGa-Da.js +0 -16443
- package/lib/vite/traceViewer/assets/codeMirrorModule-c1454a2e.js +0 -24
- package/lib/vite/traceViewer/assets/codeMirrorModule-c9bb9834.js +0 -24
- package/lib/vite/traceViewer/assets/codeMirrorModule-cc2329e4.js +0 -15593
- package/lib/vite/traceViewer/assets/codeMirrorModule-d2cc7db0.js +0 -15579
- package/lib/vite/traceViewer/assets/codeMirrorModule-da915a35.js +0 -15586
- package/lib/vite/traceViewer/assets/codeMirrorModule-f03b1a3e.js +0 -15579
- package/lib/vite/traceViewer/assets/codeMirrorModule-f333a775.js +0 -24
- package/lib/vite/traceViewer/assets/codeMirrorModule-lDjkI8Ax.js +0 -24
- package/lib/vite/traceViewer/assets/codeMirrorModule-uWDlVSQz.js +0 -15585
- package/lib/vite/traceViewer/assets/codeMirrorModule-yboVpgC0.js +0 -15592
- package/lib/vite/traceViewer/assets/inspectorTab-B4ynvyY9.js +0 -17361
- package/lib/vite/traceViewer/assets/inspectorTab-BB2Bm-wy.js +0 -17361
- package/lib/vite/traceViewer/assets/inspectorTab-BqBvUFio.js +0 -17361
- package/lib/vite/traceViewer/assets/inspectorTab-CHcHvp_a.js +0 -17361
- package/lib/vite/traceViewer/assets/inspectorTab-C_OTuI8x.js +0 -17361
- package/lib/vite/traceViewer/assets/inspectorTab-DOc4D3cX.js +0 -17361
- package/lib/vite/traceViewer/assets/inspectorTab-Dw0Gnh1T.js +0 -17361
- package/lib/vite/traceViewer/assets/inspectorTab-Ywa000c9.js +0 -17361
- package/lib/vite/traceViewer/assets/testServerConnection-D-tXL3sj.js +0 -224
- package/lib/vite/traceViewer/assets/workbench-CROk6Fcc.js +0 -1473
- package/lib/vite/traceViewer/assets/workbench-CWtpwfKK.js +0 -1473
- package/lib/vite/traceViewer/assets/workbench-CfXOj3eT.js +0 -1473
- package/lib/vite/traceViewer/assets/workbench-D9CTkv-4.js +0 -1473
- package/lib/vite/traceViewer/assets/workbench-DNolpp3y.js +0 -1473
- package/lib/vite/traceViewer/assets/workbench-DUc2iD0P.js +0 -1473
- package/lib/vite/traceViewer/assets/workbench-DjoIOtwK.js +0 -1473
- package/lib/vite/traceViewer/assets/workbench-M-Dh_RgU.js +0 -1473
- package/lib/vite/traceViewer/assets/workbench-dnZM5a7x.js +0 -1473
- package/lib/vite/traceViewer/assets/wsPort-54626118.js +0 -18361
- package/lib/vite/traceViewer/assets/wsPort-57f274c6.js +0 -18361
- package/lib/vite/traceViewer/assets/wsPort-762c6840.js +0 -64
- package/lib/vite/traceViewer/assets/wsPort-85286e61.js +0 -18361
- package/lib/vite/traceViewer/assets/wsPort-98e00a94.js +0 -64
- package/lib/vite/traceViewer/assets/wsPort-CAXygIGt.js +0 -18540
- package/lib/vite/traceViewer/assets/wsPort-cc0077b5.js +0 -18542
- package/lib/vite/traceViewer/assets/wsPort-edfeeb7d.js +0 -64
- package/lib/vite/traceViewer/assets/wsPort-ee2830d7.js +0 -64
- package/lib/vite/traceViewer/assets/wsPort-peeLnQhT.js +0 -18564
- package/lib/vite/traceViewer/assets/xtermModule-443332e6.js +0 -9
- package/lib/vite/traceViewer/assets/xtermModule-60687b6b.js +0 -6410
- package/lib/vite/traceViewer/assets/xtermModule-DZP0glxx.js +0 -5982
- package/lib/vite/traceViewer/assets/xtermModule-_6TC5FYT.js +0 -6529
- package/lib/vite/traceViewer/codeMirrorModule.5d0f417c.css +0 -1
- package/lib/vite/traceViewer/codeMirrorModule.Cy8X9Wtw.css +0 -344
- package/lib/vite/traceViewer/codeMirrorModule.eb494ea9.css +0 -344
- package/lib/vite/traceViewer/codeMirrorModule.svF_VrcJ.css +0 -344
- package/lib/vite/traceViewer/codicon.79f233d0.ttf +0 -0
- package/lib/vite/traceViewer/codicon.zGuYmc9o.ttf +0 -0
- package/lib/vite/traceViewer/embedded.6N1v7bZ1.js +0 -106
- package/lib/vite/traceViewer/embedded.BOw0jX78.js +0 -106
- package/lib/vite/traceViewer/embedded.BaqdbLsy.js +0 -106
- package/lib/vite/traceViewer/embedded.CHH7D63q.js +0 -106
- package/lib/vite/traceViewer/embedded.CwwTDBzP.js +0 -106
- package/lib/vite/traceViewer/embedded.DeCrOtlO.js +0 -106
- package/lib/vite/traceViewer/embedded.DjZq4InJ.css +0 -68
- package/lib/vite/traceViewer/embedded.DnD_eIZU.js +0 -106
- package/lib/vite/traceViewer/embedded.i_k4ceMJ.js +0 -106
- package/lib/vite/traceViewer/embedded.ymLJ2mBS.js +0 -106
- package/lib/vite/traceViewer/index.1a1fe659.css +0 -1
- package/lib/vite/traceViewer/index.1b525c1c.js +0 -181
- package/lib/vite/traceViewer/index.55e65778.js +0 -181
- package/lib/vite/traceViewer/index.5mge2rY_.css +0 -124
- package/lib/vite/traceViewer/index.5nqVcfiC.js +0 -180
- package/lib/vite/traceViewer/index.5ooko4n7.js +0 -180
- package/lib/vite/traceViewer/index.76e9f312.css +0 -124
- package/lib/vite/traceViewer/index.Bfh46hDK.js +0 -197
- package/lib/vite/traceViewer/index.Bugo2TbS.js +0 -197
- package/lib/vite/traceViewer/index.BzvnAP7t.js +0 -197
- package/lib/vite/traceViewer/index.C8ZWP1Qw.js +0 -197
- package/lib/vite/traceViewer/index.CM_h9lHr.js +0 -197
- package/lib/vite/traceViewer/index.CY13pBr8.js +0 -197
- package/lib/vite/traceViewer/index.DW2ZzZfL.js +0 -197
- package/lib/vite/traceViewer/index.DblJtEW_.js +0 -197
- package/lib/vite/traceViewer/index.QanXxRUb.css +0 -131
- package/lib/vite/traceViewer/index.UtHmfPiA.js +0 -197
- package/lib/vite/traceViewer/index.a265fbdb.js +0 -2
- package/lib/vite/traceViewer/index.c9f6fa8f.js +0 -2
- package/lib/vite/traceViewer/index.d86e70ca.js +0 -181
- package/lib/vite/traceViewer/index.decad628.js +0 -2
- package/lib/vite/traceViewer/index.e8730524.js +0 -181
- package/lib/vite/traceViewer/index.ed9a3c58.js +0 -2
- package/lib/vite/traceViewer/inspectorTab.DGJWXOSd.css +0 -3145
- package/lib/vite/traceViewer/recorder.3Xfrl_zV.js +0 -551
- package/lib/vite/traceViewer/recorder.B76AH9PE.js +0 -551
- package/lib/vite/traceViewer/recorder.BHq8OXiu.js +0 -551
- package/lib/vite/traceViewer/recorder.BWH6blRw.js +0 -551
- package/lib/vite/traceViewer/recorder.DBDpiNOK.css +0 -15
- package/lib/vite/traceViewer/recorder.Db1aK_DY.js +0 -551
- package/lib/vite/traceViewer/recorder.Fwf59ZKh.js +0 -551
- package/lib/vite/traceViewer/recorder.uj3cfoMf.js +0 -551
- package/lib/vite/traceViewer/recorder.zV_xPHM4.js +0 -551
- package/lib/vite/traceViewer/uiMode.08ab2d90.js +0 -4
- package/lib/vite/traceViewer/uiMode.0d0d667b.js +0 -4
- package/lib/vite/traceViewer/uiMode.216233d5.js +0 -1484
- package/lib/vite/traceViewer/uiMode.2c31018f.css +0 -1324
- package/lib/vite/traceViewer/uiMode.3ff70f7d.js +0 -4
- package/lib/vite/traceViewer/uiMode.4d0a45af.js +0 -1484
- package/lib/vite/traceViewer/uiMode.66eb0ce2.js +0 -1484
- package/lib/vite/traceViewer/uiMode.8b41a49d.css +0 -1
- package/lib/vite/traceViewer/uiMode.8d080c01.js +0 -1486
- package/lib/vite/traceViewer/uiMode.BH2Nj2h0.js +0 -1724
- package/lib/vite/traceViewer/uiMode.BKrDfnAk.js +0 -1725
- package/lib/vite/traceViewer/uiMode.BMYUvsRh.js +0 -1725
- package/lib/vite/traceViewer/uiMode.BVpTBGoe.js +0 -1724
- package/lib/vite/traceViewer/uiMode.BWhJCEE9.js +0 -1725
- package/lib/vite/traceViewer/uiMode.Bg9fACTB.js +0 -1725
- package/lib/vite/traceViewer/uiMode.CBRJkC_K.js +0 -1724
- package/lib/vite/traceViewer/uiMode.CYBsUhm_.js +0 -1724
- package/lib/vite/traceViewer/uiMode.DCSdxlAq.js +0 -1724
- package/lib/vite/traceViewer/uiMode.DRmgrHSk.css +0 -1462
- package/lib/vite/traceViewer/uiMode.DtleKuGI.js +0 -1724
- package/lib/vite/traceViewer/uiMode.UamAvOMX.js +0 -1725
- package/lib/vite/traceViewer/uiMode._Kp3dUXk.js +0 -1724
- package/lib/vite/traceViewer/uiMode.bBcXYWNF.js +0 -1725
- package/lib/vite/traceViewer/uiMode.ca6ec898.js +0 -4
- package/lib/vite/traceViewer/uiMode.e-PLonGl.js +0 -1490
- package/lib/vite/traceViewer/uiMode.e_-GuqEi.js +0 -1725
- package/lib/vite/traceViewer/uiMode.f1YADWIl.js +0 -1724
- package/lib/vite/traceViewer/uiMode.kHsXCfV8.js +0 -1490
- package/lib/vite/traceViewer/uiMode.myF_lyEH.js +0 -1724
- package/lib/vite/traceViewer/uiMode.xvJHbkzl.css +0 -1324
- package/lib/vite/traceViewer/workbench.9Es1K_T7.css +0 -549
- package/lib/vite/traceViewer/workbench.BQNDbcQ0.css +0 -550
- package/lib/vite/traceViewer/wsPort.162042f9.css +0 -3450
- package/lib/vite/traceViewer/wsPort.997c92cf.css +0 -3513
- package/lib/vite/traceViewer/wsPort.9c9a6767.css +0 -1
- package/lib/vite/traceViewer/wsPort.p5jUwABW.css +0 -3450
- package/lib/vite/traceViewer/xtermModule.125f4259.css +0 -191
- package/lib/vite/traceViewer/xtermModule.4oRVGWQ-.css +0 -209
- package/lib/vite/traceViewer/xtermModule.6428296b.css +0 -32
- package/lib/vite/traceViewer/xtermModule.OKEVRlkP.css +0 -209
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d,j as e,L as Mt,k as Vt,l as _t,n as kt,m as F,P as J,f as K,C as Gt,o as Yt,u as ht,p as St,G as qt,q as Kt,v as Jt,w as Qt,x as Zt,h as jt,y as te,z as ee,A as se,N as ie,S as wt,B as ne,D as Nt,T as bt,I as ae,E as re}from"./inspectorTab-BPzhNk9r.js";const ce=Mt;function le({name:t,rootItem:s,render:i,icon:n,isError:c,isVisible:l,selectedItem:a,onAccepted:r,onSelected:o,onHighlighted:x,treeState:h,setTreeState:v,noItemsMessage:m,dataTestId:b,autoExpandDepth:j}){const w=d.useMemo(()=>oe(s,a,h.expandedItems,j||0),[s,a,h,j]),M=d.useMemo(()=>{if(!l)return[...w.keys()];const f=new Map,N=T=>{const L=f.get(T);if(L!==void 0)return L;let R=T.children.some(z=>N(z));for(const z of T.children){const G=N(z);R=R||G}const X=l(T)||R;return f.set(T,X),X};for(const T of w.keys())N(T);const y=[];for(const T of w.keys())l(T)&&y.push(T);return y},[w,l]);return e.jsx(ce,{name:t,items:M,id:f=>f.id,dataTestId:b||t+"-tree",render:f=>{const N=i(f);return e.jsxs(e.Fragment,{children:[n&&e.jsx("div",{className:"codicon "+(n(f)||"blank"),style:{minWidth:16,marginRight:4}}),typeof N=="string"?e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:N}):N]})},icon:f=>{const N=w.get(f).expanded;if(typeof N=="boolean")return N?"codicon-chevron-down":"codicon-chevron-right"},isError:f=>(c==null?void 0:c(f))||!1,indent:f=>w.get(f).depth,selectedItem:a,onAccepted:f=>r==null?void 0:r(f),onSelected:f=>o==null?void 0:o(f),onHighlighted:f=>x==null?void 0:x(f),onLeftArrow:f=>{const{expanded:N,parent:y}=w.get(f);N?(h.expandedItems.set(f.id,!1),v({...h})):y&&(o==null||o(y))},onRightArrow:f=>{f.children.length&&(h.expandedItems.set(f.id,!0),v({...h}))},onIconClicked:f=>{const{expanded:N}=w.get(f);if(N){for(let y=a;y;y=y.parent)if(y===f){o==null||o(f);break}h.expandedItems.set(f.id,!1)}else h.expandedItems.set(f.id,!0);v({...h})},noItemsMessage:m})}function oe(t,s,i,n){const c=new Map,l=new Set;for(let r=s==null?void 0:s.parent;r;r=r.parent)l.add(r.id);const a=(r,o)=>{for(const x of r.children){const h=l.has(x.id)||i.get(x.id),v=n>o&&c.size<25&&h!==!1,m=x.children.length?h??v:void 0;c.set(x,{depth:o,expanded:m,parent:t===r?null:r}),m&&a(x,o+1)}};return a(t,0),c}const he=le,de=({actions:t,selectedAction:s,selectedTime:i,setSelectedTime:n,sdkLanguage:c,onSelected:l,onHighlighted:a,revealConsole:r,isLive:o})=>{const[x,h]=d.useState({expandedItems:new Map}),{rootItem:v,itemMap:m}=d.useMemo(()=>Vt(t),[t]),{selectedItem:b}=d.useMemo(()=>({selectedItem:s?m.get(s.callId):void 0}),[m,s]);return e.jsxs("div",{className:"vbox",children:[i&&e.jsxs("div",{className:"action-list-show-all",onClick:()=>n(void 0),children:[e.jsx("span",{className:"codicon codicon-triangle-left"}),"Show all"]}),e.jsx(he,{name:"actions",rootItem:v,treeState:x,setTreeState:h,selectedItem:b,onSelected:j=>l==null?void 0:l(j.action),onHighlighted:j=>a==null?void 0:a(j==null?void 0:j.action),onAccepted:j=>n({minimum:j.action.startTime,maximum:j.action.endTime}),isError:j=>{var w,M;return!!((M=(w=j.action)==null?void 0:w.error)!=null&&M.message)},isVisible:j=>!i||j.action.startTime<=i.maximum&&j.action.endTime>=i.minimum,render:j=>dt(j.action,{sdkLanguage:c,revealConsole:r,isLive:o,showDuration:!0,showBadges:!0})})]})},dt=(t,s)=>{const{sdkLanguage:i,revealConsole:n,isLive:c,showDuration:l,showBadges:a}=s,{errors:r,warnings:o}=_t(t),x=t.params.selector?kt(i||"javascript",t.params.selector):void 0;let h="";return t.endTime?h=F(t.endTime-t.startTime):t.error?h="Timed out":c||(h="-"),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"action-title",title:t.apiName,children:[e.jsx("span",{children:t.apiName}),x&&e.jsx("div",{className:"action-selector",title:x,children:x}),t.method==="goto"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:t.params.url}),t.class==="APIRequestContext"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:me(t.params.url)})]}),(l||a)&&e.jsx("div",{className:"spacer"}),l&&e.jsx("div",{className:"action-duration",children:h||e.jsx("span",{className:"codicon codicon-loading"})}),a&&e.jsxs("div",{className:"action-icons",onClick:()=>n==null?void 0:n(),children:[!!r&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-error"}),e.jsx("span",{className:"action-icon-value",children:r})]}),!!o&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-warning"}),e.jsx("span",{className:"action-icon-value",children:o})]})]})]})};function me(t){try{const s=new URL(t);return s.pathname+s.search}catch{return t}}const ue=({action:t,sdkLanguage:s})=>{if(!t)return e.jsx(J,{text:"No action selected"});const i={...t.params};delete i.info;const n=Object.keys(i),c=t.startTime+(t.context.wallTime-t.context.startTime),l=new Date(c).toLocaleString(),a=t.endTime?F(t.endTime-t.startTime):"Timed Out";return e.jsxs("div",{className:"call-tab",children:[e.jsx("div",{className:"call-line",children:t.apiName}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",children:"Time"}),l&&e.jsxs("div",{className:"call-line",children:["wall time:",e.jsx("span",{className:"call-value datetime",title:l,children:l})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value datetime",title:a,children:a})]})]}),!!n.length&&e.jsx("div",{className:"call-section",children:"Parameters"}),!!n.length&&n.map((r,o)=>yt(Tt(t,r,i[r],s),"param-"+o)),!!t.result&&e.jsx("div",{className:"call-section",children:"Return value"}),!!t.result&&Object.keys(t.result).map((r,o)=>yt(Tt(t,r,t.result[r],s),"result-"+o))]})};function yt(t,s){let i=t.text.replace(/\n/g,"↵");return t.type==="string"&&(i=`"${i}"`),e.jsxs("div",{className:"call-line",children:[t.name,":",e.jsx("span",{className:K("call-value",t.type),title:t.text,children:i}),["string","number","object","locator"].includes(t.type)&&e.jsx(Gt,{value:t.text})]},s)}function Tt(t,s,i,n){const c=t.method.includes("eval")||t.method==="waitForFunction";if(s==="files")return{text:"<files>",type:"string",name:s};if((s==="eventInit"||s==="expectedValue"||s==="arg"&&c)&&(i=tt(i.value,new Array(10).fill({handle:"<handle>"}))),(s==="value"&&c||s==="received"&&t.method==="expect")&&(i=tt(i,new Array(10).fill({handle:"<handle>"}))),s==="selector")return{text:kt(n||"javascript",t.params.selector),type:"locator",name:"locator"};const l=typeof i;return l!=="object"||i===null?{text:String(i),type:l,name:s}:i.guid?{text:"<handle>",type:"handle",name:s}:{text:JSON.stringify(i).slice(0,1e3),type:"object",name:s}}function tt(t,s){if(t.n!==void 0)return t.n;if(t.s!==void 0)return t.s;if(t.b!==void 0)return t.b;if(t.v!==void 0){if(t.v==="undefined")return;if(t.v==="null")return null;if(t.v==="NaN")return NaN;if(t.v==="Infinity")return 1/0;if(t.v==="-Infinity")return-1/0;if(t.v==="-0")return-0}if(t.d!==void 0)return new Date(t.d);if(t.r!==void 0)return new RegExp(t.r.p,t.r.f);if(t.a!==void 0)return t.a.map(i=>tt(i,s));if(t.o!==void 0){const i={};for(const{k:n,v:c}of t.o)i[n]=tt(c,s);return i}return t.h!==void 0?s===void 0?"<object>":s[t.h]:"<object>"}const xe=Mt,fe=({action:t,isLive:s})=>{const i=d.useMemo(()=>{var a;if(!t||!t.log.length)return[];const n=t.log,c=t.context.wallTime-t.context.startTime,l=[];for(let r=0;r<n.length;++r){let o="";if(n[r].time!==-1){const x=(a=n[r])==null?void 0:a.time;r+1<n.length?o=F(n[r+1].time-x):t.endTime>0?o=F(t.endTime-x):s?o=F(Date.now()-c-x):o="-"}l.push({message:n[r].message,time:o})}return l},[t,s]);return i.length?e.jsx(xe,{name:"log",items:i,render:n=>e.jsxs("div",{className:"log-list-item",children:[e.jsx("span",{className:"log-list-duration",children:n.time}),n.message]}),notSelectable:!0}):e.jsx(J,{text:"No log entries"})},pe=({error:t})=>{const s=d.useMemo(()=>Yt(t),[t]);return e.jsx("div",{className:"error-message",dangerouslySetInnerHTML:{__html:s||""}})};function ge(t){return d.useMemo(()=>{if(!t)return{errors:new Map};const s=new Map;for(const i of t.errorDescriptors)s.set(i.message,i);return{errors:s}},[t])}const ve=({errorsModel:t,sdkLanguage:s,revealInSource:i})=>t.errors.size?e.jsx("div",{className:"fill",style:{overflow:"auto"},children:[...t.errors.entries()].map(([n,c])=>{var o;let l,a;const r=(o=c.stack)==null?void 0:o[0];return r&&(l=r.file.replace(/.*[/\\](.*)/,"$1")+":"+r.line,a=r.file+":"+r.line),e.jsxs("div",{children:[e.jsxs("div",{className:"hbox",style:{alignItems:"center",padding:"5px 10px",minHeight:36,fontWeight:"bold",color:"var(--vscode-errorForeground)"},children:[c.action&&dt(c.action,{sdkLanguage:s}),l&&e.jsxs("div",{className:"action-location",children:["@ ",e.jsx("span",{title:a,onClick:()=>i(c),children:l})]})]}),e.jsx(pe,{error:n})]},n)})}):e.jsx(J,{text:"No errors"}),Ct={width:200,height:45},_=2.5,je=Ct.height+_*2,we=({model:t,boundaries:s,previewPoint:i})=>{var h,v;const[n,c]=ht(),l=d.useRef(null);let a=0;if(l.current&&i){const m=l.current.getBoundingClientRect();a=(i.clientY-m.top+l.current.scrollTop)/je|0}const r=(v=(h=t==null?void 0:t.pages)==null?void 0:h[a])==null?void 0:v.screencastFrames;let o,x;if(i!==void 0&&r&&r.length){const m=s.minimum+(s.maximum-s.minimum)*i.x/n.width;o=r[St(r,m,Lt)-1];const b={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};x=o?It({width:o.width,height:o.height},b):void 0}return e.jsxs("div",{className:"film-strip",ref:c,children:[e.jsx("div",{className:"film-strip-lanes",ref:l,children:t==null?void 0:t.pages.map((m,b)=>m.screencastFrames.length?e.jsx(Ne,{boundaries:s,page:m,width:n.width},b):null)}),(i==null?void 0:i.x)!==void 0&&e.jsxs("div",{className:"film-strip-hover",style:{top:n.bottom+5,left:Math.min(i.x,n.width-(x?x.width:0)-10)},children:[i.action&&e.jsx("div",{className:"film-strip-hover-title",children:dt(i.action,i)}),o&&x&&e.jsx("div",{style:{width:x.width,height:x.height},children:e.jsx("img",{src:`sha1/${o.sha1}`,width:x.width,height:x.height})})]})]})},Ne=({boundaries:t,page:s,width:i})=>{const n={width:0,height:0},c=s.screencastFrames;for(const w of c)n.width=Math.max(n.width,w.width),n.height=Math.max(n.height,w.height);const l=It(n,Ct),a=c[0].timestamp,r=c[c.length-1].timestamp,o=t.maximum-t.minimum,x=(a-t.minimum)/o*i,h=(t.maximum-r)/o*i,m=(r-a)/o*i/(l.width+2*_)|0,b=(r-a)/m,j=[];for(let w=0;a&&b&&w<m;++w){const M=a+b*w,f=St(c,M,Lt)-1;j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[f].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},w))}return j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[c.length-1].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},j.length)),e.jsx("div",{className:"film-strip-lane",style:{marginLeft:x+"px",marginRight:h+"px"},children:j})};function Lt(t,s){return t-s.timestamp}function It(t,s){const i=Math.max(t.width/s.width,t.height/s.height);return{width:t.width/i|0,height:t.height/i|0}}const be=({model:t,boundaries:s,consoleEntries:i,onSelected:n,highlightedAction:c,highlightedEntry:l,highlightedConsoleEntry:a,selectedTime:r,setSelectedTime:o,sdkLanguage:x})=>{const[h,v]=ht(),[m,b]=d.useState(),[j,w]=d.useState(),{offsets:M,curtainLeft:f,curtainRight:N}=d.useMemo(()=>{let p=r||s;if(m&&m.startX!==m.endX){const k=H(h.width,s,m.startX),I=H(h.width,s,m.endX);p={minimum:Math.min(k,I),maximum:Math.max(k,I)}}const u=W(h.width,s,p.minimum),C=W(h.width,s,s.maximum)-W(h.width,s,p.maximum);return{offsets:ye(h.width,s),curtainLeft:u,curtainRight:C}},[r,s,m,h]),y=d.useMemo(()=>{const p=[];for(const u of(t==null?void 0:t.actions)||[])u.class!=="Test"&&p.push({action:u,leftTime:u.startTime,rightTime:u.endTime||s.maximum,leftPosition:W(h.width,s,u.startTime),rightPosition:W(h.width,s,u.endTime||s.maximum),active:!1,error:!!u.error});for(const u of(t==null?void 0:t.resources)||[]){const S=u._monotonicTime,C=u._monotonicTime+u.time;p.push({resource:u,leftTime:S,rightTime:C,leftPosition:W(h.width,s,S),rightPosition:W(h.width,s,C),active:!1,error:!1})}for(const u of i||[])p.push({consoleMessage:u,leftTime:u.timestamp,rightTime:u.timestamp,leftPosition:W(h.width,s,u.timestamp),rightPosition:W(h.width,s,u.timestamp),active:!1,error:u.isError});return p},[t,i,s,h]);d.useMemo(()=>{for(const p of y)c?p.active=p.action===c:l?p.active=p.resource===l:a?p.active=p.consoleMessage===a:p.active=!1},[y,c,l,a]);const T=d.useCallback(p=>{if(w(void 0),!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=r?W(h.width,s,r.minimum):0,k=r?W(h.width,s,r.maximum):0;r&&Math.abs(u-C)<10?b({startX:k,endX:u,type:"resize"}):r&&Math.abs(u-k)<10?b({startX:C,endX:u,type:"resize"}):r&&S>r.minimum&&S<r.maximum&&p.clientY-v.current.getBoundingClientRect().top<20?b({startX:C,endX:k,pivot:u,type:"move"}):b({startX:u,endX:u,type:"resize"})},[s,h,v,r]),L=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(A=>A.startTime<=S);if(!p.buttons){b(void 0);return}if(C&&n(C),!m)return;let k=m;if(m.type==="resize")k={...m,endX:u};else{const A=u-m.pivot;let U=m.startX+A,$=m.endX+A;U<0&&(U=0,$=U+(m.endX-m.startX)),$>h.width&&($=h.width,U=$-(m.endX-m.startX)),k={...m,startX:U,endX:$,pivot:u}}b(k);const I=H(h.width,s,k.startX),P=H(h.width,s,k.endX);I!==P&&o({minimum:Math.min(I,P),maximum:Math.max(I,P)})},[s,m,h,t,n,v,o]),R=d.useCallback(()=>{if(w(void 0),!!m){if(m.startX!==m.endX){const p=H(h.width,s,m.startX),u=H(h.width,s,m.endX);o({minimum:Math.min(p,u),maximum:Math.max(p,u)})}else{const p=H(h.width,s,m.startX),u=t==null?void 0:t.actions.findLast(S=>S.startTime<=p);u&&n(u),o(void 0)}b(void 0)}},[s,m,h,t,o,n]),X=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(k=>k.startTime<=S);w({x:u,clientY:p.clientY,action:C,sdkLanguage:x})},[s,h,t,v,x]),z=d.useCallback(()=>{w(void 0)},[]),G=d.useCallback(()=>{o(void 0)},[o]);return e.jsxs("div",{style:{flex:"none",borderBottom:"1px solid var(--vscode-panel-border)"},children:[!!m&&e.jsx(qt,{cursor:(m==null?void 0:m.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:R,onPaneMouseMove:L,onPaneDoubleClick:G}),e.jsxs("div",{ref:v,className:"timeline-view",onMouseDown:T,onMouseMove:X,onMouseLeave:z,children:[e.jsx("div",{className:"timeline-grid",children:M.map((p,u)=>e.jsx("div",{className:"timeline-divider",style:{left:p.position+"px"},children:e.jsx("div",{className:"timeline-time",children:F(p.time-s.minimum)})},u))}),e.jsx("div",{style:{height:8}}),e.jsx(we,{model:t,boundaries:s,previewPoint:j}),e.jsx("div",{className:"timeline-bars",children:y.map((p,u)=>e.jsx("div",{className:K("timeline-bar",p.action&&"action",p.resource&&"network",p.consoleMessage&&"console-message",p.active&&"active",p.error&&"error"),style:{left:p.leftPosition,width:Math.max(5,p.rightPosition-p.leftPosition),top:Te(p),bottom:0}},u))}),e.jsx("div",{className:"timeline-marker",style:{display:j!==void 0?"block":"none",left:((j==null?void 0:j.x)||0)+"px"}}),r&&e.jsxs("div",{className:"timeline-window",children:[e.jsx("div",{className:"timeline-window-curtain left",style:{width:f}}),e.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),e.jsx("div",{className:"timeline-window-center",children:e.jsx("div",{className:"timeline-window-drag"})}),e.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),e.jsx("div",{className:"timeline-window-curtain right",style:{width:N}})]})]})]})};function ye(t,s){let n=t/64;const c=s.maximum-s.minimum,l=t/c;let a=c/n;const r=Math.ceil(Math.log(a)/Math.LN10);a=Math.pow(10,r),a*l>=5*64&&(a=a/5),a*l>=2*64&&(a=a/2);const o=s.minimum;let x=s.maximum;x+=64/l,n=Math.ceil((x-o)/a),a||(n=0);const h=[];for(let v=0;v<n;++v){const m=o+a*v;h.push({position:W(t,s,m),time:m})}return h}function W(t,s,i){return(i-s.minimum)/(s.maximum-s.minimum)*t}function H(t,s,i){return i/t*(s.maximum-s.minimum)+s.minimum}function Te(t){return t.resource?25:20}const Me=({model:t})=>{var s,i;return t?e.jsxs("div",{"data-testid":"metadata-view",className:"vbox",style:{flexShrink:0},children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!t.wallTime&&e.jsxs("div",{className:"call-line",children:["start time:",e.jsx("span",{className:"call-value datetime",title:new Date(t.wallTime).toLocaleString(),children:new Date(t.wallTime).toLocaleString()})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value number",title:F(t.endTime-t.startTime),children:F(t.endTime-t.startTime)})]}),e.jsx("div",{className:"call-section",children:"Browser"}),e.jsxs("div",{className:"call-line",children:["engine:",e.jsx("span",{className:"call-value string",title:t.browserName,children:t.browserName})]}),t.channel&&e.jsxs("div",{className:"call-line",children:["channel:",e.jsx("span",{className:"call-value string",title:t.channel,children:t.channel})]}),t.platform&&e.jsxs("div",{className:"call-line",children:["platform:",e.jsx("span",{className:"call-value string",title:t.platform,children:t.platform})]}),t.options.userAgent&&e.jsxs("div",{className:"call-line",children:["user agent:",e.jsx("span",{className:"call-value datetime",title:t.options.userAgent,children:t.options.userAgent})]}),t.options.baseURL&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),e.jsxs("div",{className:"call-line",children:["baseURL:",e.jsx("a",{className:"call-value string",href:t.options.baseURL,title:t.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:t.options.baseURL})]})]}),e.jsx("div",{className:"call-section",children:"Viewport"}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["width:",e.jsx("span",{className:"call-value number",title:String(!!((s=t.options.viewport)!=null&&s.width)),children:t.options.viewport.width})]}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["height:",e.jsx("span",{className:"call-value number",title:String(!!((i=t.options.viewport)!=null&&i.height)),children:t.options.viewport.height})]}),e.jsxs("div",{className:"call-line",children:["is mobile:",e.jsx("span",{className:"call-value boolean",title:String(!!t.options.isMobile),children:String(!!t.options.isMobile)})]}),t.options.deviceScaleFactor&&e.jsxs("div",{className:"call-line",children:["device scale:",e.jsx("span",{className:"call-value number",title:String(t.options.deviceScaleFactor),children:String(t.options.deviceScaleFactor)})]}),e.jsx("div",{className:"call-section",children:"Counts"}),e.jsxs("div",{className:"call-line",children:["pages:",e.jsx("span",{className:"call-value number",children:t.pages.length})]}),e.jsxs("div",{className:"call-line",children:["actions:",e.jsx("span",{className:"call-value number",children:t.actions.length})]}),e.jsxs("div",{className:"call-line",children:["events:",e.jsx("span",{className:"call-value number",children:t.events.length})]})]}):e.jsx(e.Fragment,{})};async function lt(t){const s=new Image;return t&&(s.src=t,await new Promise((i,n)=>{s.onload=i,s.onerror=i})),s}const ot={backgroundImage:`linear-gradient(45deg, #80808020 25%, transparent 25%),
|
|
1
|
+
import{r as d,j as e,L as Mt,k as Vt,l as _t,n as kt,m as F,P as J,f as K,C as Gt,o as Yt,u as ht,p as St,G as qt,q as Kt,v as Jt,w as Qt,x as Zt,h as jt,y as te,z as ee,A as se,N as ie,S as wt,B as ne,D as Nt,T as bt,I as ae,E as re}from"./inspectorTab-BuJ3wAX_.js";const ce=Mt;function le({name:t,rootItem:s,render:i,icon:n,isError:c,isVisible:l,selectedItem:a,onAccepted:r,onSelected:o,onHighlighted:x,treeState:h,setTreeState:v,noItemsMessage:m,dataTestId:b,autoExpandDepth:j}){const w=d.useMemo(()=>oe(s,a,h.expandedItems,j||0),[s,a,h,j]),M=d.useMemo(()=>{if(!l)return[...w.keys()];const f=new Map,N=T=>{const L=f.get(T);if(L!==void 0)return L;let R=T.children.some(z=>N(z));for(const z of T.children){const G=N(z);R=R||G}const X=l(T)||R;return f.set(T,X),X};for(const T of w.keys())N(T);const y=[];for(const T of w.keys())l(T)&&y.push(T);return y},[w,l]);return e.jsx(ce,{name:t,items:M,id:f=>f.id,dataTestId:b||t+"-tree",render:f=>{const N=i(f);return e.jsxs(e.Fragment,{children:[n&&e.jsx("div",{className:"codicon "+(n(f)||"blank"),style:{minWidth:16,marginRight:4}}),typeof N=="string"?e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:N}):N]})},icon:f=>{const N=w.get(f).expanded;if(typeof N=="boolean")return N?"codicon-chevron-down":"codicon-chevron-right"},isError:f=>(c==null?void 0:c(f))||!1,indent:f=>w.get(f).depth,selectedItem:a,onAccepted:f=>r==null?void 0:r(f),onSelected:f=>o==null?void 0:o(f),onHighlighted:f=>x==null?void 0:x(f),onLeftArrow:f=>{const{expanded:N,parent:y}=w.get(f);N?(h.expandedItems.set(f.id,!1),v({...h})):y&&(o==null||o(y))},onRightArrow:f=>{f.children.length&&(h.expandedItems.set(f.id,!0),v({...h}))},onIconClicked:f=>{const{expanded:N}=w.get(f);if(N){for(let y=a;y;y=y.parent)if(y===f){o==null||o(f);break}h.expandedItems.set(f.id,!1)}else h.expandedItems.set(f.id,!0);v({...h})},noItemsMessage:m})}function oe(t,s,i,n){const c=new Map,l=new Set;for(let r=s==null?void 0:s.parent;r;r=r.parent)l.add(r.id);const a=(r,o)=>{for(const x of r.children){const h=l.has(x.id)||i.get(x.id),v=n>o&&c.size<25&&h!==!1,m=x.children.length?h??v:void 0;c.set(x,{depth:o,expanded:m,parent:t===r?null:r}),m&&a(x,o+1)}};return a(t,0),c}const he=le,de=({actions:t,selectedAction:s,selectedTime:i,setSelectedTime:n,sdkLanguage:c,onSelected:l,onHighlighted:a,revealConsole:r,isLive:o})=>{const[x,h]=d.useState({expandedItems:new Map}),{rootItem:v,itemMap:m}=d.useMemo(()=>Vt(t),[t]),{selectedItem:b}=d.useMemo(()=>({selectedItem:s?m.get(s.callId):void 0}),[m,s]);return e.jsxs("div",{className:"vbox",children:[i&&e.jsxs("div",{className:"action-list-show-all",onClick:()=>n(void 0),children:[e.jsx("span",{className:"codicon codicon-triangle-left"}),"Show all"]}),e.jsx(he,{name:"actions",rootItem:v,treeState:x,setTreeState:h,selectedItem:b,onSelected:j=>l==null?void 0:l(j.action),onHighlighted:j=>a==null?void 0:a(j==null?void 0:j.action),onAccepted:j=>n({minimum:j.action.startTime,maximum:j.action.endTime}),isError:j=>{var w,M;return!!((M=(w=j.action)==null?void 0:w.error)!=null&&M.message)},isVisible:j=>!i||j.action.startTime<=i.maximum&&j.action.endTime>=i.minimum,render:j=>dt(j.action,{sdkLanguage:c,revealConsole:r,isLive:o,showDuration:!0,showBadges:!0})})]})},dt=(t,s)=>{const{sdkLanguage:i,revealConsole:n,isLive:c,showDuration:l,showBadges:a}=s,{errors:r,warnings:o}=_t(t),x=t.params.selector?kt(i||"javascript",t.params.selector):void 0;let h="";return t.endTime?h=F(t.endTime-t.startTime):t.error?h="Timed out":c||(h="-"),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"action-title",title:t.apiName,children:[e.jsx("span",{children:t.apiName}),x&&e.jsx("div",{className:"action-selector",title:x,children:x}),t.method==="goto"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:t.params.url}),t.class==="APIRequestContext"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:me(t.params.url)})]}),(l||a)&&e.jsx("div",{className:"spacer"}),l&&e.jsx("div",{className:"action-duration",children:h||e.jsx("span",{className:"codicon codicon-loading"})}),a&&e.jsxs("div",{className:"action-icons",onClick:()=>n==null?void 0:n(),children:[!!r&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-error"}),e.jsx("span",{className:"action-icon-value",children:r})]}),!!o&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-warning"}),e.jsx("span",{className:"action-icon-value",children:o})]})]})]})};function me(t){try{const s=new URL(t);return s.pathname+s.search}catch{return t}}const ue=({action:t,sdkLanguage:s})=>{if(!t)return e.jsx(J,{text:"No action selected"});const i={...t.params};delete i.info;const n=Object.keys(i),c=t.startTime+(t.context.wallTime-t.context.startTime),l=new Date(c).toLocaleString(),a=t.endTime?F(t.endTime-t.startTime):"Timed Out";return e.jsxs("div",{className:"call-tab",children:[e.jsx("div",{className:"call-line",children:t.apiName}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",children:"Time"}),l&&e.jsxs("div",{className:"call-line",children:["wall time:",e.jsx("span",{className:"call-value datetime",title:l,children:l})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value datetime",title:a,children:a})]})]}),!!n.length&&e.jsx("div",{className:"call-section",children:"Parameters"}),!!n.length&&n.map((r,o)=>yt(Tt(t,r,i[r],s),"param-"+o)),!!t.result&&e.jsx("div",{className:"call-section",children:"Return value"}),!!t.result&&Object.keys(t.result).map((r,o)=>yt(Tt(t,r,t.result[r],s),"result-"+o))]})};function yt(t,s){let i=t.text.replace(/\n/g,"↵");return t.type==="string"&&(i=`"${i}"`),e.jsxs("div",{className:"call-line",children:[t.name,":",e.jsx("span",{className:K("call-value",t.type),title:t.text,children:i}),["string","number","object","locator"].includes(t.type)&&e.jsx(Gt,{value:t.text})]},s)}function Tt(t,s,i,n){const c=t.method.includes("eval")||t.method==="waitForFunction";if(s==="files")return{text:"<files>",type:"string",name:s};if((s==="eventInit"||s==="expectedValue"||s==="arg"&&c)&&(i=tt(i.value,new Array(10).fill({handle:"<handle>"}))),(s==="value"&&c||s==="received"&&t.method==="expect")&&(i=tt(i,new Array(10).fill({handle:"<handle>"}))),s==="selector")return{text:kt(n||"javascript",t.params.selector),type:"locator",name:"locator"};const l=typeof i;return l!=="object"||i===null?{text:String(i),type:l,name:s}:i.guid?{text:"<handle>",type:"handle",name:s}:{text:JSON.stringify(i).slice(0,1e3),type:"object",name:s}}function tt(t,s){if(t.n!==void 0)return t.n;if(t.s!==void 0)return t.s;if(t.b!==void 0)return t.b;if(t.v!==void 0){if(t.v==="undefined")return;if(t.v==="null")return null;if(t.v==="NaN")return NaN;if(t.v==="Infinity")return 1/0;if(t.v==="-Infinity")return-1/0;if(t.v==="-0")return-0}if(t.d!==void 0)return new Date(t.d);if(t.r!==void 0)return new RegExp(t.r.p,t.r.f);if(t.a!==void 0)return t.a.map(i=>tt(i,s));if(t.o!==void 0){const i={};for(const{k:n,v:c}of t.o)i[n]=tt(c,s);return i}return t.h!==void 0?s===void 0?"<object>":s[t.h]:"<object>"}const xe=Mt,fe=({action:t,isLive:s})=>{const i=d.useMemo(()=>{var a;if(!t||!t.log.length)return[];const n=t.log,c=t.context.wallTime-t.context.startTime,l=[];for(let r=0;r<n.length;++r){let o="";if(n[r].time!==-1){const x=(a=n[r])==null?void 0:a.time;r+1<n.length?o=F(n[r+1].time-x):t.endTime>0?o=F(t.endTime-x):s?o=F(Date.now()-c-x):o="-"}l.push({message:n[r].message,time:o})}return l},[t,s]);return i.length?e.jsx(xe,{name:"log",items:i,render:n=>e.jsxs("div",{className:"log-list-item",children:[e.jsx("span",{className:"log-list-duration",children:n.time}),n.message]}),notSelectable:!0}):e.jsx(J,{text:"No log entries"})},pe=({error:t})=>{const s=d.useMemo(()=>Yt(t),[t]);return e.jsx("div",{className:"error-message",dangerouslySetInnerHTML:{__html:s||""}})};function ge(t){return d.useMemo(()=>{if(!t)return{errors:new Map};const s=new Map;for(const i of t.errorDescriptors)s.set(i.message,i);return{errors:s}},[t])}const ve=({errorsModel:t,sdkLanguage:s,revealInSource:i})=>t.errors.size?e.jsx("div",{className:"fill",style:{overflow:"auto"},children:[...t.errors.entries()].map(([n,c])=>{var o;let l,a;const r=(o=c.stack)==null?void 0:o[0];return r&&(l=r.file.replace(/.*[/\\](.*)/,"$1")+":"+r.line,a=r.file+":"+r.line),e.jsxs("div",{children:[e.jsxs("div",{className:"hbox",style:{alignItems:"center",padding:"5px 10px",minHeight:36,fontWeight:"bold",color:"var(--vscode-errorForeground)"},children:[c.action&&dt(c.action,{sdkLanguage:s}),l&&e.jsxs("div",{className:"action-location",children:["@ ",e.jsx("span",{title:a,onClick:()=>i(c),children:l})]})]}),e.jsx(pe,{error:n})]},n)})}):e.jsx(J,{text:"No errors"}),Ct={width:200,height:45},_=2.5,je=Ct.height+_*2,we=({model:t,boundaries:s,previewPoint:i})=>{var h,v;const[n,c]=ht(),l=d.useRef(null);let a=0;if(l.current&&i){const m=l.current.getBoundingClientRect();a=(i.clientY-m.top+l.current.scrollTop)/je|0}const r=(v=(h=t==null?void 0:t.pages)==null?void 0:h[a])==null?void 0:v.screencastFrames;let o,x;if(i!==void 0&&r&&r.length){const m=s.minimum+(s.maximum-s.minimum)*i.x/n.width;o=r[St(r,m,Lt)-1];const b={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};x=o?It({width:o.width,height:o.height},b):void 0}return e.jsxs("div",{className:"film-strip",ref:c,children:[e.jsx("div",{className:"film-strip-lanes",ref:l,children:t==null?void 0:t.pages.map((m,b)=>m.screencastFrames.length?e.jsx(Ne,{boundaries:s,page:m,width:n.width},b):null)}),(i==null?void 0:i.x)!==void 0&&e.jsxs("div",{className:"film-strip-hover",style:{top:n.bottom+5,left:Math.min(i.x,n.width-(x?x.width:0)-10)},children:[i.action&&e.jsx("div",{className:"film-strip-hover-title",children:dt(i.action,i)}),o&&x&&e.jsx("div",{style:{width:x.width,height:x.height},children:e.jsx("img",{src:`sha1/${o.sha1}`,width:x.width,height:x.height})})]})]})},Ne=({boundaries:t,page:s,width:i})=>{const n={width:0,height:0},c=s.screencastFrames;for(const w of c)n.width=Math.max(n.width,w.width),n.height=Math.max(n.height,w.height);const l=It(n,Ct),a=c[0].timestamp,r=c[c.length-1].timestamp,o=t.maximum-t.minimum,x=(a-t.minimum)/o*i,h=(t.maximum-r)/o*i,m=(r-a)/o*i/(l.width+2*_)|0,b=(r-a)/m,j=[];for(let w=0;a&&b&&w<m;++w){const M=a+b*w,f=St(c,M,Lt)-1;j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[f].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},w))}return j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[c.length-1].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},j.length)),e.jsx("div",{className:"film-strip-lane",style:{marginLeft:x+"px",marginRight:h+"px"},children:j})};function Lt(t,s){return t-s.timestamp}function It(t,s){const i=Math.max(t.width/s.width,t.height/s.height);return{width:t.width/i|0,height:t.height/i|0}}const be=({model:t,boundaries:s,consoleEntries:i,onSelected:n,highlightedAction:c,highlightedEntry:l,highlightedConsoleEntry:a,selectedTime:r,setSelectedTime:o,sdkLanguage:x})=>{const[h,v]=ht(),[m,b]=d.useState(),[j,w]=d.useState(),{offsets:M,curtainLeft:f,curtainRight:N}=d.useMemo(()=>{let p=r||s;if(m&&m.startX!==m.endX){const k=H(h.width,s,m.startX),I=H(h.width,s,m.endX);p={minimum:Math.min(k,I),maximum:Math.max(k,I)}}const u=W(h.width,s,p.minimum),C=W(h.width,s,s.maximum)-W(h.width,s,p.maximum);return{offsets:ye(h.width,s),curtainLeft:u,curtainRight:C}},[r,s,m,h]),y=d.useMemo(()=>{const p=[];for(const u of(t==null?void 0:t.actions)||[])u.class!=="Test"&&p.push({action:u,leftTime:u.startTime,rightTime:u.endTime||s.maximum,leftPosition:W(h.width,s,u.startTime),rightPosition:W(h.width,s,u.endTime||s.maximum),active:!1,error:!!u.error});for(const u of(t==null?void 0:t.resources)||[]){const S=u._monotonicTime,C=u._monotonicTime+u.time;p.push({resource:u,leftTime:S,rightTime:C,leftPosition:W(h.width,s,S),rightPosition:W(h.width,s,C),active:!1,error:!1})}for(const u of i||[])p.push({consoleMessage:u,leftTime:u.timestamp,rightTime:u.timestamp,leftPosition:W(h.width,s,u.timestamp),rightPosition:W(h.width,s,u.timestamp),active:!1,error:u.isError});return p},[t,i,s,h]);d.useMemo(()=>{for(const p of y)c?p.active=p.action===c:l?p.active=p.resource===l:a?p.active=p.consoleMessage===a:p.active=!1},[y,c,l,a]);const T=d.useCallback(p=>{if(w(void 0),!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=r?W(h.width,s,r.minimum):0,k=r?W(h.width,s,r.maximum):0;r&&Math.abs(u-C)<10?b({startX:k,endX:u,type:"resize"}):r&&Math.abs(u-k)<10?b({startX:C,endX:u,type:"resize"}):r&&S>r.minimum&&S<r.maximum&&p.clientY-v.current.getBoundingClientRect().top<20?b({startX:C,endX:k,pivot:u,type:"move"}):b({startX:u,endX:u,type:"resize"})},[s,h,v,r]),L=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(A=>A.startTime<=S);if(!p.buttons){b(void 0);return}if(C&&n(C),!m)return;let k=m;if(m.type==="resize")k={...m,endX:u};else{const A=u-m.pivot;let U=m.startX+A,$=m.endX+A;U<0&&(U=0,$=U+(m.endX-m.startX)),$>h.width&&($=h.width,U=$-(m.endX-m.startX)),k={...m,startX:U,endX:$,pivot:u}}b(k);const I=H(h.width,s,k.startX),P=H(h.width,s,k.endX);I!==P&&o({minimum:Math.min(I,P),maximum:Math.max(I,P)})},[s,m,h,t,n,v,o]),R=d.useCallback(()=>{if(w(void 0),!!m){if(m.startX!==m.endX){const p=H(h.width,s,m.startX),u=H(h.width,s,m.endX);o({minimum:Math.min(p,u),maximum:Math.max(p,u)})}else{const p=H(h.width,s,m.startX),u=t==null?void 0:t.actions.findLast(S=>S.startTime<=p);u&&n(u),o(void 0)}b(void 0)}},[s,m,h,t,o,n]),X=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(k=>k.startTime<=S);w({x:u,clientY:p.clientY,action:C,sdkLanguage:x})},[s,h,t,v,x]),z=d.useCallback(()=>{w(void 0)},[]),G=d.useCallback(()=>{o(void 0)},[o]);return e.jsxs("div",{style:{flex:"none",borderBottom:"1px solid var(--vscode-panel-border)"},children:[!!m&&e.jsx(qt,{cursor:(m==null?void 0:m.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:R,onPaneMouseMove:L,onPaneDoubleClick:G}),e.jsxs("div",{ref:v,className:"timeline-view",onMouseDown:T,onMouseMove:X,onMouseLeave:z,children:[e.jsx("div",{className:"timeline-grid",children:M.map((p,u)=>e.jsx("div",{className:"timeline-divider",style:{left:p.position+"px"},children:e.jsx("div",{className:"timeline-time",children:F(p.time-s.minimum)})},u))}),e.jsx("div",{style:{height:8}}),e.jsx(we,{model:t,boundaries:s,previewPoint:j}),e.jsx("div",{className:"timeline-bars",children:y.map((p,u)=>e.jsx("div",{className:K("timeline-bar",p.action&&"action",p.resource&&"network",p.consoleMessage&&"console-message",p.active&&"active",p.error&&"error"),style:{left:p.leftPosition,width:Math.max(5,p.rightPosition-p.leftPosition),top:Te(p),bottom:0}},u))}),e.jsx("div",{className:"timeline-marker",style:{display:j!==void 0?"block":"none",left:((j==null?void 0:j.x)||0)+"px"}}),r&&e.jsxs("div",{className:"timeline-window",children:[e.jsx("div",{className:"timeline-window-curtain left",style:{width:f}}),e.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),e.jsx("div",{className:"timeline-window-center",children:e.jsx("div",{className:"timeline-window-drag"})}),e.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),e.jsx("div",{className:"timeline-window-curtain right",style:{width:N}})]})]})]})};function ye(t,s){let n=t/64;const c=s.maximum-s.minimum,l=t/c;let a=c/n;const r=Math.ceil(Math.log(a)/Math.LN10);a=Math.pow(10,r),a*l>=5*64&&(a=a/5),a*l>=2*64&&(a=a/2);const o=s.minimum;let x=s.maximum;x+=64/l,n=Math.ceil((x-o)/a),a||(n=0);const h=[];for(let v=0;v<n;++v){const m=o+a*v;h.push({position:W(t,s,m),time:m})}return h}function W(t,s,i){return(i-s.minimum)/(s.maximum-s.minimum)*t}function H(t,s,i){return i/t*(s.maximum-s.minimum)+s.minimum}function Te(t){return t.resource?25:20}const Me=({model:t})=>{var s,i;return t?e.jsxs("div",{"data-testid":"metadata-view",className:"vbox",style:{flexShrink:0},children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!t.wallTime&&e.jsxs("div",{className:"call-line",children:["start time:",e.jsx("span",{className:"call-value datetime",title:new Date(t.wallTime).toLocaleString(),children:new Date(t.wallTime).toLocaleString()})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value number",title:F(t.endTime-t.startTime),children:F(t.endTime-t.startTime)})]}),e.jsx("div",{className:"call-section",children:"Browser"}),e.jsxs("div",{className:"call-line",children:["engine:",e.jsx("span",{className:"call-value string",title:t.browserName,children:t.browserName})]}),t.channel&&e.jsxs("div",{className:"call-line",children:["channel:",e.jsx("span",{className:"call-value string",title:t.channel,children:t.channel})]}),t.platform&&e.jsxs("div",{className:"call-line",children:["platform:",e.jsx("span",{className:"call-value string",title:t.platform,children:t.platform})]}),t.options.userAgent&&e.jsxs("div",{className:"call-line",children:["user agent:",e.jsx("span",{className:"call-value datetime",title:t.options.userAgent,children:t.options.userAgent})]}),t.options.baseURL&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),e.jsxs("div",{className:"call-line",children:["baseURL:",e.jsx("a",{className:"call-value string",href:t.options.baseURL,title:t.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:t.options.baseURL})]})]}),e.jsx("div",{className:"call-section",children:"Viewport"}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["width:",e.jsx("span",{className:"call-value number",title:String(!!((s=t.options.viewport)!=null&&s.width)),children:t.options.viewport.width})]}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["height:",e.jsx("span",{className:"call-value number",title:String(!!((i=t.options.viewport)!=null&&i.height)),children:t.options.viewport.height})]}),e.jsxs("div",{className:"call-line",children:["is mobile:",e.jsx("span",{className:"call-value boolean",title:String(!!t.options.isMobile),children:String(!!t.options.isMobile)})]}),t.options.deviceScaleFactor&&e.jsxs("div",{className:"call-line",children:["device scale:",e.jsx("span",{className:"call-value number",title:String(t.options.deviceScaleFactor),children:String(t.options.deviceScaleFactor)})]}),e.jsx("div",{className:"call-section",children:"Counts"}),e.jsxs("div",{className:"call-line",children:["pages:",e.jsx("span",{className:"call-value number",children:t.pages.length})]}),e.jsxs("div",{className:"call-line",children:["actions:",e.jsx("span",{className:"call-value number",children:t.actions.length})]}),e.jsxs("div",{className:"call-line",children:["events:",e.jsx("span",{className:"call-value number",children:t.events.length})]})]}):e.jsx(e.Fragment,{})};async function lt(t){const s=new Image;return t&&(s.src=t,await new Promise((i,n)=>{s.onload=i,s.onerror=i})),s}const ot={backgroundImage:`linear-gradient(45deg, #80808020 25%, transparent 25%),
|
|
2
2
|
linear-gradient(-45deg, #80808020 25%, transparent 25%),
|
|
3
3
|
linear-gradient(45deg, transparent 75%, #80808020 75%),
|
|
4
4
|
linear-gradient(-45deg, transparent 75%, #80808020 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px",boxShadow:`rgb(0 0 0 / 10%) 0px 1.8px 1.9px,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d,j as e,L as Mt,k as Vt,l as _t,n as kt,m as F,P as J,f as K,C as Gt,o as Yt,u as ht,p as St,G as qt,q as Kt,v as Jt,w as Qt,x as Zt,h as jt,y as te,z as ee,A as se,N as ie,S as wt,B as ne,D as Nt,T as bt,I as ae,E as re}from"./inspectorTab-wfvwpMHs.js";const ce=Mt;function le({name:t,rootItem:s,render:i,icon:n,isError:c,isVisible:l,selectedItem:a,onAccepted:r,onSelected:o,onHighlighted:x,treeState:h,setTreeState:v,noItemsMessage:m,dataTestId:b,autoExpandDepth:j}){const w=d.useMemo(()=>oe(s,a,h.expandedItems,j||0),[s,a,h,j]),M=d.useMemo(()=>{if(!l)return[...w.keys()];const f=new Map,N=T=>{const L=f.get(T);if(L!==void 0)return L;let R=T.children.some(z=>N(z));for(const z of T.children){const G=N(z);R=R||G}const X=l(T)||R;return f.set(T,X),X};for(const T of w.keys())N(T);const y=[];for(const T of w.keys())l(T)&&y.push(T);return y},[w,l]);return e.jsx(ce,{name:t,items:M,id:f=>f.id,dataTestId:b||t+"-tree",render:f=>{const N=i(f);return e.jsxs(e.Fragment,{children:[n&&e.jsx("div",{className:"codicon "+(n(f)||"blank"),style:{minWidth:16,marginRight:4}}),typeof N=="string"?e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:N}):N]})},icon:f=>{const N=w.get(f).expanded;if(typeof N=="boolean")return N?"codicon-chevron-down":"codicon-chevron-right"},isError:f=>(c==null?void 0:c(f))||!1,indent:f=>w.get(f).depth,selectedItem:a,onAccepted:f=>r==null?void 0:r(f),onSelected:f=>o==null?void 0:o(f),onHighlighted:f=>x==null?void 0:x(f),onLeftArrow:f=>{const{expanded:N,parent:y}=w.get(f);N?(h.expandedItems.set(f.id,!1),v({...h})):y&&(o==null||o(y))},onRightArrow:f=>{f.children.length&&(h.expandedItems.set(f.id,!0),v({...h}))},onIconClicked:f=>{const{expanded:N}=w.get(f);if(N){for(let y=a;y;y=y.parent)if(y===f){o==null||o(f);break}h.expandedItems.set(f.id,!1)}else h.expandedItems.set(f.id,!0);v({...h})},noItemsMessage:m})}function oe(t,s,i,n){const c=new Map,l=new Set;for(let r=s==null?void 0:s.parent;r;r=r.parent)l.add(r.id);const a=(r,o)=>{for(const x of r.children){const h=l.has(x.id)||i.get(x.id),v=n>o&&c.size<25&&h!==!1,m=x.children.length?h??v:void 0;c.set(x,{depth:o,expanded:m,parent:t===r?null:r}),m&&a(x,o+1)}};return a(t,0),c}const he=le,de=({actions:t,selectedAction:s,selectedTime:i,setSelectedTime:n,sdkLanguage:c,onSelected:l,onHighlighted:a,revealConsole:r,isLive:o})=>{const[x,h]=d.useState({expandedItems:new Map}),{rootItem:v,itemMap:m}=d.useMemo(()=>Vt(t),[t]),{selectedItem:b}=d.useMemo(()=>({selectedItem:s?m.get(s.callId):void 0}),[m,s]);return e.jsxs("div",{className:"vbox",children:[i&&e.jsxs("div",{className:"action-list-show-all",onClick:()=>n(void 0),children:[e.jsx("span",{className:"codicon codicon-triangle-left"}),"Show all"]}),e.jsx(he,{name:"actions",rootItem:v,treeState:x,setTreeState:h,selectedItem:b,onSelected:j=>l==null?void 0:l(j.action),onHighlighted:j=>a==null?void 0:a(j==null?void 0:j.action),onAccepted:j=>n({minimum:j.action.startTime,maximum:j.action.endTime}),isError:j=>{var w,M;return!!((M=(w=j.action)==null?void 0:w.error)!=null&&M.message)},isVisible:j=>!i||j.action.startTime<=i.maximum&&j.action.endTime>=i.minimum,render:j=>dt(j.action,{sdkLanguage:c,revealConsole:r,isLive:o,showDuration:!0,showBadges:!0})})]})},dt=(t,s)=>{const{sdkLanguage:i,revealConsole:n,isLive:c,showDuration:l,showBadges:a}=s,{errors:r,warnings:o}=_t(t),x=t.params.selector?kt(i||"javascript",t.params.selector):void 0;let h="";return t.endTime?h=F(t.endTime-t.startTime):t.error?h="Timed out":c||(h="-"),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"action-title",title:t.apiName,children:[e.jsx("span",{children:t.apiName}),x&&e.jsx("div",{className:"action-selector",title:x,children:x}),t.method==="goto"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:t.params.url}),t.class==="APIRequestContext"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:me(t.params.url)})]}),(l||a)&&e.jsx("div",{className:"spacer"}),l&&e.jsx("div",{className:"action-duration",children:h||e.jsx("span",{className:"codicon codicon-loading"})}),a&&e.jsxs("div",{className:"action-icons",onClick:()=>n==null?void 0:n(),children:[!!r&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-error"}),e.jsx("span",{className:"action-icon-value",children:r})]}),!!o&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-warning"}),e.jsx("span",{className:"action-icon-value",children:o})]})]})]})};function me(t){try{const s=new URL(t);return s.pathname+s.search}catch{return t}}const ue=({action:t,sdkLanguage:s})=>{if(!t)return e.jsx(J,{text:"No action selected"});const i={...t.params};delete i.info;const n=Object.keys(i),c=t.startTime+(t.context.wallTime-t.context.startTime),l=new Date(c).toLocaleString(),a=t.endTime?F(t.endTime-t.startTime):"Timed Out";return e.jsxs("div",{className:"call-tab",children:[e.jsx("div",{className:"call-line",children:t.apiName}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",children:"Time"}),l&&e.jsxs("div",{className:"call-line",children:["wall time:",e.jsx("span",{className:"call-value datetime",title:l,children:l})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value datetime",title:a,children:a})]})]}),!!n.length&&e.jsx("div",{className:"call-section",children:"Parameters"}),!!n.length&&n.map((r,o)=>yt(Tt(t,r,i[r],s),"param-"+o)),!!t.result&&e.jsx("div",{className:"call-section",children:"Return value"}),!!t.result&&Object.keys(t.result).map((r,o)=>yt(Tt(t,r,t.result[r],s),"result-"+o))]})};function yt(t,s){let i=t.text.replace(/\n/g,"↵");return t.type==="string"&&(i=`"${i}"`),e.jsxs("div",{className:"call-line",children:[t.name,":",e.jsx("span",{className:K("call-value",t.type),title:t.text,children:i}),["string","number","object","locator"].includes(t.type)&&e.jsx(Gt,{value:t.text})]},s)}function Tt(t,s,i,n){const c=t.method.includes("eval")||t.method==="waitForFunction";if(s==="files")return{text:"<files>",type:"string",name:s};if((s==="eventInit"||s==="expectedValue"||s==="arg"&&c)&&(i=tt(i.value,new Array(10).fill({handle:"<handle>"}))),(s==="value"&&c||s==="received"&&t.method==="expect")&&(i=tt(i,new Array(10).fill({handle:"<handle>"}))),s==="selector")return{text:kt(n||"javascript",t.params.selector),type:"locator",name:"locator"};const l=typeof i;return l!=="object"||i===null?{text:String(i),type:l,name:s}:i.guid?{text:"<handle>",type:"handle",name:s}:{text:JSON.stringify(i).slice(0,1e3),type:"object",name:s}}function tt(t,s){if(t.n!==void 0)return t.n;if(t.s!==void 0)return t.s;if(t.b!==void 0)return t.b;if(t.v!==void 0){if(t.v==="undefined")return;if(t.v==="null")return null;if(t.v==="NaN")return NaN;if(t.v==="Infinity")return 1/0;if(t.v==="-Infinity")return-1/0;if(t.v==="-0")return-0}if(t.d!==void 0)return new Date(t.d);if(t.r!==void 0)return new RegExp(t.r.p,t.r.f);if(t.a!==void 0)return t.a.map(i=>tt(i,s));if(t.o!==void 0){const i={};for(const{k:n,v:c}of t.o)i[n]=tt(c,s);return i}return t.h!==void 0?s===void 0?"<object>":s[t.h]:"<object>"}const xe=Mt,fe=({action:t,isLive:s})=>{const i=d.useMemo(()=>{var a;if(!t||!t.log.length)return[];const n=t.log,c=t.context.wallTime-t.context.startTime,l=[];for(let r=0;r<n.length;++r){let o="";if(n[r].time!==-1){const x=(a=n[r])==null?void 0:a.time;r+1<n.length?o=F(n[r+1].time-x):t.endTime>0?o=F(t.endTime-x):s?o=F(Date.now()-c-x):o="-"}l.push({message:n[r].message,time:o})}return l},[t,s]);return i.length?e.jsx(xe,{name:"log",items:i,render:n=>e.jsxs("div",{className:"log-list-item",children:[e.jsx("span",{className:"log-list-duration",children:n.time}),n.message]}),notSelectable:!0}):e.jsx(J,{text:"No log entries"})},pe=({error:t})=>{const s=d.useMemo(()=>Yt(t),[t]);return e.jsx("div",{className:"error-message",dangerouslySetInnerHTML:{__html:s||""}})};function ge(t){return d.useMemo(()=>{if(!t)return{errors:new Map};const s=new Map;for(const i of t.errorDescriptors)s.set(i.message,i);return{errors:s}},[t])}const ve=({errorsModel:t,sdkLanguage:s,revealInSource:i})=>t.errors.size?e.jsx("div",{className:"fill",style:{overflow:"auto"},children:[...t.errors.entries()].map(([n,c])=>{var o;let l,a;const r=(o=c.stack)==null?void 0:o[0];return r&&(l=r.file.replace(/.*[/\\](.*)/,"$1")+":"+r.line,a=r.file+":"+r.line),e.jsxs("div",{children:[e.jsxs("div",{className:"hbox",style:{alignItems:"center",padding:"5px 10px",minHeight:36,fontWeight:"bold",color:"var(--vscode-errorForeground)"},children:[c.action&&dt(c.action,{sdkLanguage:s}),l&&e.jsxs("div",{className:"action-location",children:["@ ",e.jsx("span",{title:a,onClick:()=>i(c),children:l})]})]}),e.jsx(pe,{error:n})]},n)})}):e.jsx(J,{text:"No errors"}),Ct={width:200,height:45},_=2.5,je=Ct.height+_*2,we=({model:t,boundaries:s,previewPoint:i})=>{var h,v;const[n,c]=ht(),l=d.useRef(null);let a=0;if(l.current&&i){const m=l.current.getBoundingClientRect();a=(i.clientY-m.top+l.current.scrollTop)/je|0}const r=(v=(h=t==null?void 0:t.pages)==null?void 0:h[a])==null?void 0:v.screencastFrames;let o,x;if(i!==void 0&&r&&r.length){const m=s.minimum+(s.maximum-s.minimum)*i.x/n.width;o=r[St(r,m,Lt)-1];const b={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};x=o?It({width:o.width,height:o.height},b):void 0}return e.jsxs("div",{className:"film-strip",ref:c,children:[e.jsx("div",{className:"film-strip-lanes",ref:l,children:t==null?void 0:t.pages.map((m,b)=>m.screencastFrames.length?e.jsx(Ne,{boundaries:s,page:m,width:n.width},b):null)}),(i==null?void 0:i.x)!==void 0&&e.jsxs("div",{className:"film-strip-hover",style:{top:n.bottom+5,left:Math.min(i.x,n.width-(x?x.width:0)-10)},children:[i.action&&e.jsx("div",{className:"film-strip-hover-title",children:dt(i.action,i)}),o&&x&&e.jsx("div",{style:{width:x.width,height:x.height},children:e.jsx("img",{src:`sha1/${o.sha1}`,width:x.width,height:x.height})})]})]})},Ne=({boundaries:t,page:s,width:i})=>{const n={width:0,height:0},c=s.screencastFrames;for(const w of c)n.width=Math.max(n.width,w.width),n.height=Math.max(n.height,w.height);const l=It(n,Ct),a=c[0].timestamp,r=c[c.length-1].timestamp,o=t.maximum-t.minimum,x=(a-t.minimum)/o*i,h=(t.maximum-r)/o*i,m=(r-a)/o*i/(l.width+2*_)|0,b=(r-a)/m,j=[];for(let w=0;a&&b&&w<m;++w){const M=a+b*w,f=St(c,M,Lt)-1;j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[f].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},w))}return j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[c.length-1].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},j.length)),e.jsx("div",{className:"film-strip-lane",style:{marginLeft:x+"px",marginRight:h+"px"},children:j})};function Lt(t,s){return t-s.timestamp}function It(t,s){const i=Math.max(t.width/s.width,t.height/s.height);return{width:t.width/i|0,height:t.height/i|0}}const be=({model:t,boundaries:s,consoleEntries:i,onSelected:n,highlightedAction:c,highlightedEntry:l,highlightedConsoleEntry:a,selectedTime:r,setSelectedTime:o,sdkLanguage:x})=>{const[h,v]=ht(),[m,b]=d.useState(),[j,w]=d.useState(),{offsets:M,curtainLeft:f,curtainRight:N}=d.useMemo(()=>{let p=r||s;if(m&&m.startX!==m.endX){const k=H(h.width,s,m.startX),I=H(h.width,s,m.endX);p={minimum:Math.min(k,I),maximum:Math.max(k,I)}}const u=W(h.width,s,p.minimum),C=W(h.width,s,s.maximum)-W(h.width,s,p.maximum);return{offsets:ye(h.width,s),curtainLeft:u,curtainRight:C}},[r,s,m,h]),y=d.useMemo(()=>{const p=[];for(const u of(t==null?void 0:t.actions)||[])u.class!=="Test"&&p.push({action:u,leftTime:u.startTime,rightTime:u.endTime||s.maximum,leftPosition:W(h.width,s,u.startTime),rightPosition:W(h.width,s,u.endTime||s.maximum),active:!1,error:!!u.error});for(const u of(t==null?void 0:t.resources)||[]){const S=u._monotonicTime,C=u._monotonicTime+u.time;p.push({resource:u,leftTime:S,rightTime:C,leftPosition:W(h.width,s,S),rightPosition:W(h.width,s,C),active:!1,error:!1})}for(const u of i||[])p.push({consoleMessage:u,leftTime:u.timestamp,rightTime:u.timestamp,leftPosition:W(h.width,s,u.timestamp),rightPosition:W(h.width,s,u.timestamp),active:!1,error:u.isError});return p},[t,i,s,h]);d.useMemo(()=>{for(const p of y)c?p.active=p.action===c:l?p.active=p.resource===l:a?p.active=p.consoleMessage===a:p.active=!1},[y,c,l,a]);const T=d.useCallback(p=>{if(w(void 0),!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=r?W(h.width,s,r.minimum):0,k=r?W(h.width,s,r.maximum):0;r&&Math.abs(u-C)<10?b({startX:k,endX:u,type:"resize"}):r&&Math.abs(u-k)<10?b({startX:C,endX:u,type:"resize"}):r&&S>r.minimum&&S<r.maximum&&p.clientY-v.current.getBoundingClientRect().top<20?b({startX:C,endX:k,pivot:u,type:"move"}):b({startX:u,endX:u,type:"resize"})},[s,h,v,r]),L=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(A=>A.startTime<=S);if(!p.buttons){b(void 0);return}if(C&&n(C),!m)return;let k=m;if(m.type==="resize")k={...m,endX:u};else{const A=u-m.pivot;let U=m.startX+A,$=m.endX+A;U<0&&(U=0,$=U+(m.endX-m.startX)),$>h.width&&($=h.width,U=$-(m.endX-m.startX)),k={...m,startX:U,endX:$,pivot:u}}b(k);const I=H(h.width,s,k.startX),P=H(h.width,s,k.endX);I!==P&&o({minimum:Math.min(I,P),maximum:Math.max(I,P)})},[s,m,h,t,n,v,o]),R=d.useCallback(()=>{if(w(void 0),!!m){if(m.startX!==m.endX){const p=H(h.width,s,m.startX),u=H(h.width,s,m.endX);o({minimum:Math.min(p,u),maximum:Math.max(p,u)})}else{const p=H(h.width,s,m.startX),u=t==null?void 0:t.actions.findLast(S=>S.startTime<=p);u&&n(u),o(void 0)}b(void 0)}},[s,m,h,t,o,n]),X=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(k=>k.startTime<=S);w({x:u,clientY:p.clientY,action:C,sdkLanguage:x})},[s,h,t,v,x]),z=d.useCallback(()=>{w(void 0)},[]),G=d.useCallback(()=>{o(void 0)},[o]);return e.jsxs("div",{style:{flex:"none",borderBottom:"1px solid var(--vscode-panel-border)"},children:[!!m&&e.jsx(qt,{cursor:(m==null?void 0:m.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:R,onPaneMouseMove:L,onPaneDoubleClick:G}),e.jsxs("div",{ref:v,className:"timeline-view",onMouseDown:T,onMouseMove:X,onMouseLeave:z,children:[e.jsx("div",{className:"timeline-grid",children:M.map((p,u)=>e.jsx("div",{className:"timeline-divider",style:{left:p.position+"px"},children:e.jsx("div",{className:"timeline-time",children:F(p.time-s.minimum)})},u))}),e.jsx("div",{style:{height:8}}),e.jsx(we,{model:t,boundaries:s,previewPoint:j}),e.jsx("div",{className:"timeline-bars",children:y.map((p,u)=>e.jsx("div",{className:K("timeline-bar",p.action&&"action",p.resource&&"network",p.consoleMessage&&"console-message",p.active&&"active",p.error&&"error"),style:{left:p.leftPosition,width:Math.max(5,p.rightPosition-p.leftPosition),top:Te(p),bottom:0}},u))}),e.jsx("div",{className:"timeline-marker",style:{display:j!==void 0?"block":"none",left:((j==null?void 0:j.x)||0)+"px"}}),r&&e.jsxs("div",{className:"timeline-window",children:[e.jsx("div",{className:"timeline-window-curtain left",style:{width:f}}),e.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),e.jsx("div",{className:"timeline-window-center",children:e.jsx("div",{className:"timeline-window-drag"})}),e.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),e.jsx("div",{className:"timeline-window-curtain right",style:{width:N}})]})]})]})};function ye(t,s){let n=t/64;const c=s.maximum-s.minimum,l=t/c;let a=c/n;const r=Math.ceil(Math.log(a)/Math.LN10);a=Math.pow(10,r),a*l>=5*64&&(a=a/5),a*l>=2*64&&(a=a/2);const o=s.minimum;let x=s.maximum;x+=64/l,n=Math.ceil((x-o)/a),a||(n=0);const h=[];for(let v=0;v<n;++v){const m=o+a*v;h.push({position:W(t,s,m),time:m})}return h}function W(t,s,i){return(i-s.minimum)/(s.maximum-s.minimum)*t}function H(t,s,i){return i/t*(s.maximum-s.minimum)+s.minimum}function Te(t){return t.resource?25:20}const Me=({model:t})=>{var s,i;return t?e.jsxs("div",{"data-testid":"metadata-view",className:"vbox",style:{flexShrink:0},children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!t.wallTime&&e.jsxs("div",{className:"call-line",children:["start time:",e.jsx("span",{className:"call-value datetime",title:new Date(t.wallTime).toLocaleString(),children:new Date(t.wallTime).toLocaleString()})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value number",title:F(t.endTime-t.startTime),children:F(t.endTime-t.startTime)})]}),e.jsx("div",{className:"call-section",children:"Browser"}),e.jsxs("div",{className:"call-line",children:["engine:",e.jsx("span",{className:"call-value string",title:t.browserName,children:t.browserName})]}),t.channel&&e.jsxs("div",{className:"call-line",children:["channel:",e.jsx("span",{className:"call-value string",title:t.channel,children:t.channel})]}),t.platform&&e.jsxs("div",{className:"call-line",children:["platform:",e.jsx("span",{className:"call-value string",title:t.platform,children:t.platform})]}),t.options.userAgent&&e.jsxs("div",{className:"call-line",children:["user agent:",e.jsx("span",{className:"call-value datetime",title:t.options.userAgent,children:t.options.userAgent})]}),t.options.baseURL&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),e.jsxs("div",{className:"call-line",children:["baseURL:",e.jsx("a",{className:"call-value string",href:t.options.baseURL,title:t.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:t.options.baseURL})]})]}),e.jsx("div",{className:"call-section",children:"Viewport"}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["width:",e.jsx("span",{className:"call-value number",title:String(!!((s=t.options.viewport)!=null&&s.width)),children:t.options.viewport.width})]}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["height:",e.jsx("span",{className:"call-value number",title:String(!!((i=t.options.viewport)!=null&&i.height)),children:t.options.viewport.height})]}),e.jsxs("div",{className:"call-line",children:["is mobile:",e.jsx("span",{className:"call-value boolean",title:String(!!t.options.isMobile),children:String(!!t.options.isMobile)})]}),t.options.deviceScaleFactor&&e.jsxs("div",{className:"call-line",children:["device scale:",e.jsx("span",{className:"call-value number",title:String(t.options.deviceScaleFactor),children:String(t.options.deviceScaleFactor)})]}),e.jsx("div",{className:"call-section",children:"Counts"}),e.jsxs("div",{className:"call-line",children:["pages:",e.jsx("span",{className:"call-value number",children:t.pages.length})]}),e.jsxs("div",{className:"call-line",children:["actions:",e.jsx("span",{className:"call-value number",children:t.actions.length})]}),e.jsxs("div",{className:"call-line",children:["events:",e.jsx("span",{className:"call-value number",children:t.events.length})]})]}):e.jsx(e.Fragment,{})};async function lt(t){const s=new Image;return t&&(s.src=t,await new Promise((i,n)=>{s.onload=i,s.onerror=i})),s}const ot={backgroundImage:`linear-gradient(45deg, #80808020 25%, transparent 25%),
|
|
1
|
+
import{r as d,j as e,L as Mt,k as Vt,l as _t,n as kt,m as F,P as J,f as K,C as Gt,o as Yt,u as ht,p as St,G as qt,q as Kt,v as Jt,w as Qt,x as Zt,h as jt,y as te,z as ee,A as se,N as ie,S as wt,B as ne,D as Nt,T as bt,I as ae,E as re}from"./inspectorTab-Soeeuvzv.js";const ce=Mt;function le({name:t,rootItem:s,render:i,icon:n,isError:c,isVisible:l,selectedItem:a,onAccepted:r,onSelected:o,onHighlighted:x,treeState:h,setTreeState:v,noItemsMessage:m,dataTestId:b,autoExpandDepth:j}){const w=d.useMemo(()=>oe(s,a,h.expandedItems,j||0),[s,a,h,j]),M=d.useMemo(()=>{if(!l)return[...w.keys()];const f=new Map,N=T=>{const L=f.get(T);if(L!==void 0)return L;let R=T.children.some(z=>N(z));for(const z of T.children){const G=N(z);R=R||G}const X=l(T)||R;return f.set(T,X),X};for(const T of w.keys())N(T);const y=[];for(const T of w.keys())l(T)&&y.push(T);return y},[w,l]);return e.jsx(ce,{name:t,items:M,id:f=>f.id,dataTestId:b||t+"-tree",render:f=>{const N=i(f);return e.jsxs(e.Fragment,{children:[n&&e.jsx("div",{className:"codicon "+(n(f)||"blank"),style:{minWidth:16,marginRight:4}}),typeof N=="string"?e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:N}):N]})},icon:f=>{const N=w.get(f).expanded;if(typeof N=="boolean")return N?"codicon-chevron-down":"codicon-chevron-right"},isError:f=>(c==null?void 0:c(f))||!1,indent:f=>w.get(f).depth,selectedItem:a,onAccepted:f=>r==null?void 0:r(f),onSelected:f=>o==null?void 0:o(f),onHighlighted:f=>x==null?void 0:x(f),onLeftArrow:f=>{const{expanded:N,parent:y}=w.get(f);N?(h.expandedItems.set(f.id,!1),v({...h})):y&&(o==null||o(y))},onRightArrow:f=>{f.children.length&&(h.expandedItems.set(f.id,!0),v({...h}))},onIconClicked:f=>{const{expanded:N}=w.get(f);if(N){for(let y=a;y;y=y.parent)if(y===f){o==null||o(f);break}h.expandedItems.set(f.id,!1)}else h.expandedItems.set(f.id,!0);v({...h})},noItemsMessage:m})}function oe(t,s,i,n){const c=new Map,l=new Set;for(let r=s==null?void 0:s.parent;r;r=r.parent)l.add(r.id);const a=(r,o)=>{for(const x of r.children){const h=l.has(x.id)||i.get(x.id),v=n>o&&c.size<25&&h!==!1,m=x.children.length?h??v:void 0;c.set(x,{depth:o,expanded:m,parent:t===r?null:r}),m&&a(x,o+1)}};return a(t,0),c}const he=le,de=({actions:t,selectedAction:s,selectedTime:i,setSelectedTime:n,sdkLanguage:c,onSelected:l,onHighlighted:a,revealConsole:r,isLive:o})=>{const[x,h]=d.useState({expandedItems:new Map}),{rootItem:v,itemMap:m}=d.useMemo(()=>Vt(t),[t]),{selectedItem:b}=d.useMemo(()=>({selectedItem:s?m.get(s.callId):void 0}),[m,s]);return e.jsxs("div",{className:"vbox",children:[i&&e.jsxs("div",{className:"action-list-show-all",onClick:()=>n(void 0),children:[e.jsx("span",{className:"codicon codicon-triangle-left"}),"Show all"]}),e.jsx(he,{name:"actions",rootItem:v,treeState:x,setTreeState:h,selectedItem:b,onSelected:j=>l==null?void 0:l(j.action),onHighlighted:j=>a==null?void 0:a(j==null?void 0:j.action),onAccepted:j=>n({minimum:j.action.startTime,maximum:j.action.endTime}),isError:j=>{var w,M;return!!((M=(w=j.action)==null?void 0:w.error)!=null&&M.message)},isVisible:j=>!i||j.action.startTime<=i.maximum&&j.action.endTime>=i.minimum,render:j=>dt(j.action,{sdkLanguage:c,revealConsole:r,isLive:o,showDuration:!0,showBadges:!0})})]})},dt=(t,s)=>{const{sdkLanguage:i,revealConsole:n,isLive:c,showDuration:l,showBadges:a}=s,{errors:r,warnings:o}=_t(t),x=t.params.selector?kt(i||"javascript",t.params.selector):void 0;let h="";return t.endTime?h=F(t.endTime-t.startTime):t.error?h="Timed out":c||(h="-"),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"action-title",title:t.apiName,children:[e.jsx("span",{children:t.apiName}),x&&e.jsx("div",{className:"action-selector",title:x,children:x}),t.method==="goto"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:t.params.url}),t.class==="APIRequestContext"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:me(t.params.url)})]}),(l||a)&&e.jsx("div",{className:"spacer"}),l&&e.jsx("div",{className:"action-duration",children:h||e.jsx("span",{className:"codicon codicon-loading"})}),a&&e.jsxs("div",{className:"action-icons",onClick:()=>n==null?void 0:n(),children:[!!r&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-error"}),e.jsx("span",{className:"action-icon-value",children:r})]}),!!o&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-warning"}),e.jsx("span",{className:"action-icon-value",children:o})]})]})]})};function me(t){try{const s=new URL(t);return s.pathname+s.search}catch{return t}}const ue=({action:t,sdkLanguage:s})=>{if(!t)return e.jsx(J,{text:"No action selected"});const i={...t.params};delete i.info;const n=Object.keys(i),c=t.startTime+(t.context.wallTime-t.context.startTime),l=new Date(c).toLocaleString(),a=t.endTime?F(t.endTime-t.startTime):"Timed Out";return e.jsxs("div",{className:"call-tab",children:[e.jsx("div",{className:"call-line",children:t.apiName}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",children:"Time"}),l&&e.jsxs("div",{className:"call-line",children:["wall time:",e.jsx("span",{className:"call-value datetime",title:l,children:l})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value datetime",title:a,children:a})]})]}),!!n.length&&e.jsx("div",{className:"call-section",children:"Parameters"}),!!n.length&&n.map((r,o)=>yt(Tt(t,r,i[r],s),"param-"+o)),!!t.result&&e.jsx("div",{className:"call-section",children:"Return value"}),!!t.result&&Object.keys(t.result).map((r,o)=>yt(Tt(t,r,t.result[r],s),"result-"+o))]})};function yt(t,s){let i=t.text.replace(/\n/g,"↵");return t.type==="string"&&(i=`"${i}"`),e.jsxs("div",{className:"call-line",children:[t.name,":",e.jsx("span",{className:K("call-value",t.type),title:t.text,children:i}),["string","number","object","locator"].includes(t.type)&&e.jsx(Gt,{value:t.text})]},s)}function Tt(t,s,i,n){const c=t.method.includes("eval")||t.method==="waitForFunction";if(s==="files")return{text:"<files>",type:"string",name:s};if((s==="eventInit"||s==="expectedValue"||s==="arg"&&c)&&(i=tt(i.value,new Array(10).fill({handle:"<handle>"}))),(s==="value"&&c||s==="received"&&t.method==="expect")&&(i=tt(i,new Array(10).fill({handle:"<handle>"}))),s==="selector")return{text:kt(n||"javascript",t.params.selector),type:"locator",name:"locator"};const l=typeof i;return l!=="object"||i===null?{text:String(i),type:l,name:s}:i.guid?{text:"<handle>",type:"handle",name:s}:{text:JSON.stringify(i).slice(0,1e3),type:"object",name:s}}function tt(t,s){if(t.n!==void 0)return t.n;if(t.s!==void 0)return t.s;if(t.b!==void 0)return t.b;if(t.v!==void 0){if(t.v==="undefined")return;if(t.v==="null")return null;if(t.v==="NaN")return NaN;if(t.v==="Infinity")return 1/0;if(t.v==="-Infinity")return-1/0;if(t.v==="-0")return-0}if(t.d!==void 0)return new Date(t.d);if(t.r!==void 0)return new RegExp(t.r.p,t.r.f);if(t.a!==void 0)return t.a.map(i=>tt(i,s));if(t.o!==void 0){const i={};for(const{k:n,v:c}of t.o)i[n]=tt(c,s);return i}return t.h!==void 0?s===void 0?"<object>":s[t.h]:"<object>"}const xe=Mt,fe=({action:t,isLive:s})=>{const i=d.useMemo(()=>{var a;if(!t||!t.log.length)return[];const n=t.log,c=t.context.wallTime-t.context.startTime,l=[];for(let r=0;r<n.length;++r){let o="";if(n[r].time!==-1){const x=(a=n[r])==null?void 0:a.time;r+1<n.length?o=F(n[r+1].time-x):t.endTime>0?o=F(t.endTime-x):s?o=F(Date.now()-c-x):o="-"}l.push({message:n[r].message,time:o})}return l},[t,s]);return i.length?e.jsx(xe,{name:"log",items:i,render:n=>e.jsxs("div",{className:"log-list-item",children:[e.jsx("span",{className:"log-list-duration",children:n.time}),n.message]}),notSelectable:!0}):e.jsx(J,{text:"No log entries"})},pe=({error:t})=>{const s=d.useMemo(()=>Yt(t),[t]);return e.jsx("div",{className:"error-message",dangerouslySetInnerHTML:{__html:s||""}})};function ge(t){return d.useMemo(()=>{if(!t)return{errors:new Map};const s=new Map;for(const i of t.errorDescriptors)s.set(i.message,i);return{errors:s}},[t])}const ve=({errorsModel:t,sdkLanguage:s,revealInSource:i})=>t.errors.size?e.jsx("div",{className:"fill",style:{overflow:"auto"},children:[...t.errors.entries()].map(([n,c])=>{var o;let l,a;const r=(o=c.stack)==null?void 0:o[0];return r&&(l=r.file.replace(/.*[/\\](.*)/,"$1")+":"+r.line,a=r.file+":"+r.line),e.jsxs("div",{children:[e.jsxs("div",{className:"hbox",style:{alignItems:"center",padding:"5px 10px",minHeight:36,fontWeight:"bold",color:"var(--vscode-errorForeground)"},children:[c.action&&dt(c.action,{sdkLanguage:s}),l&&e.jsxs("div",{className:"action-location",children:["@ ",e.jsx("span",{title:a,onClick:()=>i(c),children:l})]})]}),e.jsx(pe,{error:n})]},n)})}):e.jsx(J,{text:"No errors"}),Ct={width:200,height:45},_=2.5,je=Ct.height+_*2,we=({model:t,boundaries:s,previewPoint:i})=>{var h,v;const[n,c]=ht(),l=d.useRef(null);let a=0;if(l.current&&i){const m=l.current.getBoundingClientRect();a=(i.clientY-m.top+l.current.scrollTop)/je|0}const r=(v=(h=t==null?void 0:t.pages)==null?void 0:h[a])==null?void 0:v.screencastFrames;let o,x;if(i!==void 0&&r&&r.length){const m=s.minimum+(s.maximum-s.minimum)*i.x/n.width;o=r[St(r,m,Lt)-1];const b={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};x=o?It({width:o.width,height:o.height},b):void 0}return e.jsxs("div",{className:"film-strip",ref:c,children:[e.jsx("div",{className:"film-strip-lanes",ref:l,children:t==null?void 0:t.pages.map((m,b)=>m.screencastFrames.length?e.jsx(Ne,{boundaries:s,page:m,width:n.width},b):null)}),(i==null?void 0:i.x)!==void 0&&e.jsxs("div",{className:"film-strip-hover",style:{top:n.bottom+5,left:Math.min(i.x,n.width-(x?x.width:0)-10)},children:[i.action&&e.jsx("div",{className:"film-strip-hover-title",children:dt(i.action,i)}),o&&x&&e.jsx("div",{style:{width:x.width,height:x.height},children:e.jsx("img",{src:`sha1/${o.sha1}`,width:x.width,height:x.height})})]})]})},Ne=({boundaries:t,page:s,width:i})=>{const n={width:0,height:0},c=s.screencastFrames;for(const w of c)n.width=Math.max(n.width,w.width),n.height=Math.max(n.height,w.height);const l=It(n,Ct),a=c[0].timestamp,r=c[c.length-1].timestamp,o=t.maximum-t.minimum,x=(a-t.minimum)/o*i,h=(t.maximum-r)/o*i,m=(r-a)/o*i/(l.width+2*_)|0,b=(r-a)/m,j=[];for(let w=0;a&&b&&w<m;++w){const M=a+b*w,f=St(c,M,Lt)-1;j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[f].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},w))}return j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[c.length-1].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},j.length)),e.jsx("div",{className:"film-strip-lane",style:{marginLeft:x+"px",marginRight:h+"px"},children:j})};function Lt(t,s){return t-s.timestamp}function It(t,s){const i=Math.max(t.width/s.width,t.height/s.height);return{width:t.width/i|0,height:t.height/i|0}}const be=({model:t,boundaries:s,consoleEntries:i,onSelected:n,highlightedAction:c,highlightedEntry:l,highlightedConsoleEntry:a,selectedTime:r,setSelectedTime:o,sdkLanguage:x})=>{const[h,v]=ht(),[m,b]=d.useState(),[j,w]=d.useState(),{offsets:M,curtainLeft:f,curtainRight:N}=d.useMemo(()=>{let p=r||s;if(m&&m.startX!==m.endX){const k=H(h.width,s,m.startX),I=H(h.width,s,m.endX);p={minimum:Math.min(k,I),maximum:Math.max(k,I)}}const u=W(h.width,s,p.minimum),C=W(h.width,s,s.maximum)-W(h.width,s,p.maximum);return{offsets:ye(h.width,s),curtainLeft:u,curtainRight:C}},[r,s,m,h]),y=d.useMemo(()=>{const p=[];for(const u of(t==null?void 0:t.actions)||[])u.class!=="Test"&&p.push({action:u,leftTime:u.startTime,rightTime:u.endTime||s.maximum,leftPosition:W(h.width,s,u.startTime),rightPosition:W(h.width,s,u.endTime||s.maximum),active:!1,error:!!u.error});for(const u of(t==null?void 0:t.resources)||[]){const S=u._monotonicTime,C=u._monotonicTime+u.time;p.push({resource:u,leftTime:S,rightTime:C,leftPosition:W(h.width,s,S),rightPosition:W(h.width,s,C),active:!1,error:!1})}for(const u of i||[])p.push({consoleMessage:u,leftTime:u.timestamp,rightTime:u.timestamp,leftPosition:W(h.width,s,u.timestamp),rightPosition:W(h.width,s,u.timestamp),active:!1,error:u.isError});return p},[t,i,s,h]);d.useMemo(()=>{for(const p of y)c?p.active=p.action===c:l?p.active=p.resource===l:a?p.active=p.consoleMessage===a:p.active=!1},[y,c,l,a]);const T=d.useCallback(p=>{if(w(void 0),!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=r?W(h.width,s,r.minimum):0,k=r?W(h.width,s,r.maximum):0;r&&Math.abs(u-C)<10?b({startX:k,endX:u,type:"resize"}):r&&Math.abs(u-k)<10?b({startX:C,endX:u,type:"resize"}):r&&S>r.minimum&&S<r.maximum&&p.clientY-v.current.getBoundingClientRect().top<20?b({startX:C,endX:k,pivot:u,type:"move"}):b({startX:u,endX:u,type:"resize"})},[s,h,v,r]),L=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(A=>A.startTime<=S);if(!p.buttons){b(void 0);return}if(C&&n(C),!m)return;let k=m;if(m.type==="resize")k={...m,endX:u};else{const A=u-m.pivot;let U=m.startX+A,$=m.endX+A;U<0&&(U=0,$=U+(m.endX-m.startX)),$>h.width&&($=h.width,U=$-(m.endX-m.startX)),k={...m,startX:U,endX:$,pivot:u}}b(k);const I=H(h.width,s,k.startX),P=H(h.width,s,k.endX);I!==P&&o({minimum:Math.min(I,P),maximum:Math.max(I,P)})},[s,m,h,t,n,v,o]),R=d.useCallback(()=>{if(w(void 0),!!m){if(m.startX!==m.endX){const p=H(h.width,s,m.startX),u=H(h.width,s,m.endX);o({minimum:Math.min(p,u),maximum:Math.max(p,u)})}else{const p=H(h.width,s,m.startX),u=t==null?void 0:t.actions.findLast(S=>S.startTime<=p);u&&n(u),o(void 0)}b(void 0)}},[s,m,h,t,o,n]),X=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(k=>k.startTime<=S);w({x:u,clientY:p.clientY,action:C,sdkLanguage:x})},[s,h,t,v,x]),z=d.useCallback(()=>{w(void 0)},[]),G=d.useCallback(()=>{o(void 0)},[o]);return e.jsxs("div",{style:{flex:"none",borderBottom:"1px solid var(--vscode-panel-border)"},children:[!!m&&e.jsx(qt,{cursor:(m==null?void 0:m.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:R,onPaneMouseMove:L,onPaneDoubleClick:G}),e.jsxs("div",{ref:v,className:"timeline-view",onMouseDown:T,onMouseMove:X,onMouseLeave:z,children:[e.jsx("div",{className:"timeline-grid",children:M.map((p,u)=>e.jsx("div",{className:"timeline-divider",style:{left:p.position+"px"},children:e.jsx("div",{className:"timeline-time",children:F(p.time-s.minimum)})},u))}),e.jsx("div",{style:{height:8}}),e.jsx(we,{model:t,boundaries:s,previewPoint:j}),e.jsx("div",{className:"timeline-bars",children:y.map((p,u)=>e.jsx("div",{className:K("timeline-bar",p.action&&"action",p.resource&&"network",p.consoleMessage&&"console-message",p.active&&"active",p.error&&"error"),style:{left:p.leftPosition,width:Math.max(5,p.rightPosition-p.leftPosition),top:Te(p),bottom:0}},u))}),e.jsx("div",{className:"timeline-marker",style:{display:j!==void 0?"block":"none",left:((j==null?void 0:j.x)||0)+"px"}}),r&&e.jsxs("div",{className:"timeline-window",children:[e.jsx("div",{className:"timeline-window-curtain left",style:{width:f}}),e.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),e.jsx("div",{className:"timeline-window-center",children:e.jsx("div",{className:"timeline-window-drag"})}),e.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),e.jsx("div",{className:"timeline-window-curtain right",style:{width:N}})]})]})]})};function ye(t,s){let n=t/64;const c=s.maximum-s.minimum,l=t/c;let a=c/n;const r=Math.ceil(Math.log(a)/Math.LN10);a=Math.pow(10,r),a*l>=5*64&&(a=a/5),a*l>=2*64&&(a=a/2);const o=s.minimum;let x=s.maximum;x+=64/l,n=Math.ceil((x-o)/a),a||(n=0);const h=[];for(let v=0;v<n;++v){const m=o+a*v;h.push({position:W(t,s,m),time:m})}return h}function W(t,s,i){return(i-s.minimum)/(s.maximum-s.minimum)*t}function H(t,s,i){return i/t*(s.maximum-s.minimum)+s.minimum}function Te(t){return t.resource?25:20}const Me=({model:t})=>{var s,i;return t?e.jsxs("div",{"data-testid":"metadata-view",className:"vbox",style:{flexShrink:0},children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!t.wallTime&&e.jsxs("div",{className:"call-line",children:["start time:",e.jsx("span",{className:"call-value datetime",title:new Date(t.wallTime).toLocaleString(),children:new Date(t.wallTime).toLocaleString()})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value number",title:F(t.endTime-t.startTime),children:F(t.endTime-t.startTime)})]}),e.jsx("div",{className:"call-section",children:"Browser"}),e.jsxs("div",{className:"call-line",children:["engine:",e.jsx("span",{className:"call-value string",title:t.browserName,children:t.browserName})]}),t.channel&&e.jsxs("div",{className:"call-line",children:["channel:",e.jsx("span",{className:"call-value string",title:t.channel,children:t.channel})]}),t.platform&&e.jsxs("div",{className:"call-line",children:["platform:",e.jsx("span",{className:"call-value string",title:t.platform,children:t.platform})]}),t.options.userAgent&&e.jsxs("div",{className:"call-line",children:["user agent:",e.jsx("span",{className:"call-value datetime",title:t.options.userAgent,children:t.options.userAgent})]}),t.options.baseURL&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),e.jsxs("div",{className:"call-line",children:["baseURL:",e.jsx("a",{className:"call-value string",href:t.options.baseURL,title:t.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:t.options.baseURL})]})]}),e.jsx("div",{className:"call-section",children:"Viewport"}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["width:",e.jsx("span",{className:"call-value number",title:String(!!((s=t.options.viewport)!=null&&s.width)),children:t.options.viewport.width})]}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["height:",e.jsx("span",{className:"call-value number",title:String(!!((i=t.options.viewport)!=null&&i.height)),children:t.options.viewport.height})]}),e.jsxs("div",{className:"call-line",children:["is mobile:",e.jsx("span",{className:"call-value boolean",title:String(!!t.options.isMobile),children:String(!!t.options.isMobile)})]}),t.options.deviceScaleFactor&&e.jsxs("div",{className:"call-line",children:["device scale:",e.jsx("span",{className:"call-value number",title:String(t.options.deviceScaleFactor),children:String(t.options.deviceScaleFactor)})]}),e.jsx("div",{className:"call-section",children:"Counts"}),e.jsxs("div",{className:"call-line",children:["pages:",e.jsx("span",{className:"call-value number",children:t.pages.length})]}),e.jsxs("div",{className:"call-line",children:["actions:",e.jsx("span",{className:"call-value number",children:t.actions.length})]}),e.jsxs("div",{className:"call-line",children:["events:",e.jsx("span",{className:"call-value number",children:t.events.length})]})]}):e.jsx(e.Fragment,{})};async function lt(t){const s=new Image;return t&&(s.src=t,await new Promise((i,n)=>{s.onload=i,s.onerror=i})),s}const ot={backgroundImage:`linear-gradient(45deg, #80808020 25%, transparent 25%),
|
|
2
2
|
linear-gradient(-45deg, #80808020 25%, transparent 25%),
|
|
3
3
|
linear-gradient(45deg, transparent 75%, #80808020 75%),
|
|
4
4
|
linear-gradient(-45deg, transparent 75%, #80808020 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px",boxShadow:`rgb(0 0 0 / 10%) 0px 1.8px 1.9px,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as u,r,b as y,t as E,j as o,a as k,c as x}from"./assets/inspectorTab-
|
|
1
|
+
import{M as u,r,b as y,t as E,j as o,a as k,c as x}from"./assets/inspectorTab-Soeeuvzv.js";import{W as M}from"./assets/workbench-lypYlf00.js";function S(t,e){t&&window.parent.postMessage({method:"openExternal",params:{url:t,target:e}},"*")}function j({file:t,line:e,column:a}){window.parent.postMessage({method:"openSourceLocation",params:{file:t,line:e,column:a}},"*")}const L=()=>{const[t,e]=r.useState([]),[a,g]=r.useState(h),[c,l]=r.useState({done:0,total:0}),[d,m]=r.useState(null);return r.useEffect(()=>{window.addEventListener("message",async({data:{method:s,params:n}})=>{s==="loadTraceRequested"?(e(n.traceUrl?[n.traceUrl]:[]),m(null)):s==="applyTheme"&&y()!==n.theme&&E()}),window.parent.postMessage({type:"loaded"},"*")},[]),r.useEffect(()=>{(async()=>{if(t.length){const s=i=>{i.data.method==="progress"&&l(i.data.params)};navigator.serviceWorker.addEventListener("message",s),l({done:0,total:1});const n=[];for(let i=0;i<t.length;i++){const v=t[i],p=new URLSearchParams;p.set("trace",v),p.set("limit",String(t.length));const w=await fetch(`contexts?${p.toString()}`);if(!w.ok){m((await w.json()).error);return}n.push(...await w.json())}navigator.serviceWorker.removeEventListener("message",s);const f=new u(n);l({done:0,total:0}),g(f)}else g(h)})()},[t]),r.useEffect(()=>{var s;d&&((s=window.parent)==null||s.postMessage({method:"showErrorMessage",params:{message:d}},"*"))},[d]),o.jsxs("div",{className:"vbox workbench-loader",children:[o.jsx("div",{className:"progress",children:o.jsx("div",{className:"inner-progress",style:{width:c.total?100*c.done/c.total+"%":0}})}),o.jsx(M,{model:a,openPage:S,onOpenExternally:j,showSettings:!0}),!t.length&&o.jsx("div",{className:"empty-state",children:o.jsx("div",{className:"title",children:"Select test to see the trace"})})]})},h=new u([]);(async()=>{k();const t=e=>{var a;e.isTrusted&&((a=window.parent)==null||a.postMessage({type:e.type,key:e.key,keyCode:e.keyCode,code:e.code,shiftKey:e.shiftKey,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,repeat:e.repeat},"*"))};if(window.addEventListener("keydown",t),window.addEventListener("keyup",t),window.location.protocol!=="file:"){if(!navigator.serviceWorker)throw new Error(`Service workers are not supported.
|
|
2
2
|
Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(e=>{navigator.serviceWorker.oncontrollerchange=()=>e()}),setInterval(function(){fetch("ping")},1e4)}x(document.querySelector("#root")).render(o.jsx(L,{}))})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as u,r,b as y,t as E,j as o,a as k,c as x}from"./assets/inspectorTab-
|
|
1
|
+
import{M as u,r,b as y,t as E,j as o,a as k,c as x}from"./assets/inspectorTab-BuJ3wAX_.js";import{W as M}from"./assets/workbench-DdmJ9AJV.js";function S(t,e){t&&window.parent.postMessage({method:"openExternal",params:{url:t,target:e}},"*")}function j({file:t,line:e,column:a}){window.parent.postMessage({method:"openSourceLocation",params:{file:t,line:e,column:a}},"*")}const L=()=>{const[t,e]=r.useState([]),[a,g]=r.useState(h),[c,l]=r.useState({done:0,total:0}),[d,m]=r.useState(null);return r.useEffect(()=>{window.addEventListener("message",async({data:{method:s,params:n}})=>{s==="loadTraceRequested"?(e(n.traceUrl?[n.traceUrl]:[]),m(null)):s==="applyTheme"&&y()!==n.theme&&E()}),window.parent.postMessage({type:"loaded"},"*")},[]),r.useEffect(()=>{(async()=>{if(t.length){const s=i=>{i.data.method==="progress"&&l(i.data.params)};navigator.serviceWorker.addEventListener("message",s),l({done:0,total:1});const n=[];for(let i=0;i<t.length;i++){const v=t[i],p=new URLSearchParams;p.set("trace",v),p.set("limit",String(t.length));const w=await fetch(`contexts?${p.toString()}`);if(!w.ok){m((await w.json()).error);return}n.push(...await w.json())}navigator.serviceWorker.removeEventListener("message",s);const f=new u(n);l({done:0,total:0}),g(f)}else g(h)})()},[t]),r.useEffect(()=>{var s;d&&((s=window.parent)==null||s.postMessage({method:"showErrorMessage",params:{message:d}},"*"))},[d]),o.jsxs("div",{className:"vbox workbench-loader",children:[o.jsx("div",{className:"progress",children:o.jsx("div",{className:"inner-progress",style:{width:c.total?100*c.done/c.total+"%":0}})}),o.jsx(M,{model:a,openPage:S,onOpenExternally:j,showSettings:!0}),!t.length&&o.jsx("div",{className:"empty-state",children:o.jsx("div",{className:"title",children:"Select test to see the trace"})})]})},h=new u([]);(async()=>{k();const t=e=>{var a;e.isTrusted&&((a=window.parent)==null||a.postMessage({type:e.type,key:e.key,keyCode:e.keyCode,code:e.code,shiftKey:e.shiftKey,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,repeat:e.repeat},"*"))};if(window.addEventListener("keydown",t),window.addEventListener("keyup",t),window.location.protocol!=="file:"){if(!navigator.serviceWorker)throw new Error(`Service workers are not supported.
|
|
2
2
|
Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(e=>{navigator.serviceWorker.oncontrollerchange=()=>e()}),setInterval(function(){fetch("ping")},1e4)}x(document.querySelector("#root")).render(o.jsx(L,{}))})();
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<meta charset="UTF-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Playwright Trace Viewer for VS Code</title>
|
|
8
|
-
<script type="module" crossorigin src="./embedded.
|
|
9
|
-
<link rel="modulepreload" crossorigin href="./assets/inspectorTab-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/workbench-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="./inspectorTab.
|
|
12
|
-
<link rel="stylesheet" crossorigin href="./workbench.
|
|
13
|
-
<link rel="stylesheet" crossorigin href="./embedded.
|
|
8
|
+
<script type="module" crossorigin src="./embedded.BkvOrz5Z.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="./assets/inspectorTab-Soeeuvzv.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/workbench-lypYlf00.js">
|
|
11
|
+
<link rel="stylesheet" crossorigin href="./inspectorTab.DLjBDrQR.css">
|
|
12
|
+
<link rel="stylesheet" crossorigin href="./workbench.DlsCx8k5.css">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="./embedded.w7WN2u1R.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as k,r as o,j as e,T as W,t as D,a as M,c as C}from"./assets/inspectorTab-
|
|
1
|
+
import{M as k,r as o,j as e,T as W,t as D,a as M,c as C}from"./assets/inspectorTab-BuJ3wAX_.js";import{W as F}from"./assets/workbench-DdmJ9AJV.js";import{T as O,W as A}from"./assets/testServerConnection-DeE2kSzz.js";const I=()=>{const[i,N]=o.useState(!1),[c,p]=o.useState([]),[u,E]=o.useState([]),[f,S]=o.useState(L),[v,m]=o.useState({done:0,total:0}),[T,g]=o.useState(!1),[y,w]=o.useState(null),[x,U]=o.useState(null),h=o.useCallback(t=>{const r=[],a=[],s=new URL(window.location.href);for(let n=0;n<t.length;n++){const l=t.item(n);if(!l)continue;const b=URL.createObjectURL(l);r.push(b),a.push(l.name),s.searchParams.append("trace",b),s.searchParams.append("traceFileName",l.name)}const d=s.toString();window.history.pushState({},"",d),p(r),E(a),g(!1),w(null)},[]);o.useEffect(()=>{const t=async r=>{var a;if((a=r.clipboardData)!=null&&a.files.length){for(const s of r.clipboardData.files)if(s.type!=="application/zip")return;r.preventDefault(),h(r.clipboardData.files)}};return document.addEventListener("paste",t),()=>document.removeEventListener("paste",t)});const P=o.useCallback(t=>{t.preventDefault(),h(t.dataTransfer.files)},[h]),R=o.useCallback(t=>{t.preventDefault(),t.target.files&&h(t.target.files)},[h]);o.useEffect(()=>{const t=new URL(window.location.href).searchParams,r=t.getAll("trace");N(t.has("isServer"));for(const a of r)if(a.startsWith("file:")){U(a||null);return}if(t.has("isServer")){const a=new URLSearchParams(window.location.search).get("ws"),s=new URL(`../${a}`,window.location.toString());s.protocol=window.location.protocol==="https:"?"wss:":"ws:";const d=new O(new A(s));d.onLoadTraceRequested(async n=>{p(n.traceUrl?[n.traceUrl]:[]),g(!1),w(null)}),d.initialize({}).catch(()=>{})}else r.some(a=>a.startsWith("blob:"))||p(r)},[]),o.useEffect(()=>{(async()=>{if(c.length){const t=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",t),m({done:0,total:1});const r=[];for(let s=0;s<c.length;s++){const d=c[s],n=new URLSearchParams;n.set("trace",d),u.length&&n.set("traceFileName",u[s]),n.set("limit",String(c.length));const l=await fetch(`contexts?${n.toString()}`);if(!l.ok){i||p([]),w((await l.json()).error);return}r.push(...await l.json())}navigator.serviceWorker.removeEventListener("message",t);const a=new k(r);m({done:0,total:0}),S(a)}else S(L)})()},[i,c,u]);const j=!!(!i&&!T&&!x&&(!c.length||y));return e.jsxs("div",{className:"vbox workbench-loader",onDragOver:t=>{t.preventDefault(),g(!0)},children:[e.jsxs("div",{className:"hbox header",...j?{inert:"true"}:{},children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),f.title&&e.jsx("div",{className:"title",children:f.title}),e.jsx("div",{className:"spacer"}),e.jsx(W,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>D()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(F,{model:f,inert:j,showSettings:!0}),x&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:x,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),j&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",role:"alert",children:y}),e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const t=document.createElement("input");t.type="file",t.multiple=!0,t.click(),t.addEventListener("change",r=>R(r))},type:"button",children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),i&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{g(!1)},onDrop:t=>P(t),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},L=new k([]);(async()=>{if(M(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(i=>setTimeout(i,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
|
|
2
2
|
Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(i=>{navigator.serviceWorker.oncontrollerchange=()=>i()}),setInterval(function(){fetch("ping")},1e4)}C(document.querySelector("#root")).render(e.jsx(I,{}))})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as k,r as o,j as e,T as W,t as D,a as M,c as C}from"./assets/inspectorTab-
|
|
1
|
+
import{M as k,r as o,j as e,T as W,t as D,a as M,c as C}from"./assets/inspectorTab-Soeeuvzv.js";import{W as F}from"./assets/workbench-lypYlf00.js";import{T as O,W as A}from"./assets/testServerConnection-DeE2kSzz.js";const I=()=>{const[i,N]=o.useState(!1),[c,p]=o.useState([]),[u,E]=o.useState([]),[f,S]=o.useState(L),[v,m]=o.useState({done:0,total:0}),[T,g]=o.useState(!1),[y,w]=o.useState(null),[x,U]=o.useState(null),h=o.useCallback(t=>{const r=[],a=[],s=new URL(window.location.href);for(let n=0;n<t.length;n++){const l=t.item(n);if(!l)continue;const b=URL.createObjectURL(l);r.push(b),a.push(l.name),s.searchParams.append("trace",b),s.searchParams.append("traceFileName",l.name)}const d=s.toString();window.history.pushState({},"",d),p(r),E(a),g(!1),w(null)},[]);o.useEffect(()=>{const t=async r=>{var a;if((a=r.clipboardData)!=null&&a.files.length){for(const s of r.clipboardData.files)if(s.type!=="application/zip")return;r.preventDefault(),h(r.clipboardData.files)}};return document.addEventListener("paste",t),()=>document.removeEventListener("paste",t)});const P=o.useCallback(t=>{t.preventDefault(),h(t.dataTransfer.files)},[h]),R=o.useCallback(t=>{t.preventDefault(),t.target.files&&h(t.target.files)},[h]);o.useEffect(()=>{const t=new URL(window.location.href).searchParams,r=t.getAll("trace");N(t.has("isServer"));for(const a of r)if(a.startsWith("file:")){U(a||null);return}if(t.has("isServer")){const a=new URLSearchParams(window.location.search).get("ws"),s=new URL(`../${a}`,window.location.toString());s.protocol=window.location.protocol==="https:"?"wss:":"ws:";const d=new O(new A(s));d.onLoadTraceRequested(async n=>{p(n.traceUrl?[n.traceUrl]:[]),g(!1),w(null)}),d.initialize({}).catch(()=>{})}else r.some(a=>a.startsWith("blob:"))||p(r)},[]),o.useEffect(()=>{(async()=>{if(c.length){const t=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",t),m({done:0,total:1});const r=[];for(let s=0;s<c.length;s++){const d=c[s],n=new URLSearchParams;n.set("trace",d),u.length&&n.set("traceFileName",u[s]),n.set("limit",String(c.length));const l=await fetch(`contexts?${n.toString()}`);if(!l.ok){i||p([]),w((await l.json()).error);return}r.push(...await l.json())}navigator.serviceWorker.removeEventListener("message",t);const a=new k(r);m({done:0,total:0}),S(a)}else S(L)})()},[i,c,u]);const j=!!(!i&&!T&&!x&&(!c.length||y));return e.jsxs("div",{className:"vbox workbench-loader",onDragOver:t=>{t.preventDefault(),g(!0)},children:[e.jsxs("div",{className:"hbox header",...j?{inert:"true"}:{},children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),f.title&&e.jsx("div",{className:"title",children:f.title}),e.jsx("div",{className:"spacer"}),e.jsx(W,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>D()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(F,{model:f,inert:j,showSettings:!0}),x&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:x,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),j&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",role:"alert",children:y}),e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const t=document.createElement("input");t.type="file",t.multiple=!0,t.click(),t.addEventListener("change",r=>R(r))},type:"button",children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),i&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{g(!1)},onDrop:t=>P(t),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},L=new k([]);(async()=>{if(M(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(i=>setTimeout(i,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
|
|
2
2
|
Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(i=>{navigator.serviceWorker.oncontrollerchange=()=>i()}),setInterval(function(){fetch("ping")},1e4)}C(document.querySelector("#root")).render(e.jsx(I,{}))})();
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
<link rel="icon" href="./playwright-logo.svg" type="image/svg+xml">
|
|
8
8
|
<link rel="manifest" href="./manifest.webmanifest">
|
|
9
9
|
<title>Playwright Trace Viewer</title>
|
|
10
|
-
<script type="module" crossorigin src="./index.
|
|
11
|
-
<link rel="modulepreload" crossorigin href="./assets/inspectorTab-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="./assets/workbench-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="./assets/testServerConnection-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="./inspectorTab.
|
|
15
|
-
<link rel="stylesheet" crossorigin href="./workbench.
|
|
16
|
-
<link rel="stylesheet" crossorigin href="./index.
|
|
10
|
+
<script type="module" crossorigin src="./index._Iolt-uE.js"></script>
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/inspectorTab-Soeeuvzv.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="./assets/workbench-lypYlf00.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="./assets/testServerConnection-DeE2kSzz.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="./inspectorTab.DLjBDrQR.css">
|
|
15
|
+
<link rel="stylesheet" crossorigin href="./workbench.DlsCx8k5.css">
|
|
16
|
+
<link rel="stylesheet" crossorigin href="./index.CrbWWHbf.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="root"></div>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var H=Object.defineProperty;var W=(t,e,s)=>e in t?H(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var w=(t,e,s)=>W(t,typeof e!="symbol"?e+"":e,s);import{j as n,r as a,M as B,F as U,n as $,L as z,g as D,T as f,H as J,J as K,t as q,S as C,D as y,y as G,z as Q,h as X,A as Y,N as Z,K as ee,O as te,Q as se,I as oe,E as re,a as ne,c as ce}from"./assets/inspectorTab-
|
|
1
|
+
var H=Object.defineProperty;var W=(t,e,s)=>e in t?H(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var w=(t,e,s)=>W(t,typeof e!="symbol"?e+"":e,s);import{j as n,r as a,M as B,F as U,n as $,L as z,g as D,T as f,H as J,J as K,t as q,S as C,D as y,y as G,z as Q,h as X,A as Y,N as Z,K as ee,O as te,Q as se,I as oe,E as re,a as ne,c as ce}from"./assets/inspectorTab-BuJ3wAX_.js";const ae=({sources:t,fileId:e,setFileId:s})=>n.jsx("select",{className:"source-chooser",hidden:!t.length,title:"Source chooser",value:e,onChange:o=>{s(o.target.selectedOptions[0].value)},children:ie(t)});function ie(t){const e=r=>r.replace(/.*[/\\]([^/\\]+)/,"$1"),s=r=>n.jsx("option",{value:r.id,children:e(r.label)},r.id),o=new Map;for(const r of t){let i=o.get(r.group||"Debugger");i||(i=[],o.set(r.group||"Debugger",i)),i.push(r)}return[...o.entries()].map(([r,i])=>n.jsx("optgroup",{label:r,children:i.filter(c=>(c.group||"Debugger")===r).map(c=>s(c))},r))}const b=a.createContext(void 0),le=({trace:t,children:e})=>{const[s,o]=a.useState(),[r,i]=a.useState(0),c=a.useRef(null);return a.useEffect(()=>(c.current&&clearTimeout(c.current),c.current=setTimeout(async()=>{try{const u=await ue(t);u.sha1!==(s==null?void 0:s.sha1)&&o(u)}catch{o(void 0)}finally{i(r+1)}},500),()=>{c.current&&clearTimeout(c.current)}),[r,s,t]),n.jsx(b.Provider,{value:s==null?void 0:s.model,children:e})};async function ue(t){const e=new URLSearchParams;e.set("trace",t),e.set("limit","1");const o=await(await fetch(`contexts?${e.toString()}`)).json(),r=[];for(const i of o)i.actions.forEach(c=>r.push(c.type+"@"+c.startTime+"-"+c.endTime)),i.events.forEach(c=>r.push(c.type+"@"+c.time));return{model:new B(o),sha1:await U(r.join("|"))}}function de(t,e){return[...t,e].join(" >> internal:control=enter-frame >> ")}function me(t){const{action:e}=t;switch(e.name){case"navigate":return{method:"goto",params:{url:e.url}};case"openPage":case"closePage":throw new Error("Not reached")}const s=de(t.frame.framePath,e.selector);switch(e.name){case"click":return{method:"click",params:{selector:s,strict:!0,modifiers:P(e.modifiers),button:e.button,clickCount:e.clickCount,position:e.position}};case"press":return{method:"press",params:{selector:s,strict:!0,key:[...P(e.modifiers),e.key].join("+")}};case"fill":return{method:"fill",params:{selector:s,strict:!0,value:e.text}};case"setInputFiles":return{method:"setInputFiles",params:{selector:s,strict:!0,localPaths:e.files}};case"check":return{method:"check",params:{selector:s,strict:!0}};case"uncheck":return{method:"uncheck",params:{selector:s,strict:!0}};case"select":return{method:"selectOption",params:{selector:s,strict:!0,options:e.options.map(r=>({value:r}))}};case"assertChecked":return{method:"expect",params:{selector:e.selector,expression:"to.be.checked",isNot:!e.checked}};case"assertText":return{method:"expect",params:{selector:s,expression:"to.have.text",expectedText:[],isNot:!1}};case"assertValue":return{method:"expect",params:{selector:s,expression:"to.have.value",expectedValue:void 0,isNot:!1}};case"assertVisible":return{method:"expect",params:{selector:s,expression:"to.be.visible",isNot:!1}}}}function P(t){const e=[];return t&1&&e.push("Alt"),t&2&&e.push("ControlOrMeta"),t&4&&e.push("ControlOrMeta"),t&8&&e.push("Shift"),e}const he=z,pe=({sdkLanguage:t,actions:e,selectedAction:s,onSelectedAction:o})=>{const r=a.useCallback(i=>xe(t,i),[t]);return n.jsx("div",{className:"vbox",children:n.jsx(he,{name:"actions",items:e,selectedItem:s,onSelected:o,render:r})})},xe=(t,e)=>{const{method:s,params:o}=me(e),r=o.selector?$(t||"javascript",o.selector):void 0,i=`page.${s}`;return n.jsx(n.Fragment,{children:n.jsxs("div",{className:"action-title",title:i,children:[n.jsx("span",{children:i}),r&&n.jsx("div",{className:"action-selector",title:r,children:r}),s==="goto"&&o.url&&n.jsx("div",{className:"action-url",title:o.url,children:o.url})]})})},L=a.createContext(void 0),ge=({guid:t,children:e})=>{const[s,o]=a.useState(void 0),[r,i]=a.useState("none"),[c,u]=a.useState({actions:[],sources:[]}),h=a.useRef({setMode:i,setActions:u});a.useEffect(()=>{const d=new URL(`../${t}`,window.location.toString());d.protocol=window.location.protocol==="https:"?"wss:":"ws:";const x=new WebSocket(d.toString());return o(new fe(x,h.current)),()=>{x.close()}},[t]);const p=a.useMemo(()=>s?{mode:r,actions:c.actions,sources:c.sources,connection:s}:void 0,[c,r,s]);return n.jsx(L.Provider,{value:p,children:e})};class fe{constructor(e,s){w(this,"_lastId",0);w(this,"_webSocket");w(this,"_callbacks",new Map);w(this,"_options");this._webSocket=e,this._callbacks=new Map,this._options=s,this._webSocket.addEventListener("message",o=>{const r=JSON.parse(o.data),{id:i,result:c,error:u,method:h,params:p}=r;if(i){const d=this._callbacks.get(i);if(!d)return;this._callbacks.delete(i),u?d.reject(new Error(u)):d.resolve(c)}else this._dispatchEvent(h,p)})}setMode(e){this._sendMessageNoReply("setMode",{mode:e})}async _sendMessage(e,s){const o=++this._lastId,r={id:o,method:e,params:s};return this._webSocket.send(JSON.stringify(r)),new Promise((i,c)=>{this._callbacks.set(o,{resolve:i,reject:c})})}_sendMessageNoReply(e,s){this._sendMessage(e,s).catch(()=>{})}_dispatchEvent(e,s){if(e==="setMode"){const{mode:o}=s;this._options.setMode(o)}if(e==="setActions"){const{actions:o,sources:r}=s;this._options.setActions({actions:o.filter(i=>i.action.name!=="openPage"&&i.action.name!=="closePage"),sources:r}),window.playwrightSourcesEchoForTest=r}}}const we=()=>{const t=new URLSearchParams(window.location.search),e=t.get("ws"),s=t.get("trace")+".json";return n.jsx(ge,{guid:e,children:n.jsx(le,{trace:s,children:n.jsx(be,{})})})},be=()=>{const t=a.useContext(L),e=a.useContext(b),[s,o]=a.useState(),[r,i]=a.useState(void 0),[c,u]=a.useState(!1),[h,p]=a.useState(""),[d,x]=a.useState(""),[v,S]=a.useState(),T=a.useCallback(l=>{i(l==null?void 0:l.startTime)},[]),g=a.useMemo(()=>t==null?void 0:t.actions.find(l=>l.startTime===r),[t==null?void 0:t.actions,r]);a.useEffect(()=>{var k;const l=(k=e==null?void 0:e.actions.find(M=>M.endTime&&M.endTime===(g==null?void 0:g.endTime)))==null?void 0:k.callId;l&&S(l)},[e,g]);const m=a.useMemo(()=>(t==null?void 0:t.sources.find(l=>l.id===s))||(t==null?void 0:t.sources[0]),[t==null?void 0:t.sources,s]),I=a.useMemo(()=>m?{file:"",line:0,column:0,source:{errors:[],content:m.text}}:void 0,[m]),j=(m==null?void 0:m.language)||"javascript",{boundaries:N}=a.useMemo(()=>{const l={minimum:(e==null?void 0:e.startTime)||0,maximum:(e==null?void 0:e.endTime)||3e4};return l.minimum>l.maximum&&(l.minimum=0,l.maximum=3e4),l.maximum+=(l.maximum-l.minimum)/20,{boundaries:l}},[e]),_=a.useCallback(l=>{p(l),x(""),u(!1)},[]),A=a.useCallback(l=>{x(l),p(l)},[]),E={id:"actions",title:"Actions",component:n.jsx(pe,{sdkLanguage:j,actions:(t==null?void 0:t.actions)||[],selectedAction:g,onSelectedAction:T})},R=n.jsxs(D,{sidebarBackground:!0,children:[n.jsx("div",{style:{width:4}}),n.jsx(f,{icon:"inspect",title:"Pick locator",toggled:c,onClick:()=>{u(!c)}}),n.jsx(f,{icon:"eye",title:"Assert visibility",onClick:()=>{}}),n.jsx(f,{icon:"whole-word",title:"Assert text",onClick:()=>{}}),n.jsx(f,{icon:"symbol-constant",title:"Assert value",onClick:()=>{}}),n.jsx(J,{}),n.jsx(f,{icon:"files",title:"Copy",disabled:!m||!m.text,onClick:()=>{m!=null&&m.text&&K(m.text)}}),n.jsx("div",{style:{flex:"auto"}}),n.jsx("div",{children:"Target:"}),n.jsx(ae,{fileId:s,sources:(t==null?void 0:t.sources)||[],setFileId:l=>{o(l)}}),n.jsx(f,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>q()})]}),F=n.jsx(y,{tabs:[E]}),V=n.jsx(Se,{sdkLanguage:j,callId:v,isInspecting:c,setIsInspecting:u,highlightedLocator:d,setHighlightedLocator:_}),O=n.jsx(ve,{sdkLanguage:j,boundaries:N,setIsInspecting:u,highlightedLocator:h,setHighlightedLocator:A,sourceLocation:I});return n.jsx("div",{className:"vbox workbench",children:n.jsx(C,{sidebarSize:250,orientation:"horizontal",settingName:"recorderActionListSidebar",sidebarIsFirst:!0,main:n.jsx(C,{sidebarSize:250,orientation:"vertical",settingName:"recorderPropertiesSidebar",main:n.jsxs("div",{className:"vbox",children:[R,V]}),sidebar:O}),sidebar:F})})},ve=({sdkLanguage:t,boundaries:e,setIsInspecting:s,highlightedLocator:o,setHighlightedLocator:r,sourceLocation:i})=>{const c=a.useContext(b),u=G(c,e),h=Q(c,e),p=a.useRef(new Map),[d,x]=X("recorderPropertiesTab","source"),v={id:"inspector",title:"Locator",render:()=>n.jsx(oe,{showScreenshot:!1,sdkLanguage:t,setIsInspecting:s,highlightedLocator:o,setHighlightedLocator:r})},S={id:"source",title:"Source",render:()=>n.jsx(re,{sources:p.current,stackFrameLocation:"right",fallbackLocation:i})},T={id:"console",title:"Console",count:u.entries.length,render:()=>n.jsx(Y,{boundaries:e,consoleModel:u})},g={id:"network",title:"Network",count:h.resources.length,render:()=>n.jsx(Z,{boundaries:e,networkModel:h})},m=[S,v,T,g];return n.jsx(y,{tabs:m,selectedTab:d,setSelectedTab:x})},Se=({sdkLanguage:t,callId:e,isInspecting:s,setIsInspecting:o,highlightedLocator:r,setHighlightedLocator:i})=>{const c=a.useContext(b),u=a.useMemo(()=>c==null?void 0:c.actions.find(d=>d.callId===e),[c,e]),h=a.useMemo(()=>{const d=ee(u);return d.action||d.after||d.before},[u]),p=a.useMemo(()=>h?te(h):void 0,[h]);return n.jsx(se,{sdkLanguage:t,testIdAttributeName:"data-testid",isInspecting:s,setIsInspecting:o,highlightedLocator:r,setHighlightedLocator:i,snapshotUrls:p})};(async()=>{if(ne(),window.location.protocol!=="file:"){if(!navigator.serviceWorker)throw new Error(`Service workers are not supported.
|
|
2
2
|
Make sure to serve the Recorder (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(t=>{navigator.serviceWorker.oncontrollerchange=()=>t()}),setInterval(function(){fetch("ping")},1e4)}ce(document.querySelector("#root")).render(n.jsx(we,{}))})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var H=Object.defineProperty;var W=(t,e,s)=>e in t?H(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var w=(t,e,s)=>W(t,typeof e!="symbol"?e+"":e,s);import{j as n,r as a,M as B,F as U,n as $,L as z,g as D,T as f,H as J,J as K,t as q,S as C,D as y,y as G,z as Q,h as X,A as Y,N as Z,K as ee,O as te,Q as se,I as oe,E as re,a as ne,c as ce}from"./assets/inspectorTab-
|
|
1
|
+
var H=Object.defineProperty;var W=(t,e,s)=>e in t?H(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var w=(t,e,s)=>W(t,typeof e!="symbol"?e+"":e,s);import{j as n,r as a,M as B,F as U,n as $,L as z,g as D,T as f,H as J,J as K,t as q,S as C,D as y,y as G,z as Q,h as X,A as Y,N as Z,K as ee,O as te,Q as se,I as oe,E as re,a as ne,c as ce}from"./assets/inspectorTab-Soeeuvzv.js";const ae=({sources:t,fileId:e,setFileId:s})=>n.jsx("select",{className:"source-chooser",hidden:!t.length,title:"Source chooser",value:e,onChange:o=>{s(o.target.selectedOptions[0].value)},children:ie(t)});function ie(t){const e=r=>r.replace(/.*[/\\]([^/\\]+)/,"$1"),s=r=>n.jsx("option",{value:r.id,children:e(r.label)},r.id),o=new Map;for(const r of t){let i=o.get(r.group||"Debugger");i||(i=[],o.set(r.group||"Debugger",i)),i.push(r)}return[...o.entries()].map(([r,i])=>n.jsx("optgroup",{label:r,children:i.filter(c=>(c.group||"Debugger")===r).map(c=>s(c))},r))}const b=a.createContext(void 0),le=({trace:t,children:e})=>{const[s,o]=a.useState(),[r,i]=a.useState(0),c=a.useRef(null);return a.useEffect(()=>(c.current&&clearTimeout(c.current),c.current=setTimeout(async()=>{try{const u=await ue(t);u.sha1!==(s==null?void 0:s.sha1)&&o(u)}catch{o(void 0)}finally{i(r+1)}},500),()=>{c.current&&clearTimeout(c.current)}),[r,s,t]),n.jsx(b.Provider,{value:s==null?void 0:s.model,children:e})};async function ue(t){const e=new URLSearchParams;e.set("trace",t),e.set("limit","1");const o=await(await fetch(`contexts?${e.toString()}`)).json(),r=[];for(const i of o)i.actions.forEach(c=>r.push(c.type+"@"+c.startTime+"-"+c.endTime)),i.events.forEach(c=>r.push(c.type+"@"+c.time));return{model:new B(o),sha1:await U(r.join("|"))}}function de(t,e){return[...t,e].join(" >> internal:control=enter-frame >> ")}function me(t){const{action:e}=t;switch(e.name){case"navigate":return{method:"goto",params:{url:e.url}};case"openPage":case"closePage":throw new Error("Not reached")}const s=de(t.frame.framePath,e.selector);switch(e.name){case"click":return{method:"click",params:{selector:s,strict:!0,modifiers:P(e.modifiers),button:e.button,clickCount:e.clickCount,position:e.position}};case"press":return{method:"press",params:{selector:s,strict:!0,key:[...P(e.modifiers),e.key].join("+")}};case"fill":return{method:"fill",params:{selector:s,strict:!0,value:e.text}};case"setInputFiles":return{method:"setInputFiles",params:{selector:s,strict:!0,localPaths:e.files}};case"check":return{method:"check",params:{selector:s,strict:!0}};case"uncheck":return{method:"uncheck",params:{selector:s,strict:!0}};case"select":return{method:"selectOption",params:{selector:s,strict:!0,options:e.options.map(r=>({value:r}))}};case"assertChecked":return{method:"expect",params:{selector:e.selector,expression:"to.be.checked",isNot:!e.checked}};case"assertText":return{method:"expect",params:{selector:s,expression:"to.have.text",expectedText:[],isNot:!1}};case"assertValue":return{method:"expect",params:{selector:s,expression:"to.have.value",expectedValue:void 0,isNot:!1}};case"assertVisible":return{method:"expect",params:{selector:s,expression:"to.be.visible",isNot:!1}}}}function P(t){const e=[];return t&1&&e.push("Alt"),t&2&&e.push("ControlOrMeta"),t&4&&e.push("ControlOrMeta"),t&8&&e.push("Shift"),e}const he=z,pe=({sdkLanguage:t,actions:e,selectedAction:s,onSelectedAction:o})=>{const r=a.useCallback(i=>xe(t,i),[t]);return n.jsx("div",{className:"vbox",children:n.jsx(he,{name:"actions",items:e,selectedItem:s,onSelected:o,render:r})})},xe=(t,e)=>{const{method:s,params:o}=me(e),r=o.selector?$(t||"javascript",o.selector):void 0,i=`page.${s}`;return n.jsx(n.Fragment,{children:n.jsxs("div",{className:"action-title",title:i,children:[n.jsx("span",{children:i}),r&&n.jsx("div",{className:"action-selector",title:r,children:r}),s==="goto"&&o.url&&n.jsx("div",{className:"action-url",title:o.url,children:o.url})]})})},L=a.createContext(void 0),ge=({guid:t,children:e})=>{const[s,o]=a.useState(void 0),[r,i]=a.useState("none"),[c,u]=a.useState({actions:[],sources:[]}),h=a.useRef({setMode:i,setActions:u});a.useEffect(()=>{const d=new URL(`../${t}`,window.location.toString());d.protocol=window.location.protocol==="https:"?"wss:":"ws:";const x=new WebSocket(d.toString());return o(new fe(x,h.current)),()=>{x.close()}},[t]);const p=a.useMemo(()=>s?{mode:r,actions:c.actions,sources:c.sources,connection:s}:void 0,[c,r,s]);return n.jsx(L.Provider,{value:p,children:e})};class fe{constructor(e,s){w(this,"_lastId",0);w(this,"_webSocket");w(this,"_callbacks",new Map);w(this,"_options");this._webSocket=e,this._callbacks=new Map,this._options=s,this._webSocket.addEventListener("message",o=>{const r=JSON.parse(o.data),{id:i,result:c,error:u,method:h,params:p}=r;if(i){const d=this._callbacks.get(i);if(!d)return;this._callbacks.delete(i),u?d.reject(new Error(u)):d.resolve(c)}else this._dispatchEvent(h,p)})}setMode(e){this._sendMessageNoReply("setMode",{mode:e})}async _sendMessage(e,s){const o=++this._lastId,r={id:o,method:e,params:s};return this._webSocket.send(JSON.stringify(r)),new Promise((i,c)=>{this._callbacks.set(o,{resolve:i,reject:c})})}_sendMessageNoReply(e,s){this._sendMessage(e,s).catch(()=>{})}_dispatchEvent(e,s){if(e==="setMode"){const{mode:o}=s;this._options.setMode(o)}if(e==="setActions"){const{actions:o,sources:r}=s;this._options.setActions({actions:o.filter(i=>i.action.name!=="openPage"&&i.action.name!=="closePage"),sources:r}),window.playwrightSourcesEchoForTest=r}}}const we=()=>{const t=new URLSearchParams(window.location.search),e=t.get("ws"),s=t.get("trace")+".json";return n.jsx(ge,{guid:e,children:n.jsx(le,{trace:s,children:n.jsx(be,{})})})},be=()=>{const t=a.useContext(L),e=a.useContext(b),[s,o]=a.useState(),[r,i]=a.useState(void 0),[c,u]=a.useState(!1),[h,p]=a.useState(""),[d,x]=a.useState(""),[v,S]=a.useState(),T=a.useCallback(l=>{i(l==null?void 0:l.startTime)},[]),g=a.useMemo(()=>t==null?void 0:t.actions.find(l=>l.startTime===r),[t==null?void 0:t.actions,r]);a.useEffect(()=>{var k;const l=(k=e==null?void 0:e.actions.find(M=>M.endTime&&M.endTime===(g==null?void 0:g.endTime)))==null?void 0:k.callId;l&&S(l)},[e,g]);const m=a.useMemo(()=>(t==null?void 0:t.sources.find(l=>l.id===s))||(t==null?void 0:t.sources[0]),[t==null?void 0:t.sources,s]),I=a.useMemo(()=>m?{file:"",line:0,column:0,source:{errors:[],content:m.text}}:void 0,[m]),j=(m==null?void 0:m.language)||"javascript",{boundaries:N}=a.useMemo(()=>{const l={minimum:(e==null?void 0:e.startTime)||0,maximum:(e==null?void 0:e.endTime)||3e4};return l.minimum>l.maximum&&(l.minimum=0,l.maximum=3e4),l.maximum+=(l.maximum-l.minimum)/20,{boundaries:l}},[e]),_=a.useCallback(l=>{p(l),x(""),u(!1)},[]),A=a.useCallback(l=>{x(l),p(l)},[]),E={id:"actions",title:"Actions",component:n.jsx(pe,{sdkLanguage:j,actions:(t==null?void 0:t.actions)||[],selectedAction:g,onSelectedAction:T})},R=n.jsxs(D,{sidebarBackground:!0,children:[n.jsx("div",{style:{width:4}}),n.jsx(f,{icon:"inspect",title:"Pick locator",toggled:c,onClick:()=>{u(!c)}}),n.jsx(f,{icon:"eye",title:"Assert visibility",onClick:()=>{}}),n.jsx(f,{icon:"whole-word",title:"Assert text",onClick:()=>{}}),n.jsx(f,{icon:"symbol-constant",title:"Assert value",onClick:()=>{}}),n.jsx(J,{}),n.jsx(f,{icon:"files",title:"Copy",disabled:!m||!m.text,onClick:()=>{m!=null&&m.text&&K(m.text)}}),n.jsx("div",{style:{flex:"auto"}}),n.jsx("div",{children:"Target:"}),n.jsx(ae,{fileId:s,sources:(t==null?void 0:t.sources)||[],setFileId:l=>{o(l)}}),n.jsx(f,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>q()})]}),F=n.jsx(y,{tabs:[E]}),V=n.jsx(Se,{sdkLanguage:j,callId:v,isInspecting:c,setIsInspecting:u,highlightedLocator:d,setHighlightedLocator:_}),O=n.jsx(ve,{sdkLanguage:j,boundaries:N,setIsInspecting:u,highlightedLocator:h,setHighlightedLocator:A,sourceLocation:I});return n.jsx("div",{className:"vbox workbench",children:n.jsx(C,{sidebarSize:250,orientation:"horizontal",settingName:"recorderActionListSidebar",sidebarIsFirst:!0,main:n.jsx(C,{sidebarSize:250,orientation:"vertical",settingName:"recorderPropertiesSidebar",main:n.jsxs("div",{className:"vbox",children:[R,V]}),sidebar:O}),sidebar:F})})},ve=({sdkLanguage:t,boundaries:e,setIsInspecting:s,highlightedLocator:o,setHighlightedLocator:r,sourceLocation:i})=>{const c=a.useContext(b),u=G(c,e),h=Q(c,e),p=a.useRef(new Map),[d,x]=X("recorderPropertiesTab","source"),v={id:"inspector",title:"Locator",render:()=>n.jsx(oe,{showScreenshot:!1,sdkLanguage:t,setIsInspecting:s,highlightedLocator:o,setHighlightedLocator:r})},S={id:"source",title:"Source",render:()=>n.jsx(re,{sources:p.current,stackFrameLocation:"right",fallbackLocation:i})},T={id:"console",title:"Console",count:u.entries.length,render:()=>n.jsx(Y,{boundaries:e,consoleModel:u})},g={id:"network",title:"Network",count:h.resources.length,render:()=>n.jsx(Z,{boundaries:e,networkModel:h})},m=[S,v,T,g];return n.jsx(y,{tabs:m,selectedTab:d,setSelectedTab:x})},Se=({sdkLanguage:t,callId:e,isInspecting:s,setIsInspecting:o,highlightedLocator:r,setHighlightedLocator:i})=>{const c=a.useContext(b),u=a.useMemo(()=>c==null?void 0:c.actions.find(d=>d.callId===e),[c,e]),h=a.useMemo(()=>{const d=ee(u);return d.action||d.after||d.before},[u]),p=a.useMemo(()=>h?te(h):void 0,[h]);return n.jsx(se,{sdkLanguage:t,testIdAttributeName:"data-testid",isInspecting:s,setIsInspecting:o,highlightedLocator:r,setHighlightedLocator:i,snapshotUrls:p})};(async()=>{if(ne(),window.location.protocol!=="file:"){if(!navigator.serviceWorker)throw new Error(`Service workers are not supported.
|
|
2
2
|
Make sure to serve the Recorder (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(t=>{navigator.serviceWorker.oncontrollerchange=()=>t()}),setInterval(function(){fetch("ping")},1e4)}ce(document.querySelector("#root")).render(n.jsx(we,{}))})();
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<link rel="icon" href="./playwright-logo.svg" type="image/svg+xml">
|
|
8
8
|
<title>Playwright Recorder</title>
|
|
9
|
-
<script type="module" crossorigin src="./recorder.
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/inspectorTab-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="./inspectorTab.
|
|
12
|
-
<link rel="stylesheet" crossorigin href="./recorder.
|
|
9
|
+
<script type="module" crossorigin src="./recorder.DTSaNaly.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/inspectorTab-Soeeuvzv.js">
|
|
11
|
+
<link rel="stylesheet" crossorigin href="./inspectorTab.DLjBDrQR.css">
|
|
12
|
+
<link rel="stylesheet" crossorigin href="./recorder.B_SY1GJM.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|