@checkly/playwright-core 1.48.24-maxi → 1.48.25-beta.0
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/bindingsControllerSource.js +7 -0
- package/lib/generated/storageScriptSource.js +7 -0
- package/lib/server/har/harRecorder.js +3 -1
- package/lib/server/trace/recorder/tracing.js +9 -20
- package/lib/utils/fileUtils.js +65 -2
- package/lib/vite/{traceViewer/assets/codeMirrorModule-tzBrK1V4.js → recorder/assets/codeMirrorModule-baozm8ur.js} +10 -10
- package/lib/vite/recorder/assets/{index-BcaUAUCW.js → index-2ElAIWFB.js} +2 -2
- package/lib/vite/recorder/index.html +1 -1
- package/lib/vite/traceViewer/assets/{codeMirrorModule-CB-2okZ8.js → codeMirrorModule-DblsdhjA.js} +2096 -2331
- package/lib/vite/{recorder/assets/codeMirrorModule-CR6kB851.js → traceViewer/assets/codeMirrorModule-lDjkI8Ax.js} +1 -1
- package/lib/vite/traceViewer/assets/{inspectorTab-BHcfR9dD.js → inspectorTab-BPzhNk9r.js} +2 -2
- package/lib/vite/traceViewer/assets/inspectorTab-DOc4D3cX.js +17361 -0
- package/lib/vite/traceViewer/assets/{defaultSettingsView-CBiB4avC.js → testServerConnection-D-tXL3sj.js} +49 -42
- package/lib/vite/traceViewer/assets/{workbench-DZqNXdoV.js → workbench-DLv_q9ji.js} +1 -1
- package/lib/vite/traceViewer/assets/workbench-DNolpp3y.js +1473 -0
- package/lib/vite/traceViewer/assets/xtermModule-DZP0glxx.js +5982 -0
- package/lib/vite/traceViewer/{embedded.DInvAijy.js → embedded.BIubxTi3.js} +1 -1
- package/lib/vite/traceViewer/{embedded.gzudoghF.js → embedded.DeCrOtlO.js} +4 -4
- package/lib/vite/traceViewer/embedded.html +3 -3
- package/lib/vite/traceViewer/{index.DilotR1h.js → index.CM_h9lHr.js} +7 -124
- package/lib/vite/traceViewer/{index.Dha3cgqs.js → index.DPD22sZn.js} +1 -1
- package/lib/vite/traceViewer/index.html +3 -3
- package/lib/vite/traceViewer/{inspectorTab.DnGm18kV.css → inspectorTab.DGJWXOSd.css} +1488 -1521
- package/lib/vite/traceViewer/{recorder.C88JDknq.js → recorder.BaRuS6Pc.js} +1 -1
- package/lib/vite/traceViewer/{recorder.DVrkq3Um.js → recorder.Fwf59ZKh.js} +3 -3
- package/lib/vite/traceViewer/recorder.html +2 -2
- package/lib/vite/traceViewer/{uiMode.2tr9k625.js → uiMode.B11wexdJ.js} +1 -1
- package/lib/vite/traceViewer/{uiMode.C9_OcpPU.js → uiMode.CYBsUhm_.js} +58 -90
- package/lib/vite/traceViewer/{uiMode.c5ORgcrX.css → uiMode.DRmgrHSk.css} +45 -7
- package/lib/vite/traceViewer/uiMode.html +3 -3
- package/lib/vite/traceViewer/{workbench.xUZSA8PY.css → workbench.BQNDbcQ0.css} +83 -320
- package/package.json +1 -1
- package/lib/client/clientStackTrace.js +0 -66
- package/lib/client/fileUtils.js +0 -33
- package/lib/client/platform.js +0 -72
- package/lib/client/timeoutSettings.js +0 -66
- package/lib/client/webSocket.js +0 -107
- package/lib/generated/recorderSource.js +0 -7
- package/lib/server/callLog.js +0 -80
- package/lib/server/harBackend.js +0 -158
- package/lib/server/localUtils.js +0 -204
- package/lib/server/recorder/chat.js +0 -178
- package/lib/server/recorder/codeGenerator.js +0 -154
- package/lib/server/recorder/csharp.js +0 -311
- package/lib/server/recorder/java.js +0 -249
- 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/server/storageScript.js +0 -161
- package/lib/server/timeoutSettings.js +0 -75
- package/lib/server/utils/ascii.js +0 -32
- package/lib/server/utils/comparators.js +0 -160
- package/lib/server/utils/crypto.js +0 -172
- package/lib/server/utils/debug.js +0 -39
- package/lib/server/utils/debugLogger.js +0 -94
- package/lib/server/utils/env.js +0 -54
- package/lib/server/utils/eventsHelper.js +0 -39
- package/lib/server/utils/expectUtils.js +0 -34
- package/lib/server/utils/fileUtils.js +0 -205
- package/lib/server/utils/happyEyeballs.js +0 -210
- package/lib/server/utils/hostPlatform.js +0 -146
- package/lib/server/utils/httpServer.js +0 -234
- package/lib/server/utils/image_tools/colorUtils.js +0 -99
- package/lib/server/utils/image_tools/compare.js +0 -109
- package/lib/server/utils/image_tools/imageChannel.js +0 -71
- package/lib/server/utils/image_tools/stats.js +0 -103
- package/lib/server/utils/linuxUtils.js +0 -59
- package/lib/server/utils/network.js +0 -161
- package/lib/server/utils/nodePlatform.js +0 -141
- package/lib/server/utils/pipeTransport.js +0 -83
- package/lib/server/utils/processLauncher.js +0 -249
- package/lib/server/utils/profiler.js +0 -53
- package/lib/server/utils/socksProxy.js +0 -571
- package/lib/server/utils/spawnAsync.js +0 -46
- package/lib/server/utils/task.js +0 -59
- package/lib/server/utils/userAgent.js +0 -92
- package/lib/server/utils/wsServer.js +0 -129
- package/lib/server/utils/zipFile.js +0 -76
- package/lib/server/utils/zones.js +0 -55
- package/lib/utils/glob.js +0 -84
- package/lib/utils/isomorphic/ariaSnapshot.js +0 -393
- package/lib/utils/isomorphic/assert.js +0 -26
- package/lib/utils/isomorphic/colors.js +0 -66
- package/lib/utils/isomorphic/headers.js +0 -53
- package/lib/utils/isomorphic/manualPromise.js +0 -108
- package/lib/utils/isomorphic/multimap.js +0 -74
- package/lib/utils/isomorphic/rtti.js +0 -42
- package/lib/utils/isomorphic/semaphore.js +0 -52
- package/lib/utils/isomorphic/stackTrace.js +0 -170
- package/lib/utils/isomorphic/time.js +0 -26
- package/lib/utils/isomorphic/timeoutRunner.js +0 -67
- package/lib/utils/isomorphic/types.js +0 -6
- package/lib/utils/mimeType.js +0 -30
- package/lib/utils.js +0 -448
- package/lib/vite/traceViewer/assets/codeMirrorModule-DZoSgqUd.js +0 -24
- package/lib/vite/traceViewer/assets/inspectorTab-BuJ3wAX_.js +0 -64
- package/lib/vite/traceViewer/assets/inspectorTab-CwgfffWb.js +0 -25143
- package/lib/vite/traceViewer/assets/workbench-CWZselvp.js +0 -2470
- package/lib/vite/traceViewer/assets/workbench-DdmJ9AJV.js +0 -9
- package/lib/vite/traceViewer/assets/xtermModule-Es_gt_u7.js +0 -5994
- package/lib/vite/traceViewer/defaultSettingsView.Dp3b_92q.css +0 -41
- package/lib/vite/traceViewer/embedded.Dxe2heQk.js +0 -2
- package/lib/vite/traceViewer/index.CB297BuW.js +0 -2
- package/lib/vite/traceViewer/recorder.DNMfnSiu.js +0 -2
- package/lib/vite/traceViewer/uiMode.Cr1tvTWS.js +0 -5
- /package/lib/vite/traceViewer/{codeMirrorModule.DuST8d_k.css → codeMirrorModule.Cy8X9Wtw.css} +0 -0
- /package/lib/vite/traceViewer/{embedded.BeldSa2G.css → embedded.DjZq4InJ.css} +0 -0
- /package/lib/vite/traceViewer/{index.QewjJ85u.css → index.QanXxRUb.css} +0 -0
- /package/lib/vite/traceViewer/{recorder.DLgqV9db.css → recorder.DBDpiNOK.css} +0 -0
- /package/lib/vite/traceViewer/{xtermModule.EsaqrrTX.css → xtermModule.4oRVGWQ-.css} +0 -0
|
@@ -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-BPzhNk9r.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,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { j as jsxRuntimeExports, r as reactExports,
|
|
4
|
+
import { j as jsxRuntimeExports, r as reactExports, M as MultiTraceModel, F as sha1, n as asLocator, L as ListView, g as Toolbar, T as ToolbarButton, H as ToolbarSeparator, J as copy, t as toggleTheme, S as SplitView, D as TabbedPane, y as useConsoleTabModel, z as useNetworkTabModel, h as useSetting, A as ConsoleTab, N as NetworkTab, K as collectSnapshots, O as extendSnapshot, Q as SnapshotView, I as InspectorTab, E as SourceTab, a as applyTheme, c as createRoot } from "./assets/inspectorTab-DOc4D3cX.js";
|
|
5
5
|
const SourceChooser = ({ sources, fileId, setFileId }) => {
|
|
6
6
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("select", { className: "source-chooser", hidden: !sources.length, title: "Source chooser", value: fileId, onChange: (event) => {
|
|
7
7
|
setFileId(event.target.selectedOptions[0].value);
|
|
@@ -546,6 +546,6 @@ Make sure to serve the Recorder (${window.location}) via HTTPS or localhost.`);
|
|
|
546
546
|
fetch("ping");
|
|
547
547
|
}, 1e4);
|
|
548
548
|
}
|
|
549
|
-
|
|
549
|
+
createRoot(document.querySelector("#root")).render(/* @__PURE__ */ jsxRuntimeExports.jsx(RecorderView, {}));
|
|
550
550
|
})();
|
|
551
|
-
//# sourceMappingURL=recorder.
|
|
551
|
+
//# sourceMappingURL=recorder.Fwf59ZKh.js.map
|
|
@@ -6,8 +6,8 @@
|
|
|
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-
|
|
9
|
+
<script type="module" crossorigin src="./recorder.BaRuS6Pc.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/inspectorTab-BPzhNk9r.js">
|
|
11
11
|
<link rel="stylesheet" crossorigin href="./inspectorTab.DLjBDrQR.css">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="./recorder.B_SY1GJM.css">
|
|
13
13
|
</head>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/xtermModule-BeNbaIVa.js","./xtermModule.DSXBckUd.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{u as Me,r as V,b as De,_ as Le,d as Fe,e as Oe,j as o,R as h,s as me,f as re,m as We,g as $,T as M,M as Ue,h as Ae,i as ze,S as Ve,a as Ke,c as He}from"./assets/inspectorTab-BHcfR9dD.js";import{T as $e,W as qe}from"./assets/testServerConnection-DeE2kSzz.js";import{E as Ye,t as Qe,T as Xe,W as Ge}from"./assets/workbench-DZqNXdoV.js";var Je={};class se{constructor(e,t={}){this.isListing=!1,this._tests=new Map,this._rootSuite=new q("","root"),this._options=t,this._reporter=e}reset(){this._rootSuite._entries=[],this._tests.clear()}dispatch(e){const{method:t,params:s}=e;if(t==="onConfigure"){this._onConfigure(s.config);return}if(t==="onProject"){this._onProject(s.project);return}if(t==="onBegin"){this._onBegin();return}if(t==="onTestBegin"){this._onTestBegin(s.testId,s.result);return}if(t==="onTestEnd"){this._onTestEnd(s.test,s.result);return}if(t==="onStepBegin"){this._onStepBegin(s.testId,s.resultId,s.step);return}if(t==="onStepEnd"){this._onStepEnd(s.testId,s.resultId,s.step);return}if(t==="onError"){this._onError(s.error);return}if(t==="onStdIO"){this._onStdIO(s.type,s.testId,s.resultId,s.data,s.isBase64);return}if(t==="onEnd")return this._onEnd(s.result);if(t==="onExit")return this._onExit()}_onConfigure(e){var t,s;this._rootDir=e.rootDir,this._config=this._parseConfig(e),(s=(t=this._reporter).onConfigure)==null||s.call(t,this._config)}_onProject(e){let t=this._options.mergeProjects?this._rootSuite.suites.find(s=>s.project().name===e.name):void 0;t||(t=new q(e.name,"project"),this._rootSuite._addSuite(t)),t._project=this._parseProject(e);for(const s of e.suites)this._mergeSuiteInto(s,t)}_onBegin(){var e,t;(t=(e=this._reporter).onBegin)==null||t.call(e,this._rootSuite)}_onTestBegin(e,t){var c,a;const s=this._tests.get(e);this._options.clearPreviousResultsWhenTestBegins&&(s.results=[]);const r=s._createTestResult(t.id);r.retry=t.retry,r.workerIndex=t.workerIndex,r.parallelIndex=t.parallelIndex,r.setStartTimeNumber(t.startTime),(a=(c=this._reporter).onTestBegin)==null||a.call(c,s,r)}_onTestEnd(e,t){var c,a,m;const s=this._tests.get(e.testId);s.timeout=e.timeout,s.expectedStatus=e.expectedStatus,s.annotations=e.annotations;const r=s.results.find(l=>l._id===t.id);r.duration=t.duration,r.status=t.status,r.errors=t.errors,r.error=(c=r.errors)==null?void 0:c[0],r.attachments=this._parseAttachments(t.attachments),(m=(a=this._reporter).onTestEnd)==null||m.call(a,s,r),r._stepMap=new Map}_onStepBegin(e,t,s){var _,n;const r=this._tests.get(e),c=r.results.find(f=>f._id===t),a=s.parentStepId?c._stepMap.get(s.parentStepId):void 0,m=this._absoluteLocation(s.location),l=new et(s,a,m);a?a.steps.push(l):c.steps.push(l),c._stepMap.set(s.id,l),(n=(_=this._reporter).onStepBegin)==null||n.call(_,r,c,l)}_onStepEnd(e,t,s){var m,l;const r=this._tests.get(e),c=r.results.find(_=>_._id===t),a=c._stepMap.get(s.id);a.duration=s.duration,a.error=s.error,(l=(m=this._reporter).onStepEnd)==null||l.call(m,r,c,a)}_onError(e){var t,s;(s=(t=this._reporter).onError)==null||s.call(t,e)}_onStdIO(e,t,s,r,c){var _,n,f,S;const a=c?globalThis.Buffer?Buffer.from(r,"base64"):atob(r):r,m=t?this._tests.get(t):void 0,l=m&&s?m.results.find(d=>d._id===s):void 0;e==="stdout"?(l==null||l.stdout.push(a),(n=(_=this._reporter).onStdOut)==null||n.call(_,a,m,l)):(l==null||l.stderr.push(a),(S=(f=this._reporter).onStdErr)==null||S.call(f,a,m,l))}async _onEnd(e){var t,s;await((s=(t=this._reporter).onEnd)==null?void 0:s.call(t,{status:e.status,startTime:new Date(e.startTime),duration:e.duration}))}_onExit(){var e,t;return(t=(e=this._reporter).onExit)==null?void 0:t.call(e)}_parseConfig(e){const t={...st,...e};return this._options.configOverrides&&(t.configFile=this._options.configOverrides.configFile,t.reportSlowTests=this._options.configOverrides.reportSlowTests,t.quiet=this._options.configOverrides.quiet,t.reporter=[...this._options.configOverrides.reporter]),t}_parseProject(e){return{metadata:e.metadata,name:e.name,outputDir:this._absolutePath(e.outputDir),repeatEach:e.repeatEach,retries:e.retries,testDir:this._absolutePath(e.testDir),testIgnore:Z(e.testIgnore),testMatch:Z(e.testMatch),timeout:e.timeout,grep:Z(e.grep),grepInvert:Z(e.grepInvert),dependencies:e.dependencies,teardown:e.teardown,snapshotDir:this._absolutePath(e.snapshotDir),use:{}}}_parseAttachments(e){return e.map(t=>({...t,body:t.base64&&globalThis.Buffer?Buffer.from(t.base64,"base64"):void 0}))}_mergeSuiteInto(e,t){let s=t.suites.find(r=>r.title===e.title);s||(s=new q(e.title,t.type==="project"?"file":"describe"),t._addSuite(s)),s.location=this._absoluteLocation(e.location),e.entries.forEach(r=>{"testId"in r?this._mergeTestInto(r,s):this._mergeSuiteInto(r,s)})}_mergeTestInto(e,t){let s=this._options.mergeTestCases?t.tests.find(r=>r.title===e.title&&r.repeatEachIndex===e.repeatEachIndex):void 0;s||(s=new Ze(e.testId,e.title,this._absoluteLocation(e.location),e.repeatEachIndex),t._addTest(s),this._tests.set(s.id,s)),this._updateTest(e,s)}_updateTest(e,t){return t.id=e.testId,t.location=this._absoluteLocation(e.location),t.retries=e.retries,t.tags=e.tags??[],t.annotations=e.annotations??[],t}_absoluteLocation(e){return e&&{...e,file:this._absolutePath(e.file)}}_absolutePath(e){if(e!==void 0)return this._options.resolvePath?this._options.resolvePath(this._rootDir,e):this._rootDir+"/"+e}}class q{constructor(e,t){this._entries=[],this._requireFile="",this._parallelMode="none",this.title=e,this._type=t}get type(){return this._type}get suites(){return this._entries.filter(e=>e.type!=="test")}get tests(){return this._entries.filter(e=>e.type==="test")}entries(){return this._entries}allTests(){const e=[],t=s=>{for(const r of s.entries())r.type==="test"?e.push(r):t(r)};return t(this),e}titlePath(){const e=this.parent?this.parent.titlePath():[];return(this.title||this._type!=="describe")&&e.push(this.title),e}project(){var e;return this._project??((e=this.parent)==null?void 0:e.project())}_addTest(e){e.parent=this,this._entries.push(e)}_addSuite(e){e.parent=this,this._entries.push(e)}}class Ze{constructor(e,t,s,r){this.fn=()=>{},this.results=[],this.type="test",this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.tags=[],this.repeatEachIndex=0,this.id=e,this.title=t,this.location=s,this.repeatEachIndex=r}titlePath(){const e=this.parent?this.parent.titlePath():[];return e.push(this.title),e}outcome(){return it(this)}ok(){const e=this.outcome();return e==="expected"||e==="flaky"||e==="skipped"}_createTestResult(e){const t=new tt(this.results.length,e);return this.results.push(t),t}}class et{constructor(e,t,s){this.duration=-1,this.steps=[],this._startTime=0,this.title=e.title,this.category=e.category,this.location=s,this.parent=t,this._startTime=e.startTime}titlePath(){var t;return[...((t=this.parent)==null?void 0:t.titlePath())||[],this.title]}get startTime(){return new Date(this._startTime)}set startTime(e){this._startTime=+e}}class tt{constructor(e,t){this.parallelIndex=-1,this.workerIndex=-1,this.duration=-1,this.stdout=[],this.stderr=[],this.attachments=[],this.status="skipped",this.steps=[],this.errors=[],this._stepMap=new Map,this._startTime=0,this.retry=e,this._id=t}setStartTimeNumber(e){this._startTime=e}get startTime(){return new Date(this._startTime)}set startTime(e){this._startTime=+e}}const st={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[Je.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:15e3},configFile:"",rootDir:"",quiet:!1,shard:null,updateSnapshots:"missing",version:"",workers:0,webServer:null};function Z(i){return i.map(e=>e.s!==void 0?e.s:new RegExp(e.r.source,e.r.flags))}function it(i){let e=0,t=0,s=0;for(const r of i.results)r.status==="interrupted"||(r.status==="skipped"&&i.expectedStatus==="skipped"?++e:r.status==="skipped"||(r.status===i.expectedStatus?++t:++s));return t===0&&s===0?"skipped":s===0?"expected":t===0&&e===0?"unexpected":"flaky"}class ie{constructor(e,t,s,r,c){this._treeItemById=new Map,this._treeItemByTestId=new Map;const a=r&&[...r.values()].some(Boolean);this.pathSeparator=c,this.rootItem={kind:"group",subKind:"folder",id:e,title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},this._treeItemById.set(e,this.rootItem);const m=(l,_,n)=>{for(const f of _.suites){const S=f.title||"<anonymous>";let d=n.children.find(p=>p.kind==="group"&&p.title===S);d||(d={kind:"group",subKind:"describe",id:"suite:"+_.titlePath().join("")+""+S,title:S,location:f.location,duration:0,parent:n,children:[],status:"none",hasLoadErrors:!1},this._addChild(n,d)),m(l,f,d)}for(const f of _.tests){const S=f.title;let d=n.children.find(E=>E.kind!=="group"&&E.title===S);d||(d={kind:"case",id:"test:"+f.titlePath().join(""),title:S,parent:n,children:[],tests:[],location:f.location,duration:0,status:"none",project:void 0,test:void 0,tags:f.tags},this._addChild(n,d));const p=f.results[0];let x="none";(p==null?void 0:p[Y])==="scheduled"?x="scheduled":(p==null?void 0:p[Y])==="running"?x="running":(p==null?void 0:p.status)==="skipped"?x="skipped":(p==null?void 0:p.status)==="interrupted"?x="none":p&&f.outcome()!=="expected"?x="failed":p&&f.outcome()==="expected"&&(x="passed"),d.tests.push(f);const R={kind:"test",id:f.id,title:l.name,location:f.location,test:f,parent:d,children:[],status:x,duration:f.results.length?Math.max(0,f.results[0].duration):0,project:l};this._addChild(d,R),this._treeItemByTestId.set(f.id,R),d.duration=d.children.reduce((E,I)=>E+I.duration,0)}};for(const l of(t==null?void 0:t.suites)||[])if(!(a&&!r.get(l.title)))for(const _ of l.suites){const n=this._fileItem(_.location.file.split(c),!0);m(l.project(),_,n)}for(const l of s){if(!l.location)continue;const _=this._fileItem(l.location.file.split(c),!0);_.hasLoadErrors=!0}}_addChild(e,t){e.children.push(t),t.parent=e,this._treeItemById.set(t.id,t)}filterTree(e,t,s){const r=e.trim().toLowerCase().split(" "),c=[...t.values()].some(Boolean),a=l=>{const _=[...l.tests[0].titlePath(),...l.tests[0].tags].join(" ").toLowerCase();return!r.every(n=>_.includes(n))&&!l.tests.some(n=>s==null?void 0:s.has(n.id))?!1:(l.children=l.children.filter(n=>!c||(s==null?void 0:s.has(n.test.id))||t.get(n.status)),l.tests=l.children.map(n=>n.test),!!l.children.length)},m=l=>{const _=[];for(const n of l.children)n.kind==="case"?a(n)&&_.push(n):(m(n),(n.children.length||n.hasLoadErrors)&&_.push(n));l.children=_};m(this.rootItem)}_fileItem(e,t){if(e.length===0)return this.rootItem;const s=e.join(this.pathSeparator),r=this._treeItemById.get(s);if(r)return r;const c=this._fileItem(e.slice(0,e.length-1),!1),a={kind:"group",subKind:t?"file":"folder",id:s,title:e[e.length-1],location:{file:s,line:0,column:0},duration:0,parent:c,children:[],status:"none",hasLoadErrors:!1};return this._addChild(c,a),a}sortAndPropagateStatus(){_e(this.rootItem)}flattenForSingleProject(){const e=t=>{t.kind==="case"&&t.children.length===1?(t.project=t.children[0].project,t.test=t.children[0].test,t.children=[],this._treeItemByTestId.set(t.test.id,t)):t.children.forEach(e)};e(this.rootItem)}shortenRoot(){let e=this.rootItem;for(;e.children.length===1&&e.children[0].kind==="group"&&e.children[0].subKind==="folder";)e=e.children[0];e.location=this.rootItem.location,this.rootItem=e}testIds(){const e=new Set,t=s=>{s.kind==="case"&&s.tests.forEach(r=>e.add(r.id)),s.children.forEach(t)};return t(this.rootItem),e}fileNames(){const e=new Set,t=s=>{s.kind==="group"&&s.subKind==="file"?e.add(s.id):s.children.forEach(t)};return t(this.rootItem),[...e]}flatTreeItems(){const e=[],t=s=>{e.push(s),s.children.forEach(t)};return t(this.rootItem),e}treeItemById(e){return this._treeItemById.get(e)}collectTestIds(e){return e?rt(e):new Set}}function _e(i){for(const a of i.children)_e(a);i.kind==="group"&&i.children.sort((a,m)=>a.location.file.localeCompare(m.location.file)||a.location.line-m.location.line);let e=i.children.length>0,t=i.children.length>0,s=!1,r=!1,c=!1;for(const a of i.children)t=t&&a.status==="skipped",e=e&&(a.status==="passed"||a.status==="skipped"),s=s||a.status==="failed",r=r||a.status==="running",c=c||a.status==="scheduled";r?i.status="running":c?i.status="scheduled":s?i.status="failed":t?i.status="skipped":e&&(i.status="passed")}function rt(i){const e=new Set,t=s=>{var r;s.kind==="case"?s.tests.map(c=>c.id).forEach(c=>e.add(c)):s.kind==="test"?e.add(s.id):(r=s.children)==null||r.forEach(t)};return t(i),e}const Y=Symbol("statusEx");class ot{constructor(e){this.loadErrors=[],this.progress={total:0,passed:0,failed:0,skipped:0},this._lastRunTestCount=0,this._receiver=new se(this._createReporter(),{mergeProjects:!0,mergeTestCases:!0,resolvePath:(t,s)=>t+e.pathSeparator+s,clearPreviousResultsWhenTestBegins:!0}),this._options=e}_createReporter(){return{version:()=>"v2",onConfigure:e=>{this.config=e,this._lastRunReceiver=new se({version:()=>"v2",onBegin:t=>{this._lastRunTestCount=t.allTests().length,this._lastRunReceiver=void 0}},{mergeProjects:!0,mergeTestCases:!1,resolvePath:(t,s)=>t+this._options.pathSeparator+s})},onBegin:e=>{var t;if(this.rootSuite||(this.rootSuite=e),this._testResultsSnapshot){for(const s of this.rootSuite.allTests())s.results=((t=this._testResultsSnapshot)==null?void 0:t.get(s.id))||s.results;this._testResultsSnapshot=void 0}this.progress.total=this._lastRunTestCount,this.progress.passed=0,this.progress.failed=0,this.progress.skipped=0,this._options.onUpdate(!0)},onEnd:()=>{this._options.onUpdate(!0)},onTestBegin:(e,t)=>{t[Y]="running",this._options.onUpdate()},onTestEnd:(e,t)=>{e.outcome()==="skipped"?++this.progress.skipped:e.outcome()==="unexpected"?++this.progress.failed:++this.progress.passed,t[Y]=t.status,this._options.onUpdate()},onError:e=>this._handleOnError(e),printsToStdio:()=>!1}}processGlobalReport(e){const t=new se({version:()=>"v2",onConfigure:s=>{this.config=s},onError:s=>this._handleOnError(s)});for(const s of e)t.dispatch(s)}processListReport(e){var s;const t=((s=this.rootSuite)==null?void 0:s.allTests())||[];this._testResultsSnapshot=new Map(t.map(r=>[r.id,r.results])),this._receiver.reset();for(const r of e)this._receiver.dispatch(r)}processTestReportEvent(e){var t,s,r;(s=(t=this._lastRunReceiver)==null?void 0:t.dispatch(e))==null||s.catch(()=>{}),(r=this._receiver.dispatch(e))==null||r.catch(()=>{})}_handleOnError(e){var t,s;this.loadErrors.push(e),(s=(t=this._options).onError)==null||s.call(t,e),this._options.onUpdate()}asModel(){return{rootSuite:this.rootSuite||new q("","root"),config:this.config,loadErrors:this.loadErrors,progress:this.progress}}}const nt=({source:i})=>{const[e,t]=Me(),[s,r]=V.useState(De()),[c]=V.useState(Le(()=>import("./assets/xtermModule-BeNbaIVa.js"),__vite__mapDeps([0,1]),import.meta.url).then(m=>m.default)),a=V.useRef(null);return V.useEffect(()=>(Fe(r),()=>Oe(r)),[]),V.useEffect(()=>{const m=i.write,l=i.clear;return(async()=>{const{Terminal:_,FitAddon:n}=await c,f=t.current;if(!f)return;const S=s==="dark-mode"?lt:at;if(a.current&&a.current.terminal.options.theme===S)return;a.current&&(f.textContent="");const d=new _({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"var(--vscode-editor-font-family)",theme:S}),p=new n;d.loadAddon(p);for(const x of i.pending)d.write(x);i.write=x=>{i.pending.push(x),d.write(x)},i.clear=()=>{i.pending=[],d.clear()},d.open(f),p.fit(),a.current={terminal:d,fitAddon:p}})(),()=>{i.clear=l,i.write=m}},[c,a,t,i,s]),V.useEffect(()=>{setTimeout(()=>{a.current&&(a.current.fitAddon.fit(),i.resize(a.current.terminal.cols,a.current.terminal.rows))},250)},[e,i]),o.jsx("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:t})},at={foreground:"#383a42",background:"#fafafa",cursor:"#383a42",black:"#000000",red:"#e45649",green:"#50a14f",yellow:"#c18401",blue:"#4078f2",magenta:"#a626a4",cyan:"#0184bc",white:"#a0a0a0",brightBlack:"#000000",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#d19a66",brightBlue:"#4078f2",brightMagenta:"#a626a4",brightCyan:"#0184bc",brightWhite:"#383a42",selectionBackground:"#d7d7d7",selectionForeground:"#383a42"},lt={foreground:"#f8f8f2",background:"#1e1e1e",cursor:"#f8f8f0",black:"#000000",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#bfbfbf",brightBlack:"#4d4d4d",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#e6e6e6",selectionBackground:"#44475a",selectionForeground:"#f8f8f2"},ct=({filterText:i,setFilterText:e,statusFilters:t,setStatusFilters:s,projectFilters:r,setProjectFilters:c,testModel:a,runTests:m})=>{const[l,_]=h.useState(!1),n=h.useRef(null);h.useEffect(()=>{var d;(d=n.current)==null||d.focus()},[]);const f=[...t.entries()].filter(([d,p])=>p).map(([d])=>d).join(" ")||"all",S=[...r.entries()].filter(([d,p])=>p).map(([d])=>d).join(" ")||"all";return o.jsxs("div",{className:"filters",children:[o.jsx(Ye,{expanded:l,setExpanded:_,title:o.jsx("input",{ref:n,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:i,onChange:d=>{e(d.target.value)},onKeyDown:d=>{d.key==="Enter"&&m()}})}),o.jsxs("div",{className:"filter-summary",title:"Status: "+f+`
|
|
2
|
+
import{u as Me,r as V,b as De,_ as Le,d as Fe,e as Oe,j as o,R as h,s as me,f as re,m as We,g as $,T as M,M as Ue,h as Ae,i as ze,S as Ve,a as Ke,c as He}from"./assets/inspectorTab-BPzhNk9r.js";import{T as $e,W as qe}from"./assets/testServerConnection-DeE2kSzz.js";import{E as Ye,t as Qe,T as Xe,W as Ge}from"./assets/workbench-DLv_q9ji.js";var Je={};class se{constructor(e,t={}){this.isListing=!1,this._tests=new Map,this._rootSuite=new q("","root"),this._options=t,this._reporter=e}reset(){this._rootSuite._entries=[],this._tests.clear()}dispatch(e){const{method:t,params:s}=e;if(t==="onConfigure"){this._onConfigure(s.config);return}if(t==="onProject"){this._onProject(s.project);return}if(t==="onBegin"){this._onBegin();return}if(t==="onTestBegin"){this._onTestBegin(s.testId,s.result);return}if(t==="onTestEnd"){this._onTestEnd(s.test,s.result);return}if(t==="onStepBegin"){this._onStepBegin(s.testId,s.resultId,s.step);return}if(t==="onStepEnd"){this._onStepEnd(s.testId,s.resultId,s.step);return}if(t==="onError"){this._onError(s.error);return}if(t==="onStdIO"){this._onStdIO(s.type,s.testId,s.resultId,s.data,s.isBase64);return}if(t==="onEnd")return this._onEnd(s.result);if(t==="onExit")return this._onExit()}_onConfigure(e){var t,s;this._rootDir=e.rootDir,this._config=this._parseConfig(e),(s=(t=this._reporter).onConfigure)==null||s.call(t,this._config)}_onProject(e){let t=this._options.mergeProjects?this._rootSuite.suites.find(s=>s.project().name===e.name):void 0;t||(t=new q(e.name,"project"),this._rootSuite._addSuite(t)),t._project=this._parseProject(e);for(const s of e.suites)this._mergeSuiteInto(s,t)}_onBegin(){var e,t;(t=(e=this._reporter).onBegin)==null||t.call(e,this._rootSuite)}_onTestBegin(e,t){var c,a;const s=this._tests.get(e);this._options.clearPreviousResultsWhenTestBegins&&(s.results=[]);const r=s._createTestResult(t.id);r.retry=t.retry,r.workerIndex=t.workerIndex,r.parallelIndex=t.parallelIndex,r.setStartTimeNumber(t.startTime),(a=(c=this._reporter).onTestBegin)==null||a.call(c,s,r)}_onTestEnd(e,t){var c,a,m;const s=this._tests.get(e.testId);s.timeout=e.timeout,s.expectedStatus=e.expectedStatus,s.annotations=e.annotations;const r=s.results.find(l=>l._id===t.id);r.duration=t.duration,r.status=t.status,r.errors=t.errors,r.error=(c=r.errors)==null?void 0:c[0],r.attachments=this._parseAttachments(t.attachments),(m=(a=this._reporter).onTestEnd)==null||m.call(a,s,r),r._stepMap=new Map}_onStepBegin(e,t,s){var _,n;const r=this._tests.get(e),c=r.results.find(f=>f._id===t),a=s.parentStepId?c._stepMap.get(s.parentStepId):void 0,m=this._absoluteLocation(s.location),l=new et(s,a,m);a?a.steps.push(l):c.steps.push(l),c._stepMap.set(s.id,l),(n=(_=this._reporter).onStepBegin)==null||n.call(_,r,c,l)}_onStepEnd(e,t,s){var m,l;const r=this._tests.get(e),c=r.results.find(_=>_._id===t),a=c._stepMap.get(s.id);a.duration=s.duration,a.error=s.error,(l=(m=this._reporter).onStepEnd)==null||l.call(m,r,c,a)}_onError(e){var t,s;(s=(t=this._reporter).onError)==null||s.call(t,e)}_onStdIO(e,t,s,r,c){var _,n,f,S;const a=c?globalThis.Buffer?Buffer.from(r,"base64"):atob(r):r,m=t?this._tests.get(t):void 0,l=m&&s?m.results.find(d=>d._id===s):void 0;e==="stdout"?(l==null||l.stdout.push(a),(n=(_=this._reporter).onStdOut)==null||n.call(_,a,m,l)):(l==null||l.stderr.push(a),(S=(f=this._reporter).onStdErr)==null||S.call(f,a,m,l))}async _onEnd(e){var t,s;await((s=(t=this._reporter).onEnd)==null?void 0:s.call(t,{status:e.status,startTime:new Date(e.startTime),duration:e.duration}))}_onExit(){var e,t;return(t=(e=this._reporter).onExit)==null?void 0:t.call(e)}_parseConfig(e){const t={...st,...e};return this._options.configOverrides&&(t.configFile=this._options.configOverrides.configFile,t.reportSlowTests=this._options.configOverrides.reportSlowTests,t.quiet=this._options.configOverrides.quiet,t.reporter=[...this._options.configOverrides.reporter]),t}_parseProject(e){return{metadata:e.metadata,name:e.name,outputDir:this._absolutePath(e.outputDir),repeatEach:e.repeatEach,retries:e.retries,testDir:this._absolutePath(e.testDir),testIgnore:Z(e.testIgnore),testMatch:Z(e.testMatch),timeout:e.timeout,grep:Z(e.grep),grepInvert:Z(e.grepInvert),dependencies:e.dependencies,teardown:e.teardown,snapshotDir:this._absolutePath(e.snapshotDir),use:{}}}_parseAttachments(e){return e.map(t=>({...t,body:t.base64&&globalThis.Buffer?Buffer.from(t.base64,"base64"):void 0}))}_mergeSuiteInto(e,t){let s=t.suites.find(r=>r.title===e.title);s||(s=new q(e.title,t.type==="project"?"file":"describe"),t._addSuite(s)),s.location=this._absoluteLocation(e.location),e.entries.forEach(r=>{"testId"in r?this._mergeTestInto(r,s):this._mergeSuiteInto(r,s)})}_mergeTestInto(e,t){let s=this._options.mergeTestCases?t.tests.find(r=>r.title===e.title&&r.repeatEachIndex===e.repeatEachIndex):void 0;s||(s=new Ze(e.testId,e.title,this._absoluteLocation(e.location),e.repeatEachIndex),t._addTest(s),this._tests.set(s.id,s)),this._updateTest(e,s)}_updateTest(e,t){return t.id=e.testId,t.location=this._absoluteLocation(e.location),t.retries=e.retries,t.tags=e.tags??[],t.annotations=e.annotations??[],t}_absoluteLocation(e){return e&&{...e,file:this._absolutePath(e.file)}}_absolutePath(e){if(e!==void 0)return this._options.resolvePath?this._options.resolvePath(this._rootDir,e):this._rootDir+"/"+e}}class q{constructor(e,t){this._entries=[],this._requireFile="",this._parallelMode="none",this.title=e,this._type=t}get type(){return this._type}get suites(){return this._entries.filter(e=>e.type!=="test")}get tests(){return this._entries.filter(e=>e.type==="test")}entries(){return this._entries}allTests(){const e=[],t=s=>{for(const r of s.entries())r.type==="test"?e.push(r):t(r)};return t(this),e}titlePath(){const e=this.parent?this.parent.titlePath():[];return(this.title||this._type!=="describe")&&e.push(this.title),e}project(){var e;return this._project??((e=this.parent)==null?void 0:e.project())}_addTest(e){e.parent=this,this._entries.push(e)}_addSuite(e){e.parent=this,this._entries.push(e)}}class Ze{constructor(e,t,s,r){this.fn=()=>{},this.results=[],this.type="test",this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.tags=[],this.repeatEachIndex=0,this.id=e,this.title=t,this.location=s,this.repeatEachIndex=r}titlePath(){const e=this.parent?this.parent.titlePath():[];return e.push(this.title),e}outcome(){return it(this)}ok(){const e=this.outcome();return e==="expected"||e==="flaky"||e==="skipped"}_createTestResult(e){const t=new tt(this.results.length,e);return this.results.push(t),t}}class et{constructor(e,t,s){this.duration=-1,this.steps=[],this._startTime=0,this.title=e.title,this.category=e.category,this.location=s,this.parent=t,this._startTime=e.startTime}titlePath(){var t;return[...((t=this.parent)==null?void 0:t.titlePath())||[],this.title]}get startTime(){return new Date(this._startTime)}set startTime(e){this._startTime=+e}}class tt{constructor(e,t){this.parallelIndex=-1,this.workerIndex=-1,this.duration=-1,this.stdout=[],this.stderr=[],this.attachments=[],this.status="skipped",this.steps=[],this.errors=[],this._stepMap=new Map,this._startTime=0,this.retry=e,this._id=t}setStartTimeNumber(e){this._startTime=e}get startTime(){return new Date(this._startTime)}set startTime(e){this._startTime=+e}}const st={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[Je.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:15e3},configFile:"",rootDir:"",quiet:!1,shard:null,updateSnapshots:"missing",version:"",workers:0,webServer:null};function Z(i){return i.map(e=>e.s!==void 0?e.s:new RegExp(e.r.source,e.r.flags))}function it(i){let e=0,t=0,s=0;for(const r of i.results)r.status==="interrupted"||(r.status==="skipped"&&i.expectedStatus==="skipped"?++e:r.status==="skipped"||(r.status===i.expectedStatus?++t:++s));return t===0&&s===0?"skipped":s===0?"expected":t===0&&e===0?"unexpected":"flaky"}class ie{constructor(e,t,s,r,c){this._treeItemById=new Map,this._treeItemByTestId=new Map;const a=r&&[...r.values()].some(Boolean);this.pathSeparator=c,this.rootItem={kind:"group",subKind:"folder",id:e,title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},this._treeItemById.set(e,this.rootItem);const m=(l,_,n)=>{for(const f of _.suites){const S=f.title||"<anonymous>";let d=n.children.find(p=>p.kind==="group"&&p.title===S);d||(d={kind:"group",subKind:"describe",id:"suite:"+_.titlePath().join("")+""+S,title:S,location:f.location,duration:0,parent:n,children:[],status:"none",hasLoadErrors:!1},this._addChild(n,d)),m(l,f,d)}for(const f of _.tests){const S=f.title;let d=n.children.find(E=>E.kind!=="group"&&E.title===S);d||(d={kind:"case",id:"test:"+f.titlePath().join(""),title:S,parent:n,children:[],tests:[],location:f.location,duration:0,status:"none",project:void 0,test:void 0,tags:f.tags},this._addChild(n,d));const p=f.results[0];let x="none";(p==null?void 0:p[Y])==="scheduled"?x="scheduled":(p==null?void 0:p[Y])==="running"?x="running":(p==null?void 0:p.status)==="skipped"?x="skipped":(p==null?void 0:p.status)==="interrupted"?x="none":p&&f.outcome()!=="expected"?x="failed":p&&f.outcome()==="expected"&&(x="passed"),d.tests.push(f);const R={kind:"test",id:f.id,title:l.name,location:f.location,test:f,parent:d,children:[],status:x,duration:f.results.length?Math.max(0,f.results[0].duration):0,project:l};this._addChild(d,R),this._treeItemByTestId.set(f.id,R),d.duration=d.children.reduce((E,I)=>E+I.duration,0)}};for(const l of(t==null?void 0:t.suites)||[])if(!(a&&!r.get(l.title)))for(const _ of l.suites){const n=this._fileItem(_.location.file.split(c),!0);m(l.project(),_,n)}for(const l of s){if(!l.location)continue;const _=this._fileItem(l.location.file.split(c),!0);_.hasLoadErrors=!0}}_addChild(e,t){e.children.push(t),t.parent=e,this._treeItemById.set(t.id,t)}filterTree(e,t,s){const r=e.trim().toLowerCase().split(" "),c=[...t.values()].some(Boolean),a=l=>{const _=[...l.tests[0].titlePath(),...l.tests[0].tags].join(" ").toLowerCase();return!r.every(n=>_.includes(n))&&!l.tests.some(n=>s==null?void 0:s.has(n.id))?!1:(l.children=l.children.filter(n=>!c||(s==null?void 0:s.has(n.test.id))||t.get(n.status)),l.tests=l.children.map(n=>n.test),!!l.children.length)},m=l=>{const _=[];for(const n of l.children)n.kind==="case"?a(n)&&_.push(n):(m(n),(n.children.length||n.hasLoadErrors)&&_.push(n));l.children=_};m(this.rootItem)}_fileItem(e,t){if(e.length===0)return this.rootItem;const s=e.join(this.pathSeparator),r=this._treeItemById.get(s);if(r)return r;const c=this._fileItem(e.slice(0,e.length-1),!1),a={kind:"group",subKind:t?"file":"folder",id:s,title:e[e.length-1],location:{file:s,line:0,column:0},duration:0,parent:c,children:[],status:"none",hasLoadErrors:!1};return this._addChild(c,a),a}sortAndPropagateStatus(){_e(this.rootItem)}flattenForSingleProject(){const e=t=>{t.kind==="case"&&t.children.length===1?(t.project=t.children[0].project,t.test=t.children[0].test,t.children=[],this._treeItemByTestId.set(t.test.id,t)):t.children.forEach(e)};e(this.rootItem)}shortenRoot(){let e=this.rootItem;for(;e.children.length===1&&e.children[0].kind==="group"&&e.children[0].subKind==="folder";)e=e.children[0];e.location=this.rootItem.location,this.rootItem=e}testIds(){const e=new Set,t=s=>{s.kind==="case"&&s.tests.forEach(r=>e.add(r.id)),s.children.forEach(t)};return t(this.rootItem),e}fileNames(){const e=new Set,t=s=>{s.kind==="group"&&s.subKind==="file"?e.add(s.id):s.children.forEach(t)};return t(this.rootItem),[...e]}flatTreeItems(){const e=[],t=s=>{e.push(s),s.children.forEach(t)};return t(this.rootItem),e}treeItemById(e){return this._treeItemById.get(e)}collectTestIds(e){return e?rt(e):new Set}}function _e(i){for(const a of i.children)_e(a);i.kind==="group"&&i.children.sort((a,m)=>a.location.file.localeCompare(m.location.file)||a.location.line-m.location.line);let e=i.children.length>0,t=i.children.length>0,s=!1,r=!1,c=!1;for(const a of i.children)t=t&&a.status==="skipped",e=e&&(a.status==="passed"||a.status==="skipped"),s=s||a.status==="failed",r=r||a.status==="running",c=c||a.status==="scheduled";r?i.status="running":c?i.status="scheduled":s?i.status="failed":t?i.status="skipped":e&&(i.status="passed")}function rt(i){const e=new Set,t=s=>{var r;s.kind==="case"?s.tests.map(c=>c.id).forEach(c=>e.add(c)):s.kind==="test"?e.add(s.id):(r=s.children)==null||r.forEach(t)};return t(i),e}const Y=Symbol("statusEx");class ot{constructor(e){this.loadErrors=[],this.progress={total:0,passed:0,failed:0,skipped:0},this._lastRunTestCount=0,this._receiver=new se(this._createReporter(),{mergeProjects:!0,mergeTestCases:!0,resolvePath:(t,s)=>t+e.pathSeparator+s,clearPreviousResultsWhenTestBegins:!0}),this._options=e}_createReporter(){return{version:()=>"v2",onConfigure:e=>{this.config=e,this._lastRunReceiver=new se({version:()=>"v2",onBegin:t=>{this._lastRunTestCount=t.allTests().length,this._lastRunReceiver=void 0}},{mergeProjects:!0,mergeTestCases:!1,resolvePath:(t,s)=>t+this._options.pathSeparator+s})},onBegin:e=>{var t;if(this.rootSuite||(this.rootSuite=e),this._testResultsSnapshot){for(const s of this.rootSuite.allTests())s.results=((t=this._testResultsSnapshot)==null?void 0:t.get(s.id))||s.results;this._testResultsSnapshot=void 0}this.progress.total=this._lastRunTestCount,this.progress.passed=0,this.progress.failed=0,this.progress.skipped=0,this._options.onUpdate(!0)},onEnd:()=>{this._options.onUpdate(!0)},onTestBegin:(e,t)=>{t[Y]="running",this._options.onUpdate()},onTestEnd:(e,t)=>{e.outcome()==="skipped"?++this.progress.skipped:e.outcome()==="unexpected"?++this.progress.failed:++this.progress.passed,t[Y]=t.status,this._options.onUpdate()},onError:e=>this._handleOnError(e),printsToStdio:()=>!1}}processGlobalReport(e){const t=new se({version:()=>"v2",onConfigure:s=>{this.config=s},onError:s=>this._handleOnError(s)});for(const s of e)t.dispatch(s)}processListReport(e){var s;const t=((s=this.rootSuite)==null?void 0:s.allTests())||[];this._testResultsSnapshot=new Map(t.map(r=>[r.id,r.results])),this._receiver.reset();for(const r of e)this._receiver.dispatch(r)}processTestReportEvent(e){var t,s,r;(s=(t=this._lastRunReceiver)==null?void 0:t.dispatch(e))==null||s.catch(()=>{}),(r=this._receiver.dispatch(e))==null||r.catch(()=>{})}_handleOnError(e){var t,s;this.loadErrors.push(e),(s=(t=this._options).onError)==null||s.call(t,e),this._options.onUpdate()}asModel(){return{rootSuite:this.rootSuite||new q("","root"),config:this.config,loadErrors:this.loadErrors,progress:this.progress}}}const nt=({source:i})=>{const[e,t]=Me(),[s,r]=V.useState(De()),[c]=V.useState(Le(()=>import("./assets/xtermModule-BeNbaIVa.js"),__vite__mapDeps([0,1]),import.meta.url).then(m=>m.default)),a=V.useRef(null);return V.useEffect(()=>(Fe(r),()=>Oe(r)),[]),V.useEffect(()=>{const m=i.write,l=i.clear;return(async()=>{const{Terminal:_,FitAddon:n}=await c,f=t.current;if(!f)return;const S=s==="dark-mode"?lt:at;if(a.current&&a.current.terminal.options.theme===S)return;a.current&&(f.textContent="");const d=new _({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"var(--vscode-editor-font-family)",theme:S}),p=new n;d.loadAddon(p);for(const x of i.pending)d.write(x);i.write=x=>{i.pending.push(x),d.write(x)},i.clear=()=>{i.pending=[],d.clear()},d.open(f),p.fit(),a.current={terminal:d,fitAddon:p}})(),()=>{i.clear=l,i.write=m}},[c,a,t,i,s]),V.useEffect(()=>{setTimeout(()=>{a.current&&(a.current.fitAddon.fit(),i.resize(a.current.terminal.cols,a.current.terminal.rows))},250)},[e,i]),o.jsx("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:t})},at={foreground:"#383a42",background:"#fafafa",cursor:"#383a42",black:"#000000",red:"#e45649",green:"#50a14f",yellow:"#c18401",blue:"#4078f2",magenta:"#a626a4",cyan:"#0184bc",white:"#a0a0a0",brightBlack:"#000000",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#d19a66",brightBlue:"#4078f2",brightMagenta:"#a626a4",brightCyan:"#0184bc",brightWhite:"#383a42",selectionBackground:"#d7d7d7",selectionForeground:"#383a42"},lt={foreground:"#f8f8f2",background:"#1e1e1e",cursor:"#f8f8f0",black:"#000000",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#bfbfbf",brightBlack:"#4d4d4d",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#e6e6e6",selectionBackground:"#44475a",selectionForeground:"#f8f8f2"},ct=({filterText:i,setFilterText:e,statusFilters:t,setStatusFilters:s,projectFilters:r,setProjectFilters:c,testModel:a,runTests:m})=>{const[l,_]=h.useState(!1),n=h.useRef(null);h.useEffect(()=>{var d;(d=n.current)==null||d.focus()},[]);const f=[...t.entries()].filter(([d,p])=>p).map(([d])=>d).join(" ")||"all",S=[...r.entries()].filter(([d,p])=>p).map(([d])=>d).join(" ")||"all";return o.jsxs("div",{className:"filters",children:[o.jsx(Ye,{expanded:l,setExpanded:_,title:o.jsx("input",{ref:n,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:i,onChange:d=>{e(d.target.value)},onKeyDown:d=>{d.key==="Enter"&&m()}})}),o.jsxs("div",{className:"filter-summary",title:"Status: "+f+`
|
|
3
3
|
Projects: `+S,onClick:()=>_(!l),children:[o.jsx("span",{className:"filter-label",children:"Status:"})," ",f,o.jsx("span",{className:"filter-label",children:"Projects:"})," ",S]}),l&&o.jsxs("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[o.jsx("div",{className:"filter-list",children:[...t.entries()].map(([d,p])=>o.jsx("div",{className:"filter-entry",children:o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:p,onClick:()=>{const x=new Map(t);x.set(d,!x.get(d)),s(x)}}),o.jsx("div",{children:d})]})},d))}),o.jsx("div",{className:"filter-list",children:[...r.entries()].map(([d,p])=>o.jsx("div",{className:"filter-entry",children:o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:p,onClick:()=>{var E;const x=new Map(r);x.set(d,!x.get(d)),c(x);const R=(E=a==null?void 0:a.config)==null?void 0:E.configFile;R&&me.setObject(R+":projects",[...x.entries()].filter(([I,W])=>W).map(([I])=>I))}}),o.jsx("div",{children:d||"untitled"})]})},d))})]})]})},dt=({tag:i,style:e,onClick:t})=>o.jsx("span",{className:re("tag",`tag-color-${ut(i)}`),onClick:t,style:{margin:"6px 0 0 6px",...e},title:`Click to filter by tag: ${i}`,children:i});function ut(i){let e=0;for(let t=0;t<i.length;t++)e=i.charCodeAt(t)+((e<<8)-e);return Math.abs(e%6)}const ht=Xe,ft=({filterText:i,testModel:e,testServerConnection:t,testTree:s,runTests:r,runningState:c,watchAll:a,watchedTreeIds:m,setWatchedTreeIds:l,isLoading:_,onItemSelected:n,requestedCollapseAllCount:f,setFilterText:S,onRevealSource:d})=>{const[p,x]=h.useState({expandedItems:new Map}),[R,E]=h.useState(),[I,W]=h.useState(f);h.useEffect(()=>{if(I!==f){p.expandedItems.clear();for(const b of s.flatTreeItems())p.expandedItems.set(b.id,!1);W(f),E(void 0),x({...p});return}if(!c||c.itemSelectedByUser)return;let u;const B=b=>{var L;b.children.forEach(B),!u&&b.status==="failed"&&(b.kind==="test"&&c.testIds.has(b.test.id)||b.kind==="case"&&c.testIds.has((L=b.tests[0])==null?void 0:L.id))&&(u=b)};B(s.rootItem),u&&E(u.id)},[c,E,s,I,W,f,p,x]);const{selectedTreeItem:D}=h.useMemo(()=>{if(!e)return{selectedTreeItem:void 0};const u=R?s.treeItemById(R):void 0,B=pt(u,e);let b;return(u==null?void 0:u.kind)==="test"?b=u.test:(u==null?void 0:u.kind)==="case"&&u.tests.length===1&&(b=u.tests[0]),n({treeItem:u,testCase:b,testFile:B}),{selectedTreeItem:u}},[n,R,e,s]);h.useEffect(()=>{if(!_)if(a)t==null||t.watchNoReply({fileNames:s.fileNames()});else{const u=new Set;for(const B of m.value){const b=s.treeItemById(B),L=b==null?void 0:b.location.file;L&&u.add(L)}t==null||t.watchNoReply({fileNames:[...u]})}},[_,s,a,m,t]);const K=u=>{E(u.id),r("bounce-if-busy",s.collectTestIds(u))},N=(u,B)=>{if(u.preventDefault(),u.stopPropagation(),u.metaKey||u.ctrlKey){const b=i.split(" ");b.includes(B)?S(b.filter(L=>L!==B).join(" ").trim()):S((i+" "+B).trim())}else S((i.split(" ").filter(b=>!b.startsWith("@")).join(" ")+" "+B).trim())};return o.jsx(ht,{name:"tests",treeState:p,setTreeState:x,rootItem:s.rootItem,dataTestId:"test-tree",render:u=>o.jsxs("div",{className:"hbox ui-mode-list-item",children:[o.jsxs("div",{className:"ui-mode-list-item-title",children:[o.jsx("span",{title:u.title,children:u.title}),u.kind==="case"?u.tags.map(B=>o.jsx(dt,{tag:B.slice(1),onClick:b=>N(b,B)},B)):null]}),!!u.duration&&u.status!=="skipped"&&o.jsx("div",{className:"ui-mode-list-item-time",children:We(u.duration)}),o.jsxs($,{noMinHeight:!0,noShadow:!0,children:[o.jsx(M,{icon:"play",title:"Run",onClick:()=>K(u),disabled:!!c&&!c.completed}),o.jsx(M,{icon:"go-to-file",title:"Show source",onClick:d,style:u.kind==="group"&&u.subKind==="folder"?{visibility:"hidden"}:{}}),!a&&o.jsx(M,{icon:"eye",title:"Watch",onClick:()=>{m.value.has(u.id)?m.value.delete(u.id):m.value.add(u.id),l({...m})},toggled:m.value.has(u.id)})]})]}),icon:u=>Qe(u.status),selectedItem:D,onAccepted:K,onSelected:u=>{c&&(c.itemSelectedByUser=!0),E(u.id)},isError:u=>u.kind==="group"?u.hasLoadErrors:!1,autoExpandDepth:i?5:1,noItemsMessage:_?"Loading…":"No tests"})};function pt(i,e){if(!(!i||!e))return{file:i.location.file,line:i.location.line,column:i.location.column,source:{errors:e.loadErrors.filter(t=>{var s;return((s=t.location)==null?void 0:s.file)===i.location.file}).map(t=>({line:t.location.line,message:t.message})),content:void 0}}}function gt(i){return`.playwright-artifacts-${i}`}const mt=({item:i,rootDir:e,onOpenExternally:t,revealSource:s,pathSeparator:r})=>{var f,S;const[c,a]=h.useState(),[m,l]=h.useState(0),_=h.useRef(null),{outputDir:n}=h.useMemo(()=>({outputDir:i.testCase?_t(i.testCase):void 0}),[i]);return h.useEffect(()=>{var R,E;_.current&&clearTimeout(_.current);const d=(R=i.testCase)==null?void 0:R.results[0];if(!d){a(void 0);return}const p=d&&d.duration>=0&&d.attachments.find(I=>I.name==="trace");if(p&&p.path){fe(p.path).then(I=>a({model:I,isLive:!1}));return}if(!n){a(void 0);return}const x=[n,gt(d.workerIndex),"traces",`${(E=i.testCase)==null?void 0:E.id}.json`].join(r);return _.current=setTimeout(async()=>{try{const I=await fe(x);a({model:I,isLive:!0})}catch{a(void 0)}finally{l(m+1)}},500),()=>{_.current&&clearTimeout(_.current)}},[n,i,a,m,l,r]),o.jsx(Ge,{model:c==null?void 0:c.model,showSourcesFirst:!0,rootDir:e,fallbackLocation:i.testFile,isLive:c==null?void 0:c.isLive,status:(f=i.treeItem)==null?void 0:f.status,annotations:((S=i.testCase)==null?void 0:S.annotations)||[],onOpenExternally:t,revealSource:s},"workbench")},_t=i=>{var e;for(let t=i.parent;t;t=t.parent)if(t.project())return(e=t.project())==null?void 0:e.outputDir};async function fe(i){const e=new URLSearchParams;e.set("trace",i),e.set("limit","1");const s=await(await fetch(`contexts?${e.toString()}`)).json();return new Ue(s)}const wt=({settings:i})=>o.jsx("div",{className:"vbox settings-view",children:i.map(({value:e,set:t,title:s})=>o.jsx("div",{className:"setting",children:o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e,onClick:()=>t(!e)}),s]})},s))});let pe={cols:80,rows:24};const A={pending:[],clear:()=>{},write:i=>A.pending.push(i),resize:()=>{}},O=new URLSearchParams(window.location.search),vt=O.get("ws"),we=new URL(`../${vt}`,window.location.toString());we.protocol=window.location.protocol==="https:"?"wss:":"ws:";const y={args:O.getAll("arg"),grep:O.get("grep")||void 0,grepInvert:O.get("grepInvert")||void 0,projects:O.getAll("project"),workers:O.get("workers")||void 0,headed:O.has("headed"),updateSnapshots:O.get("updateSnapshots")||void 0,reporters:O.has("reporter")?O.getAll("reporter"):void 0,pathSeparator:O.get("pathSeparator")||"/"};y.updateSnapshots&&!["all","none","missing"].includes(y.updateSnapshots)&&(y.updateSnapshots=void 0);const ge=navigator.platform==="MacIntel",St=({})=>{var he;const[i,e]=h.useState(""),[t,s]=h.useState(!1),[r,c]=h.useState(!1),[a,m]=h.useState(new Map([["passed",!1],["failed",!1],["skipped",!1]])),[l,_]=h.useState(new Map),[n,f]=h.useState(),[S,d]=h.useState(),[p,x]=h.useState({}),[R,E]=h.useState(new Set),[I,W]=h.useState(!1),[D,K]=h.useState(),N=D&&!D.completed,[u,B]=Ae("watch-all",!1),[b,L]=h.useState({value:new Set}),H=h.useRef(Promise.resolve()),Q=h.useRef(new Set),[oe,ve]=h.useState(0),[Se,xe]=h.useState(!1),[ne,ae]=h.useState(!0),[v,be]=h.useState(),[X,Te]=h.useState(),[G,ke]=h.useState(!1);h.useState(!1);const[je,le]=h.useState(!1),ye=h.useCallback(()=>le(!0),[le]),Ee=!1,[ce,xt]=h.useState(!1),[de,bt]=h.useState(!1),[ue,Tt]=h.useState(!1),[Ie,Re]=ze(),Be=h.useRef(null),J=h.useCallback(()=>{be(new $e(new qe(we)))},[]);h.useEffect(()=>{var w;(w=Be.current)==null||w.focus(),W(!0),J()},[J]),h.useEffect(()=>{if(!v)return;const w=[v.onStdio(g=>{if(g.buffer){const T=atob(g.buffer);A.write(T)}else A.write(g.text);g.type==="stderr"&&c(!0)}),v.onClose(()=>xe(!0))];return A.resize=(g,T)=>{pe={cols:g,rows:T},v.resizeTerminalNoReply({cols:g,rows:T})},()=>{for(const g of w)g.dispose()}},[v]),h.useEffect(()=>{if(!v)return;let w;const g=new ot({onUpdate:T=>{clearTimeout(w),w=void 0,T?f(g.asModel()):w||(w=setTimeout(()=>{f(g.asModel())},250))},onError:T=>{A.write((T.stack||T.value||"")+`
|
|
4
4
|
`),c(!0)},pathSeparator:y.pathSeparator});return Te(g),f(void 0),W(!0),L({value:new Set}),(async()=>{try{await v.initialize({interceptStdio:!0,watchTestDirs:!0});const{status:T,report:j}=await v.runGlobalSetup({});if(g.processGlobalReport(j),T!=="passed")return;const C=await v.listTests({projects:y.projects,locations:y.args,grep:y.grep,grepInvert:y.grepInvert});g.processListReport(C.report),v.onReport(P=>{g.processTestReportEvent(P)});const{hasBrowsers:F}=await v.checkBrowsers({});ae(F)}finally{W(!1)}})(),()=>{clearTimeout(w)}},[v]),h.useEffect(()=>{if(!n)return;const{config:w,rootSuite:g}=n,T=w.configFile?me.getObject(w.configFile+":projects",void 0):void 0,j=new Map(l);for(const C of j.keys())g.suites.find(F=>F.title===C)||j.delete(C);for(const C of g.suites)j.has(C.title)||j.set(C.title,!!(T!=null&&T.includes(C.title)));!T&&j.size&&![...j.values()].includes(!0)&&j.set(j.entries().next().value[0],!0),(l.size!==j.size||[...l].some(([C,F])=>j.get(C)!==F))&&_(j)},[l,n]),h.useEffect(()=>{N&&(n!=null&&n.progress)?d(n.progress):n||d(void 0)},[n,N]);const{testTree:Ce}=h.useMemo(()=>{if(!n)return{testTree:new ie("",new q("","root"),[],l,y.pathSeparator)};const w=new ie("",n.rootSuite,n.loadErrors,l,y.pathSeparator);return w.filterTree(i,a,N?D==null?void 0:D.testIds:void 0),w.sortAndPropagateStatus(),w.shortenRoot(),w.flattenForSingleProject(),E(w.testIds()),{testTree:w}},[i,n,a,l,E,D,N]),z=h.useCallback((w,g)=>{!v||!n||w==="bounce-if-busy"&&N||(Q.current=new Set([...Q.current,...g]),H.current=H.current.then(async()=>{var C,F,P;const T=Q.current;if(Q.current=new Set,!T.size)return;{for(const k of((C=n.rootSuite)==null?void 0:C.allTests())||[])if(T.has(k.id)){k.results=[];const U=k._createTestResult("pending");U[Y]="scheduled"}f({...n})}const j=" ["+new Date().toLocaleTimeString()+"]";A.write("\x1B[2m—".repeat(Math.max(0,pe.cols-j.length))+j+"\x1B[22m"),d({total:0,passed:0,failed:0,skipped:0}),K({testIds:T}),await v.runTests({locations:y.args,grep:y.grep,grepInvert:y.grepInvert,testIds:[...T],projects:[...l].filter(([k,U])=>U).map(([k])=>k),...ce?{workers:"1"}:{},...de?{headed:!0}:{},...ue?{updateSnapshots:"all"}:{},reporters:y.reporters,trace:"on"});for(const k of((F=n.rootSuite)==null?void 0:F.allTests())||[])((P=k.results[0])==null?void 0:P.duration)===-1&&(k.results=[]);f({...n}),K(k=>k?{...k,completed:!0}:void 0)}))},[l,N,n,v,ce,de,ue]);h.useEffect(()=>{if(!v||!X)return;const w=v.onTestFilesChanged(async g=>{if(H.current=H.current.then(async()=>{W(!0);try{const P=await v.listTests({projects:y.projects,locations:y.args,grep:y.grep,grepInvert:y.grepInvert});X.processListReport(P.report)}catch(P){console.log(P)}finally{W(!1)}}),await H.current,g.testFiles.length===0)return;const T=X.asModel(),j=new ie("",T.rootSuite,T.loadErrors,l,y.pathSeparator),C=[],F=new Set(g.testFiles);if(u){const P=k=>{const U=k.location.file;U&&F.has(U)&&C.push(...j.collectTestIds(k)),k.kind==="group"&&k.subKind==="folder"&&k.children.forEach(P)};P(j.rootItem)}else for(const P of b.value){const k=j.treeItemById(P),U=k==null?void 0:k.location.file;U&&F.has(U)&&C.push(...j.collectTestIds(k))}z("queue-if-busy",new Set(C))});return()=>w.dispose()},[z,v,u,b,X,l]),h.useEffect(()=>{if(!v)return;const w=g=>{g.code==="Backquote"&&g.ctrlKey?(g.preventDefault(),s(!t)):g.code==="F5"&&g.shiftKey?(g.preventDefault(),v==null||v.stopTestsNoReply({})):g.code==="F5"&&(g.preventDefault(),z("bounce-if-busy",R))};return addEventListener("keydown",w),()=>{removeEventListener("keydown",w)}},[z,J,v,R,t]);const ee=h.useRef(null),Ne=h.useCallback(w=>{var g;w.preventDefault(),w.stopPropagation(),(g=ee.current)==null||g.showModal()},[]),te=h.useCallback(w=>{var g;w.preventDefault(),w.stopPropagation(),(g=ee.current)==null||g.close()},[]),Pe=h.useCallback(w=>{te(w),s(!0),v==null||v.installBrowsers({}).then(async()=>{s(!1);const{hasBrowsers:g}=await(v==null?void 0:v.checkBrowsers({}));ae(g)})},[te,v]);return o.jsxs("div",{className:"vbox ui-mode",children:[!ne&&o.jsxs("dialog",{ref:ee,children:[o.jsxs("div",{className:"title",children:[o.jsx("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),o.jsxs("div",{className:"body",children:["Playwright did not find installed browsers.",o.jsx("br",{}),"Would you like to run `playwright install`?",o.jsx("br",{}),o.jsx("button",{className:"button",onClick:Pe,children:"Install"}),o.jsx("button",{className:"button secondary",onClick:te,children:"Dismiss"})]})]}),Se&&o.jsxs("div",{className:"disconnected",children:[o.jsx("div",{className:"title",children:"UI Mode disconnected"}),o.jsxs("div",{children:[o.jsx("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),o.jsx(Ve,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",main:o.jsxs("div",{className:"vbox",children:[o.jsxs("div",{className:re("vbox",!t&&"hidden"),children:[o.jsxs($,{children:[o.jsx("div",{className:"section-title",style:{flex:"none"},children:"Output"}),o.jsx(M,{icon:"circle-slash",title:"Clear output",onClick:()=>{A.clear(),c(!1)}}),o.jsx("div",{className:"spacer"}),o.jsx(M,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),o.jsx(nt,{source:A})]}),o.jsx("div",{className:re("vbox",t&&"hidden"),children:o.jsx(mt,{pathSeparator:y.pathSeparator,item:p,rootDir:(he=n==null?void 0:n.config)==null?void 0:he.rootDir,revealSource:je,onOpenExternally:w=>v==null?void 0:v.openNoReply({location:{file:w.file,line:w.line,column:w.column}})})})]}),sidebar:o.jsxs("div",{className:"vbox ui-mode-sidebar",children:[o.jsxs($,{noShadow:!0,noMinHeight:!0,children:[o.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),o.jsx("div",{className:"section-title",children:"Playwright"}),o.jsx(M,{icon:"refresh",title:"Reload",onClick:()=>J(),disabled:N||I}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx(M,{icon:"terminal",title:"Toggle output — "+(ge?"⌃`":"Ctrl + `"),toggled:t,onClick:()=>{s(!t)}}),r&&o.jsx("div",{title:"Output contains error",style:{position:"absolute",top:2,right:2,width:7,height:7,borderRadius:"50%",backgroundColor:"var(--vscode-notificationsErrorIcon-foreground)"}})]}),!ne&&o.jsx(M,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:Ne})]}),o.jsx(ct,{filterText:i,setFilterText:e,statusFilters:a,setStatusFilters:m,projectFilters:l,setProjectFilters:_,testModel:n,runTests:()=>z("bounce-if-busy",R)}),o.jsxs($,{noMinHeight:!0,children:[!N&&!S&&o.jsx("div",{className:"section-title",children:"Tests"}),!N&&S&&o.jsx("div",{"data-testid":"status-line",className:"status-line",children:o.jsxs("div",{children:[S.passed,"/",S.total," passed (",S.passed/S.total*100|0,"%)"]})}),N&&S&&o.jsx("div",{"data-testid":"status-line",className:"status-line",children:o.jsxs("div",{children:["Running ",S.passed,"/",D.testIds.size," passed (",S.passed/D.testIds.size*100|0,"%)"]})}),o.jsx(M,{icon:"play",title:"Run all — F5",onClick:()=>z("bounce-if-busy",R),disabled:N||I}),o.jsx(M,{icon:"debug-stop",title:"Stop — "+(ge?"⇧F5":"Shift + F5"),onClick:()=>v==null?void 0:v.stopTests({}),disabled:!N||I}),o.jsx(M,{icon:"eye",title:"Watch all",toggled:u,onClick:()=>{L({value:new Set}),B(!u)}}),o.jsx(M,{icon:"collapse-all",title:"Collapse all",onClick:()=>{ve(oe+1)}})]}),o.jsx(ft,{filterText:i,testModel:n,testTree:Ce,testServerConnection:v,runningState:D,runTests:z,onItemSelected:x,watchAll:u,watchedTreeIds:b,setWatchedTreeIds:L,isLoading:I,requestedCollapseAllCount:oe,setFilterText:e,onRevealSource:ye}),Ee,o.jsxs($,{noShadow:!0,noMinHeight:!0,className:"settings-toolbar",onClick:()=>ke(!G),children:[o.jsx("span",{className:`codicon codicon-${G?"chevron-down":"chevron-right"}`,style:{marginLeft:5},title:G?"Hide Settings":"Show Settings"}),o.jsx("div",{className:"section-title",children:"Settings"})]}),G&&o.jsx(wt,{settings:[{value:Ie,set:Re,title:"Dark mode"}]})]})})]})};(async()=>{if(Ke(),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.
|
|
5
5
|
Make sure to serve the website (${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)}He(document.querySelector("#root")).render(o.jsx(St,{}))})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/xtermModule-
|
|
2
|
-
import { u as useMeasure, r as reactExports, b as currentTheme, _ as __vitePreload, d as addThemeListener, e as removeThemeListener, j as jsxRuntimeExports, R as React, s as settings, f as clsx, m as msToString, g as Toolbar, T as ToolbarButton, M as MultiTraceModel, h as useSetting, S as SplitView, a as applyTheme, c as
|
|
3
|
-
import { T as TestServerConnection, W as WebSocketTestServerTransport
|
|
4
|
-
import { E as Expandable,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/xtermModule-DZP0glxx.js","./xtermModule.4oRVGWQ-.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { u as useMeasure, r as reactExports, b as currentTheme, _ as __vitePreload, d as addThemeListener, e as removeThemeListener, j as jsxRuntimeExports, R as React, s as settings, f as clsx, m as msToString, g as Toolbar, T as ToolbarButton, M as MultiTraceModel, h as useSetting, i as useDarkModeSetting, S as SplitView, a as applyTheme, c as createRoot } from "./assets/inspectorTab-DOc4D3cX.js";
|
|
3
|
+
import { T as TestServerConnection, W as WebSocketTestServerTransport } from "./assets/testServerConnection-D-tXL3sj.js";
|
|
4
|
+
import { E as Expandable, t as testStatusIcon, T as TreeView, W as Workbench } from "./assets/workbench-DNolpp3y.js";
|
|
5
5
|
var define_process_env_default = {};
|
|
6
6
|
class TeleReporterReceiver {
|
|
7
7
|
constructor(reporter, options = {}) {
|
|
@@ -111,7 +111,7 @@ class TeleReporterReceiver {
|
|
|
111
111
|
const result = test.results.find((r) => r._id === resultId);
|
|
112
112
|
const parentStep = payload.parentStepId ? result._stepMap.get(payload.parentStepId) : void 0;
|
|
113
113
|
const location = this._absoluteLocation(payload.location);
|
|
114
|
-
const step = new TeleTestStep(payload, parentStep, location
|
|
114
|
+
const step = new TeleTestStep(payload, parentStep, location);
|
|
115
115
|
if (parentStep)
|
|
116
116
|
parentStep.steps.push(step);
|
|
117
117
|
else
|
|
@@ -124,7 +124,6 @@ class TeleReporterReceiver {
|
|
|
124
124
|
const test = this._tests.get(testId);
|
|
125
125
|
const result = test.results.find((r) => r._id === resultId);
|
|
126
126
|
const step = result._stepMap.get(payload.id);
|
|
127
|
-
step._endPayload = payload;
|
|
128
127
|
step.duration = payload.duration;
|
|
129
128
|
step.error = payload.error;
|
|
130
129
|
(_b = (_a = this._reporter).onStepEnd) == null ? void 0 : _b.call(_a, test, result, step);
|
|
@@ -184,7 +183,7 @@ class TeleReporterReceiver {
|
|
|
184
183
|
dependencies: project.dependencies,
|
|
185
184
|
teardown: project.teardown,
|
|
186
185
|
snapshotDir: this._absolutePath(project.snapshotDir),
|
|
187
|
-
use:
|
|
186
|
+
use: {}
|
|
188
187
|
};
|
|
189
188
|
}
|
|
190
189
|
_parseAttachments(attachments) {
|
|
@@ -328,7 +327,7 @@ class TeleTestCase {
|
|
|
328
327
|
}
|
|
329
328
|
}
|
|
330
329
|
class TeleTestStep {
|
|
331
|
-
constructor(payload, parentStep, location
|
|
330
|
+
constructor(payload, parentStep, location) {
|
|
332
331
|
this.duration = -1;
|
|
333
332
|
this.steps = [];
|
|
334
333
|
this._startTime = 0;
|
|
@@ -337,7 +336,6 @@ class TeleTestStep {
|
|
|
337
336
|
this.location = location;
|
|
338
337
|
this.parent = parentStep;
|
|
339
338
|
this._startTime = payload.startTime;
|
|
340
|
-
this._result = result;
|
|
341
339
|
}
|
|
342
340
|
titlePath() {
|
|
343
341
|
var _a;
|
|
@@ -350,14 +348,6 @@ class TeleTestStep {
|
|
|
350
348
|
set startTime(value) {
|
|
351
349
|
this._startTime = +value;
|
|
352
350
|
}
|
|
353
|
-
get attachments() {
|
|
354
|
-
var _a, _b;
|
|
355
|
-
return ((_b = (_a = this._endPayload) == null ? void 0 : _a.attachments) == null ? void 0 : _b.map((index) => this._result.attachments[index])) ?? [];
|
|
356
|
-
}
|
|
357
|
-
get annotations() {
|
|
358
|
-
var _a;
|
|
359
|
-
return ((_a = this._endPayload) == null ? void 0 : _a.annotations) ?? [];
|
|
360
|
-
}
|
|
361
351
|
}
|
|
362
352
|
class TeleTestResult {
|
|
363
353
|
constructor(retry, id) {
|
|
@@ -398,17 +388,12 @@ const baseFullConfig = {
|
|
|
398
388
|
preserveOutput: "always",
|
|
399
389
|
projects: [],
|
|
400
390
|
reporter: [[define_process_env_default.CI ? "dot" : "list"]],
|
|
401
|
-
reportSlowTests: {
|
|
402
|
-
max: 5,
|
|
403
|
-
threshold: 3e5
|
|
404
|
-
/* 5 minutes */
|
|
405
|
-
},
|
|
391
|
+
reportSlowTests: { max: 5, threshold: 15e3 },
|
|
406
392
|
configFile: "",
|
|
407
393
|
rootDir: "",
|
|
408
394
|
quiet: false,
|
|
409
395
|
shard: null,
|
|
410
396
|
updateSnapshots: "missing",
|
|
411
|
-
updateSourceMethod: "patch",
|
|
412
397
|
version: "",
|
|
413
398
|
workers: 0,
|
|
414
399
|
webServer: null
|
|
@@ -464,18 +449,15 @@ class TestTree {
|
|
|
464
449
|
this._treeItemById.set(rootFolder, this.rootItem);
|
|
465
450
|
const visitSuite = (project, parentSuite, parentGroup) => {
|
|
466
451
|
for (const suite of parentSuite.suites) {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
continue;
|
|
470
|
-
}
|
|
471
|
-
let group = parentGroup.children.find((item) => item.kind === "group" && item.title === suite.title);
|
|
452
|
+
const title = suite.title || "<anonymous>";
|
|
453
|
+
let group = parentGroup.children.find((item) => item.kind === "group" && item.title === title);
|
|
472
454
|
if (!group) {
|
|
473
455
|
group = {
|
|
474
456
|
kind: "group",
|
|
475
457
|
subKind: "describe",
|
|
476
|
-
id: "suite:" + parentSuite.titlePath().join("") + "" +
|
|
458
|
+
id: "suite:" + parentSuite.titlePath().join("") + "" + title,
|
|
477
459
|
// account for anonymous suites
|
|
478
|
-
title
|
|
460
|
+
title,
|
|
479
461
|
location: suite.location,
|
|
480
462
|
duration: 0,
|
|
481
463
|
parent: parentGroup,
|
|
@@ -835,7 +817,7 @@ const XtermWrapper = ({
|
|
|
835
817
|
}) => {
|
|
836
818
|
const [measure, xtermElement] = useMeasure();
|
|
837
819
|
const [theme, setTheme] = reactExports.useState(currentTheme());
|
|
838
|
-
const [modulePromise] = reactExports.useState(__vitePreload(() => import("./assets/xtermModule-
|
|
820
|
+
const [modulePromise] = reactExports.useState(__vitePreload(() => import("./assets/xtermModule-DZP0glxx.js"), true ? __vite__mapDeps([0,1]) : void 0, import.meta.url).then((m) => m.default));
|
|
839
821
|
const terminal = reactExports.useRef(null);
|
|
840
822
|
reactExports.useEffect(() => {
|
|
841
823
|
addThemeListener(setTheme);
|
|
@@ -981,9 +963,9 @@ const FiltersView = ({ filterText, setFilterText, statusFilters, setStatusFilter
|
|
|
981
963
|
projectsLine
|
|
982
964
|
] }),
|
|
983
965
|
expanded && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "hbox", style: { marginLeft: 14, maxHeight: 200, overflowY: "auto" }, children: [
|
|
984
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "filter-list",
|
|
985
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "filter-entry",
|
|
986
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "checkbox", checked: value,
|
|
966
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "filter-list", children: [...statusFilters.entries()].map(([status, value]) => {
|
|
967
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "filter-entry", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
|
|
968
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "checkbox", checked: value, onClick: () => {
|
|
987
969
|
const copy = new Map(statusFilters);
|
|
988
970
|
copy.set(status, !copy.get(status));
|
|
989
971
|
setStatusFilters(copy);
|
|
@@ -991,9 +973,9 @@ const FiltersView = ({ filterText, setFilterText, statusFilters, setStatusFilter
|
|
|
991
973
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: status })
|
|
992
974
|
] }) }, status);
|
|
993
975
|
}) }),
|
|
994
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "filter-list",
|
|
995
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "filter-entry",
|
|
996
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "checkbox", checked: value,
|
|
976
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "filter-list", children: [...projectFilters.entries()].map(([projectName, value]) => {
|
|
977
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "filter-entry", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
|
|
978
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "checkbox", checked: value, onClick: () => {
|
|
997
979
|
var _a;
|
|
998
980
|
const copy = new Map(projectFilters);
|
|
999
981
|
copy.set(projectName, !copy.get(projectName));
|
|
@@ -1027,11 +1009,10 @@ function tagNameToColor(str) {
|
|
|
1027
1009
|
return Math.abs(hash % 6);
|
|
1028
1010
|
}
|
|
1029
1011
|
const TestTreeView = TreeView;
|
|
1030
|
-
const TestListView = ({ filterText, testModel, testServerConnection, testTree, runTests, runningState, watchAll, watchedTreeIds, setWatchedTreeIds, isLoading, onItemSelected, requestedCollapseAllCount,
|
|
1012
|
+
const TestListView = ({ filterText, testModel, testServerConnection, testTree, runTests, runningState, watchAll, watchedTreeIds, setWatchedTreeIds, isLoading, onItemSelected, requestedCollapseAllCount, setFilterText, onRevealSource }) => {
|
|
1031
1013
|
const [treeState, setTreeState] = React.useState({ expandedItems: /* @__PURE__ */ new Map() });
|
|
1032
1014
|
const [selectedTreeItemId, setSelectedTreeItemId] = React.useState();
|
|
1033
1015
|
const [collapseAllCount, setCollapseAllCount] = React.useState(requestedCollapseAllCount);
|
|
1034
|
-
const [expandAllCount, setExpandAllCount] = React.useState(requestedExpandAllCount);
|
|
1035
1016
|
React.useEffect(() => {
|
|
1036
1017
|
if (collapseAllCount !== requestedCollapseAllCount) {
|
|
1037
1018
|
treeState.expandedItems.clear();
|
|
@@ -1042,15 +1023,6 @@ const TestListView = ({ filterText, testModel, testServerConnection, testTree, r
|
|
|
1042
1023
|
setTreeState({ ...treeState });
|
|
1043
1024
|
return;
|
|
1044
1025
|
}
|
|
1045
|
-
if (expandAllCount !== requestedExpandAllCount) {
|
|
1046
|
-
treeState.expandedItems.clear();
|
|
1047
|
-
for (const item of testTree.flatTreeItems())
|
|
1048
|
-
treeState.expandedItems.set(item.id, true);
|
|
1049
|
-
setExpandAllCount(requestedExpandAllCount);
|
|
1050
|
-
setSelectedTreeItemId(void 0);
|
|
1051
|
-
setTreeState({ ...treeState });
|
|
1052
|
-
return;
|
|
1053
|
-
}
|
|
1054
1026
|
if (!runningState || runningState.itemSelectedByUser)
|
|
1055
1027
|
return;
|
|
1056
1028
|
let selectedTreeItem2;
|
|
@@ -1069,23 +1041,20 @@ const TestListView = ({ filterText, testModel, testServerConnection, testTree, r
|
|
|
1069
1041
|
visit(testTree.rootItem);
|
|
1070
1042
|
if (selectedTreeItem2)
|
|
1071
1043
|
setSelectedTreeItemId(selectedTreeItem2.id);
|
|
1072
|
-
}, [runningState, setSelectedTreeItemId, testTree, collapseAllCount, setCollapseAllCount, requestedCollapseAllCount,
|
|
1073
|
-
const selectedTreeItem = React.useMemo(() => {
|
|
1074
|
-
if (!selectedTreeItemId)
|
|
1075
|
-
return void 0;
|
|
1076
|
-
return testTree.treeItemById(selectedTreeItemId);
|
|
1077
|
-
}, [selectedTreeItemId, testTree]);
|
|
1078
|
-
React.useEffect(() => {
|
|
1044
|
+
}, [runningState, setSelectedTreeItemId, testTree, collapseAllCount, setCollapseAllCount, requestedCollapseAllCount, treeState, setTreeState]);
|
|
1045
|
+
const { selectedTreeItem } = React.useMemo(() => {
|
|
1079
1046
|
if (!testModel)
|
|
1080
|
-
return;
|
|
1081
|
-
const
|
|
1047
|
+
return { selectedTreeItem: void 0 };
|
|
1048
|
+
const selectedTreeItem2 = selectedTreeItemId ? testTree.treeItemById(selectedTreeItemId) : void 0;
|
|
1049
|
+
const testFile = itemLocation(selectedTreeItem2, testModel);
|
|
1082
1050
|
let selectedTest;
|
|
1083
|
-
if ((
|
|
1084
|
-
selectedTest =
|
|
1085
|
-
else if ((
|
|
1086
|
-
selectedTest =
|
|
1087
|
-
onItemSelected({ treeItem:
|
|
1088
|
-
|
|
1051
|
+
if ((selectedTreeItem2 == null ? void 0 : selectedTreeItem2.kind) === "test")
|
|
1052
|
+
selectedTest = selectedTreeItem2.test;
|
|
1053
|
+
else if ((selectedTreeItem2 == null ? void 0 : selectedTreeItem2.kind) === "case" && selectedTreeItem2.tests.length === 1)
|
|
1054
|
+
selectedTest = selectedTreeItem2.tests[0];
|
|
1055
|
+
onItemSelected({ treeItem: selectedTreeItem2, testCase: selectedTest, testFile });
|
|
1056
|
+
return { selectedTreeItem: selectedTreeItem2 };
|
|
1057
|
+
}, [onItemSelected, selectedTreeItemId, testModel, testTree]);
|
|
1089
1058
|
React.useEffect(() => {
|
|
1090
1059
|
if (isLoading)
|
|
1091
1060
|
return;
|
|
@@ -1128,15 +1097,12 @@ const TestListView = ({ filterText, testModel, testServerConnection, testTree, r
|
|
|
1128
1097
|
rootItem: testTree.rootItem,
|
|
1129
1098
|
dataTestId: "test-tree",
|
|
1130
1099
|
render: (treeItem) => {
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "hbox ui-mode-tree-item", "aria-labelledby": `${labelId} ${timeId}`, children: [
|
|
1135
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id: labelId, className: "ui-mode-tree-item-title", children: [
|
|
1136
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: treeItem.title }),
|
|
1100
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "hbox ui-mode-list-item", children: [
|
|
1101
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ui-mode-list-item-title", children: [
|
|
1102
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { title: treeItem.title, children: treeItem.title }),
|
|
1137
1103
|
treeItem.kind === "case" ? treeItem.tags.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx(TagView, { tag: tag.slice(1), onClick: (e) => handleTagClick(e, tag) }, tag)) : null
|
|
1138
1104
|
] }),
|
|
1139
|
-
!!treeItem.duration && treeItem.status !== "skipped" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
1105
|
+
!!treeItem.duration && treeItem.status !== "skipped" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ui-mode-list-item-time", children: msToString(treeItem.duration) }),
|
|
1140
1106
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Toolbar, { noMinHeight: true, noShadow: true, children: [
|
|
1141
1107
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "play", title: "Run", onClick: () => runTreeItem(treeItem), disabled: !!runningState && !runningState.completed }),
|
|
1142
1108
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "go-to-file", title: "Show source", onClick: onRevealSource, style: treeItem.kind === "group" && treeItem.subKind === "folder" ? { visibility: "hidden" } : {} }),
|
|
@@ -1151,7 +1117,6 @@ const TestListView = ({ filterText, testModel, testServerConnection, testTree, r
|
|
|
1151
1117
|
] });
|
|
1152
1118
|
},
|
|
1153
1119
|
icon: (treeItem) => testStatusIcon(treeItem.status),
|
|
1154
|
-
title: (treeItem) => treeItem.title,
|
|
1155
1120
|
selectedItem: selectedTreeItem,
|
|
1156
1121
|
onAccepted: runTreeItem,
|
|
1157
1122
|
onSelected: (treeItem) => {
|
|
@@ -1264,7 +1229,15 @@ async function loadSingleTraceFile(url) {
|
|
|
1264
1229
|
const contextEntries = await response.json();
|
|
1265
1230
|
return new MultiTraceModel(contextEntries);
|
|
1266
1231
|
}
|
|
1267
|
-
|
|
1232
|
+
const SettingsView = ({ settings: settings2 }) => {
|
|
1233
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vbox settings-view", children: settings2.map(({ value, set, title }) => {
|
|
1234
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "setting", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
|
|
1235
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "checkbox", checked: value, onClick: () => set(!value) }),
|
|
1236
|
+
title
|
|
1237
|
+
] }) }, title);
|
|
1238
|
+
}) });
|
|
1239
|
+
};
|
|
1240
|
+
let xtermSize = { cols: 80, rows: 24 };
|
|
1268
1241
|
const xtermDataSource = {
|
|
1269
1242
|
pending: [],
|
|
1270
1243
|
clear: () => {
|
|
@@ -1274,9 +1247,9 @@ const xtermDataSource = {
|
|
|
1274
1247
|
}
|
|
1275
1248
|
};
|
|
1276
1249
|
const searchParams = new URLSearchParams(window.location.search);
|
|
1277
|
-
const
|
|
1278
|
-
const wsURL = new URL(
|
|
1279
|
-
wsURL.protocol =
|
|
1250
|
+
const guid = searchParams.get("ws");
|
|
1251
|
+
const wsURL = new URL(`../${guid}`, window.location.toString());
|
|
1252
|
+
wsURL.protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
|
1280
1253
|
const queryParams = {
|
|
1281
1254
|
args: searchParams.getAll("arg"),
|
|
1282
1255
|
grep: searchParams.get("grep") || void 0,
|
|
@@ -1314,25 +1287,22 @@ const UIModeView = ({}) => {
|
|
|
1314
1287
|
const commandQueue = React.useRef(Promise.resolve());
|
|
1315
1288
|
const runTestBacklog = React.useRef(/* @__PURE__ */ new Set());
|
|
1316
1289
|
const [collapseAllCount, setCollapseAllCount] = React.useState(0);
|
|
1317
|
-
const [expandAllCount, setExpandAllCount] = React.useState(0);
|
|
1318
1290
|
const [isDisconnected, setIsDisconnected] = React.useState(false);
|
|
1319
1291
|
const [hasBrowsers, setHasBrowsers] = React.useState(true);
|
|
1320
1292
|
const [testServerConnection, setTestServerConnection] = React.useState();
|
|
1321
1293
|
const [teleSuiteUpdater, setTeleSuiteUpdater] = React.useState();
|
|
1322
1294
|
const [settingsVisible, setSettingsVisible] = React.useState(false);
|
|
1323
|
-
|
|
1295
|
+
React.useState(false);
|
|
1324
1296
|
const [revealSource, setRevealSource] = React.useState(false);
|
|
1325
1297
|
const onRevealSource = React.useCallback(() => setRevealSource(true), [setRevealSource]);
|
|
1326
1298
|
const showTestingOptions = false;
|
|
1327
1299
|
const [singleWorker, setSingleWorker] = React.useState(false);
|
|
1328
1300
|
const [showBrowser, setShowBrowser] = React.useState(false);
|
|
1329
1301
|
const [updateSnapshots, setUpdateSnapshots] = React.useState(false);
|
|
1302
|
+
const [darkMode, setDarkMode] = useDarkModeSetting();
|
|
1330
1303
|
const inputRef = React.useRef(null);
|
|
1331
1304
|
const reloadTests = React.useCallback(() => {
|
|
1332
|
-
setTestServerConnection((
|
|
1333
|
-
prevConnection == null ? void 0 : prevConnection.close();
|
|
1334
|
-
return new TestServerConnection(new WebSocketTestServerTransport(wsURL));
|
|
1335
|
-
});
|
|
1305
|
+
setTestServerConnection(new TestServerConnection(new WebSocketTestServerTransport(wsURL)));
|
|
1336
1306
|
}, []);
|
|
1337
1307
|
React.useEffect(() => {
|
|
1338
1308
|
var _a2;
|
|
@@ -1583,7 +1553,7 @@ const UIModeView = ({}) => {
|
|
|
1583
1553
|
setHasBrowsers(hasBrowsers2);
|
|
1584
1554
|
});
|
|
1585
1555
|
}, [closeInstallDialog, testServerConnection]);
|
|
1586
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
1556
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vbox ui-mode", children: [
|
|
1587
1557
|
!hasBrowsers && /* @__PURE__ */ jsxRuntimeExports.jsxs("dialog", { ref: dialogRef, children: [
|
|
1588
1558
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "title", children: [
|
|
1589
1559
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "codicon codicon-lightbulb" }),
|
|
@@ -1690,9 +1660,6 @@ const UIModeView = ({}) => {
|
|
|
1690
1660
|
} }),
|
|
1691
1661
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "collapse-all", title: "Collapse all", onClick: () => {
|
|
1692
1662
|
setCollapseAllCount(collapseAllCount + 1);
|
|
1693
|
-
} }),
|
|
1694
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarButton, { icon: "expand-all", title: "Expand all", onClick: () => {
|
|
1695
|
-
setExpandAllCount(expandAllCount + 1);
|
|
1696
1663
|
} })
|
|
1697
1664
|
] }),
|
|
1698
1665
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -1710,7 +1677,6 @@ const UIModeView = ({}) => {
|
|
|
1710
1677
|
setWatchedTreeIds,
|
|
1711
1678
|
isLoading,
|
|
1712
1679
|
requestedCollapseAllCount: collapseAllCount,
|
|
1713
|
-
requestedExpandAllCount: expandAllCount,
|
|
1714
1680
|
setFilterText,
|
|
1715
1681
|
onRevealSource
|
|
1716
1682
|
}
|
|
@@ -1727,11 +1693,13 @@ const UIModeView = ({}) => {
|
|
|
1727
1693
|
),
|
|
1728
1694
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "section-title", children: "Settings" })
|
|
1729
1695
|
] }),
|
|
1730
|
-
settingsVisible && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1696
|
+
settingsVisible && /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsView, { settings: [
|
|
1697
|
+
{ value: darkMode, set: setDarkMode, title: "Dark mode" }
|
|
1698
|
+
] })
|
|
1731
1699
|
] })
|
|
1732
1700
|
}
|
|
1733
1701
|
)
|
|
1734
|
-
] })
|
|
1702
|
+
] });
|
|
1735
1703
|
};
|
|
1736
1704
|
(async () => {
|
|
1737
1705
|
applyTheme();
|
|
@@ -1751,6 +1719,6 @@ Make sure to serve the website (${window.location}) via HTTPS or localhost.`);
|
|
|
1751
1719
|
fetch("ping");
|
|
1752
1720
|
}, 1e4);
|
|
1753
1721
|
}
|
|
1754
|
-
|
|
1722
|
+
createRoot(document.querySelector("#root")).render(/* @__PURE__ */ jsxRuntimeExports.jsx(UIModeView, {}));
|
|
1755
1723
|
})();
|
|
1756
|
-
//# sourceMappingURL=uiMode.
|
|
1724
|
+
//# sourceMappingURL=uiMode.CYBsUhm_.js.map
|