@checkly/playwright-core 1.41.26 → 1.42.11

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.
Files changed (180) hide show
  1. package/ThirdPartyNotices.txt +3 -3
  2. package/bin/reinstall_chrome_beta_win.ps1 +2 -1
  3. package/bin/reinstall_chrome_stable_win.ps1 +2 -1
  4. package/bin/reinstall_msedge_beta_win.ps1 +2 -1
  5. package/bin/reinstall_msedge_dev_win.ps1 +2 -1
  6. package/bin/reinstall_msedge_stable_win.ps1 +2 -1
  7. package/browsers.json +14 -15
  8. package/cli.js +2 -1
  9. package/lib/checkly/fetch.js +28 -1
  10. package/lib/cli/cli.js +2 -1
  11. package/lib/cli/driver.js +9 -1
  12. package/lib/cli/program.js +12 -4
  13. package/lib/client/browserContext.js +1 -1
  14. package/lib/client/channelOwner.js +1 -1
  15. package/lib/client/clientHelper.js +5 -1
  16. package/lib/client/connection.js +1 -1
  17. package/lib/client/consoleMessage.js +1 -1
  18. package/lib/client/electron.js +3 -0
  19. package/lib/client/events.js +1 -0
  20. package/lib/client/frame.js +2 -1
  21. package/lib/client/harRouter.js +7 -1
  22. package/lib/client/page.js +25 -6
  23. package/lib/common/debugLogger.js +3 -1
  24. package/lib/common/socksProxy.js +1 -1
  25. package/lib/generated/consoleApiSource.js +1 -1
  26. package/lib/generated/injectedScriptSource.js +1 -1
  27. package/lib/generated/recorderSource.js +1 -1
  28. package/lib/outofprocess.js +1 -1
  29. package/lib/protocol/validator.js +60 -30
  30. package/lib/remote/playwrightConnection.js +1 -1
  31. package/lib/remote/playwrightServer.js +72 -166
  32. package/lib/server/android/android.js +1 -1
  33. package/lib/server/browserType.js +2 -2
  34. package/lib/server/chromium/chromium.js +5 -4
  35. package/lib/server/chromium/crConnection.js +1 -1
  36. package/lib/server/chromium/crNetworkManager.js +1 -3
  37. package/lib/server/chromium/crPage.js +45 -2
  38. package/lib/server/chromium/crPdf.js +8 -2
  39. package/lib/server/console.js +1 -3
  40. package/lib/server/debugController.js +0 -3
  41. package/lib/server/deviceDescriptorsSource.json +50 -50
  42. package/lib/server/dispatchers/browserContextDispatcher.js +3 -2
  43. package/lib/server/dispatchers/dispatcher.js +9 -10
  44. package/lib/server/dispatchers/electronDispatcher.js +13 -0
  45. package/lib/server/dispatchers/frameDispatcher.js +0 -6
  46. package/lib/server/dispatchers/networkDispatchers.js +1 -0
  47. package/lib/server/dispatchers/pageDispatcher.js +14 -10
  48. package/lib/server/dom.js +130 -167
  49. package/lib/server/electron/electron.js +38 -12
  50. package/lib/server/electron/loader.js +4 -2
  51. package/lib/server/fetch.js +1 -0
  52. package/lib/server/firefox/ffAccessibility.js +2 -1
  53. package/lib/server/firefox/ffConnection.js +1 -1
  54. package/lib/server/firefox/ffPage.js +1 -1
  55. package/lib/server/frames.js +39 -20
  56. package/lib/server/helper.js +1 -1
  57. package/lib/server/page.js +49 -5
  58. package/lib/server/pipeTransport.js +1 -1
  59. package/lib/server/playwright.js +1 -1
  60. package/lib/server/progress.js +3 -11
  61. package/lib/server/recorder/csharp.js +1 -1
  62. package/lib/server/recorder/java.js +36 -4
  63. package/lib/server/recorder.js +2 -2
  64. package/lib/server/registry/browserFetcher.js +1 -1
  65. package/lib/server/registry/dependencies.js +5 -4
  66. package/lib/server/registry/index.js +48 -30
  67. package/lib/server/registry/nativeDeps.js +0 -94
  68. package/lib/server/trace/recorder/snapshotter.js +1 -1
  69. package/lib/server/trace/recorder/tracing.js +5 -2
  70. package/lib/server/trace/viewer/traceViewer.js +1 -1
  71. package/lib/server/transport.js +4 -2
  72. package/lib/server/webkit/wkConnection.js +1 -1
  73. package/lib/server/webkit/wkPage.js +2 -2
  74. package/lib/utils/comparators.js +4 -4
  75. package/lib/utils/fileUtils.js +4 -0
  76. package/lib/utils/hostPlatform.js +1 -1
  77. package/lib/utils/index.js +33 -0
  78. package/lib/utils/isomorphic/locatorParser.js +6 -4
  79. package/lib/utils/isomorphic/stringUtils.js +5 -0
  80. package/lib/utils/network.js +32 -0
  81. package/lib/utils/processLauncher.js +7 -0
  82. package/lib/utils/rtti.js +7 -4
  83. package/lib/utils/wsServer.js +5 -3
  84. package/lib/utilsBundleImpl/index.js +4 -4
  85. package/lib/vite/htmlReport/index.html +11 -11
  86. package/lib/vite/{traceViewer/assets/codeMirrorModule-GJA8DRmd.js → recorder/assets/codeMirrorModule-W69B4LBB.js} +1 -1
  87. package/lib/vite/recorder/assets/{index-yg8ypzl6.js → index-Ly3PcVUb.js} +2 -2
  88. package/lib/vite/recorder/index.html +1 -1
  89. package/lib/vite/traceViewer/assets/{codeMirrorModule-2ImvVqMb.js → codeMirrorModule-BK3t1EEu.js} +1 -1
  90. package/lib/vite/traceViewer/assets/codeMirrorModule-cc2329e4.js +15593 -0
  91. package/lib/vite/traceViewer/assets/codeMirrorModule-d725feea.js +15586 -0
  92. package/lib/vite/traceViewer/assets/{codeMirrorModule-fqJB1XDu.js → codeMirrorModule-e5a15eec.js} +1 -1
  93. package/lib/vite/traceViewer/assets/codeMirrorModule-kT-uS7F4.js +15592 -0
  94. package/lib/vite/traceViewer/assets/codeMirrorModule-rcsC5no8.js +15592 -0
  95. package/lib/vite/traceViewer/assets/codeMirrorModule-yboVpgC0.js +15592 -0
  96. package/lib/vite/traceViewer/assets/codeMirrorModule-ytMY1awF.js +15585 -0
  97. package/lib/vite/traceViewer/assets/wsPort-54626118.js +18361 -0
  98. package/lib/vite/traceViewer/assets/{wsPort-uVqol1LI.js → wsPort-964mA9MZ.js} +18 -18
  99. package/lib/vite/traceViewer/assets/wsPort-CAXygIGt.js +18540 -0
  100. package/lib/vite/traceViewer/assets/wsPort-a88a6a12.js +18361 -0
  101. package/lib/vite/traceViewer/assets/{wsPort-722747dc.js → wsPort-cb764cde.js} +1 -1
  102. package/lib/vite/traceViewer/assets/wsPort-lTlmZhJd.js +18564 -0
  103. package/lib/vite/traceViewer/assets/wsPort-xpIMLVfx.js +18540 -0
  104. package/lib/vite/traceViewer/assets/wsPort-yM58htfg.js +18360 -0
  105. package/lib/vite/traceViewer/assets/xtermModule-60687b6b.js +6410 -0
  106. package/lib/vite/traceViewer/assets/xtermModule-_6TC5FYT.js +6529 -0
  107. package/lib/vite/traceViewer/codeMirrorModule.eb494ea9.css +344 -0
  108. package/lib/vite/traceViewer/codeMirrorModule.svF_VrcJ.css +344 -0
  109. package/lib/vite/traceViewer/{index.0d08c336.js → index.4a8ee36e.js} +1 -1
  110. package/lib/vite/traceViewer/index.55e65778.js +181 -0
  111. package/lib/vite/traceViewer/index.5mge2rY_.css +124 -0
  112. package/lib/vite/traceViewer/index.5nqVcfiC.js +180 -0
  113. package/lib/vite/traceViewer/index.742fd3e5.js +181 -0
  114. package/lib/vite/traceViewer/index.76e9f312.css +124 -0
  115. package/lib/vite/traceViewer/{index.LR1HufLs.js → index.cbtHmFgM.js} +1 -1
  116. package/lib/vite/traceViewer/index.html +3 -3
  117. package/lib/vite/traceViewer/index.ici1bqta.js +180 -0
  118. package/lib/vite/traceViewer/index.mxOcKqpu.js +180 -0
  119. package/lib/vite/traceViewer/index.zXVxM5ps.js +180 -0
  120. package/lib/vite/traceViewer/sw.bundle.js +4 -4
  121. package/lib/vite/traceViewer/uiMode.216233d5.js +1484 -0
  122. package/lib/vite/traceViewer/uiMode.2c31018f.css +1324 -0
  123. package/lib/vite/traceViewer/{uiMode.c1ebfc43.js → uiMode.468b0309.js} +1 -1
  124. package/lib/vite/traceViewer/uiMode.67C8Ij-c.js +1490 -0
  125. package/lib/vite/traceViewer/uiMode.F_k6a2aC.js +1488 -0
  126. package/lib/vite/traceViewer/uiMode.NjZAwD_B.js +1485 -0
  127. package/lib/vite/traceViewer/uiMode.YQRCZjm8.js +1485 -0
  128. package/lib/vite/traceViewer/uiMode.b2068d00.js +1484 -0
  129. package/lib/vite/traceViewer/uiMode.e-PLonGl.js +1490 -0
  130. package/lib/vite/traceViewer/{uiMode.PlLkrJDI.js → uiMode.fcU_T5Nf.js} +1 -1
  131. package/lib/vite/traceViewer/uiMode.html +3 -3
  132. package/lib/vite/traceViewer/uiMode.xvJHbkzl.css +1324 -0
  133. package/lib/vite/traceViewer/uiMode.ybQP_6Xr.js +10 -0
  134. package/lib/vite/traceViewer/wsPort.997c92cf.css +3513 -0
  135. package/lib/vite/traceViewer/wsPort.Oa05jfrO.css +3513 -0
  136. package/lib/vite/traceViewer/wsPort.p5jUwABW.css +3450 -0
  137. package/lib/vite/traceViewer/xtermModule.125f4259.css +191 -0
  138. package/lib/vite/traceViewer/xtermModule.OKEVRlkP.css +209 -0
  139. package/package.json +6 -5
  140. package/types/protocol.d.ts +367 -53
  141. package/types/types.d.ts +220 -50
  142. package/LICENSE +0 -202
  143. package/NOTICE +0 -5
  144. package/lib/vite/recorder/assets/codeMirrorModule-I9ks4y7D.js +0 -24
  145. package/lib/vite/traceViewer/assets/codeMirrorModule-2mdjgmqe.js +0 -24
  146. package/lib/vite/traceViewer/assets/codeMirrorModule-56536a77.js +0 -24
  147. package/lib/vite/traceViewer/assets/codeMirrorModule-A2_PGeGB.js +0 -24
  148. package/lib/vite/traceViewer/assets/codeMirrorModule-GluP1cQ1.js +0 -24
  149. package/lib/vite/traceViewer/assets/codeMirrorModule-aUzO-LID.js +0 -24
  150. package/lib/vite/traceViewer/assets/codeMirrorModule-b361a51f.js +0 -24
  151. package/lib/vite/traceViewer/assets/codeMirrorModule-f333a775.js +0 -24
  152. package/lib/vite/traceViewer/assets/codeMirrorModule-y3M3aAqy.js +0 -24
  153. package/lib/vite/traceViewer/assets/wsPort-762c6840.js +0 -64
  154. package/lib/vite/traceViewer/assets/wsPort-93o0i57c.js +0 -69
  155. package/lib/vite/traceViewer/assets/wsPort-L8WBvZfK.js +0 -69
  156. package/lib/vite/traceViewer/assets/wsPort-Rvwd4WC-.js +0 -69
  157. package/lib/vite/traceViewer/assets/wsPort-db501ca9.js +0 -64
  158. package/lib/vite/traceViewer/assets/wsPort-dlD7vDkY.js +0 -69
  159. package/lib/vite/traceViewer/assets/wsPort-qI0zJPR7.js +0 -69
  160. package/lib/vite/traceViewer/assets/wsPort-qOE2NWrO.js +0 -69
  161. package/lib/vite/traceViewer/assets/wsPort-sh0wpjYp.js +0 -69
  162. package/lib/vite/traceViewer/index.4X7zDysg.js +0 -2
  163. package/lib/vite/traceViewer/index.4xhUWj1f.js +0 -2
  164. package/lib/vite/traceViewer/index.HkJgzlGy.js +0 -2
  165. package/lib/vite/traceViewer/index.Ox-CymYJ.js +0 -2
  166. package/lib/vite/traceViewer/index.d05939c9.js +0 -2
  167. package/lib/vite/traceViewer/index.ed9a3c58.js +0 -2
  168. package/lib/vite/traceViewer/index.kRjx5sAJ.js +0 -2
  169. package/lib/vite/traceViewer/index.krETyIB_.js +0 -2
  170. package/lib/vite/traceViewer/index.o6j3Cv4u.js +0 -2
  171. package/lib/vite/traceViewer/uiMode.1Wcp_Kto.js +0 -10
  172. package/lib/vite/traceViewer/uiMode.3ff70f7d.js +0 -4
  173. package/lib/vite/traceViewer/uiMode.8e0454c4.js +0 -4
  174. package/lib/vite/traceViewer/uiMode.GTNzARcV.js +0 -10
  175. package/lib/vite/traceViewer/uiMode.Rcwfn0db.js +0 -10
  176. package/lib/vite/traceViewer/uiMode.YGPXSUMv.js +0 -10
  177. package/lib/vite/traceViewer/uiMode.YYFJGvtV.js +0 -10
  178. package/lib/vite/traceViewer/uiMode.qpn6w4df.js +0 -10
  179. package/lib/vite/traceViewer/uiMode.zV-7Lf9v.js +0 -10
  180. package/lib/vite/traceViewer/wsPort.kSgQKQ0y.css +0 -1
@@ -1,2 +0,0 @@
1
- import{M as b,r as a,c as U,j as e,T as D,t as R,W as M,a as C,b as F}from"./assets/wsPort-qOE2NWrO.js";const O=()=>{const[l,k]=a.useState(!1),[c,d]=a.useState([]),[u,E]=a.useState([]),[p,j]=a.useState(N),[v,m]=a.useState({done:0,total:0}),[T,h]=a.useState(!1),[y,f]=a.useState(null),[w,L]=a.useState(null),g=a.useCallback(r=>{const o=[],t=[],s=new URL(window.location.href);for(let i=0;i<r.length;i++){const n=r.item(i);if(!n)continue;const S=URL.createObjectURL(n);o.push(S),t.push(n.name),s.searchParams.append("trace",S),s.searchParams.append("traceFileName",n.name)}const x=s.toString();window.history.pushState({},"",x),d(o),E(t),h(!1),f(null)},[]),P=a.useCallback(r=>{r.preventDefault(),g(r.dataTransfer.files)},[g]),W=a.useCallback(r=>{r.preventDefault(),r.target.files&&g(r.target.files)},[g]);return a.useEffect(()=>{const r=new URL(window.location.href).searchParams,o=r.getAll("trace");k(r.has("isServer"));for(const t of o)if(t.startsWith("file:")){L(t||null);return}r.has("isServer")?U({onEvent(t,s){t==="loadTrace"&&(d(s.url?[s.url]:[]),h(!1),f(null))},onClose(){}}).then(t=>{t("ready")}):o.some(t=>t.startsWith("blob:"))||d(o)},[]),a.useEffect(()=>{(async()=>{if(c.length){const r=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",r),m({done:0,total:1});const o=[];for(let s=0;s<c.length;s++){const x=c[s],i=new URLSearchParams;i.set("trace",x),u.length&&i.set("traceFileName",u[s]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||d([]),f((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",r);const t=new b(o);m({done:0,total:0}),j(t)}else j(N)})()},[l,c,u]),e.jsxs("div",{className:"vbox workbench-loader",onDragOver:r=>{r.preventDefault(),h(!0)},children:[e.jsxs("div",{className:"hbox header",children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(D,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>R()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(M,{model:p}),w&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:w,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!T&&!w&&(!c.length||y)&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",children:y}),e.jsx("div",{className:"title",children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const r=document.createElement("input");r.type="file",r.multiple=!0,r.click(),r.addEventListener("change",o=>W(o))},children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{h(!1)},onDrop:r=>P(r),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new b([]);(async()=>{if(C(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}F.render(e.jsx(O,{}),document.querySelector("#root"))})();
@@ -1,2 +0,0 @@
1
- import{M as b,r as a,c as U,j as e,T as D,t as R,W as M,a as C,b as F}from"./assets/wsPort-uVqol1LI.js";const O=()=>{const[l,k]=a.useState(!1),[c,d]=a.useState([]),[u,E]=a.useState([]),[p,j]=a.useState(N),[v,m]=a.useState({done:0,total:0}),[T,h]=a.useState(!1),[y,f]=a.useState(null),[w,L]=a.useState(null),g=a.useCallback(r=>{const o=[],t=[],s=new URL(window.location.href);for(let i=0;i<r.length;i++){const n=r.item(i);if(!n)continue;const S=URL.createObjectURL(n);o.push(S),t.push(n.name),s.searchParams.append("trace",S),s.searchParams.append("traceFileName",n.name)}const x=s.toString();window.history.pushState({},"",x),d(o),E(t),h(!1),f(null)},[]),P=a.useCallback(r=>{r.preventDefault(),g(r.dataTransfer.files)},[g]),W=a.useCallback(r=>{r.preventDefault(),r.target.files&&g(r.target.files)},[g]);return a.useEffect(()=>{const r=new URL(window.location.href).searchParams,o=r.getAll("trace");k(r.has("isServer"));for(const t of o)if(t.startsWith("file:")){L(t||null);return}r.has("isServer")?U({onEvent(t,s){t==="loadTrace"&&(d(s.url?[s.url]:[]),h(!1),f(null))},onClose(){}}).then(t=>{t("ready")}):o.some(t=>t.startsWith("blob:"))||d(o)},[]),a.useEffect(()=>{(async()=>{if(c.length){const r=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",r),m({done:0,total:1});const o=[];for(let s=0;s<c.length;s++){const x=c[s],i=new URLSearchParams;i.set("trace",x),u.length&&i.set("traceFileName",u[s]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||d([]),f((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",r);const t=new b(o);m({done:0,total:0}),j(t)}else j(N)})()},[l,c,u]),e.jsxs("div",{className:"vbox workbench-loader",onDragOver:r=>{r.preventDefault(),h(!0)},children:[e.jsxs("div",{className:"hbox header",children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(D,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>R()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(M,{model:p}),w&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:w,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!T&&!w&&(!c.length||y)&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",children:y}),e.jsx("div",{className:"title",children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const r=document.createElement("input");r.type="file",r.multiple=!0,r.click(),r.addEventListener("change",o=>W(o))},children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{h(!1)},onDrop:r=>P(r),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new b([]);(async()=>{if(C(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}F.render(e.jsx(O,{}),document.querySelector("#root"))})();
@@ -1,2 +0,0 @@
1
- import{M as b,r as a,c as U,j as e,T as D,t as R,W as M,a as C,b as F}from"./assets/wsPort-Rvwd4WC-.js";const O=()=>{const[l,k]=a.useState(!1),[c,d]=a.useState([]),[u,E]=a.useState([]),[p,j]=a.useState(N),[v,m]=a.useState({done:0,total:0}),[T,h]=a.useState(!1),[y,f]=a.useState(null),[w,L]=a.useState(null),g=a.useCallback(r=>{const o=[],t=[],s=new URL(window.location.href);for(let i=0;i<r.length;i++){const n=r.item(i);if(!n)continue;const S=URL.createObjectURL(n);o.push(S),t.push(n.name),s.searchParams.append("trace",S),s.searchParams.append("traceFileName",n.name)}const x=s.toString();window.history.pushState({},"",x),d(o),E(t),h(!1),f(null)},[]),P=a.useCallback(r=>{r.preventDefault(),g(r.dataTransfer.files)},[g]),W=a.useCallback(r=>{r.preventDefault(),r.target.files&&g(r.target.files)},[g]);return a.useEffect(()=>{const r=new URL(window.location.href).searchParams,o=r.getAll("trace");k(r.has("isServer"));for(const t of o)if(t.startsWith("file:")){L(t||null);return}r.has("isServer")?U({onEvent(t,s){t==="loadTrace"&&(d(s.url?[s.url]:[]),h(!1),f(null))},onClose(){}}).then(t=>{t("ready")}):o.some(t=>t.startsWith("blob:"))||d(o)},[]),a.useEffect(()=>{(async()=>{if(c.length){const r=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",r),m({done:0,total:1});const o=[];for(let s=0;s<c.length;s++){const x=c[s],i=new URLSearchParams;i.set("trace",x),u.length&&i.set("traceFileName",u[s]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||d([]),f((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",r);const t=new b(o);m({done:0,total:0}),j(t)}else j(N)})()},[l,c,u]),e.jsxs("div",{className:"vbox workbench-loader",onDragOver:r=>{r.preventDefault(),h(!0)},children:[e.jsxs("div",{className:"hbox header",children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(D,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>R()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(M,{model:p}),w&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:w,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!T&&!w&&(!c.length||y)&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",children:y}),e.jsx("div",{className:"title",children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const r=document.createElement("input");r.type="file",r.multiple=!0,r.click(),r.addEventListener("change",o=>W(o))},children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{h(!1)},onDrop:r=>P(r),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new b([]);(async()=>{if(C(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}F.render(e.jsx(O,{}),document.querySelector("#root"))})();
@@ -1,2 +0,0 @@
1
- import{M as b,r as a,c as U,j as e,T as D,t as R,W as M,a as C,b as F}from"./assets/wsPort-93o0i57c.js";const O=()=>{const[l,k]=a.useState(!1),[c,d]=a.useState([]),[u,E]=a.useState([]),[p,j]=a.useState(N),[v,m]=a.useState({done:0,total:0}),[T,h]=a.useState(!1),[y,f]=a.useState(null),[w,L]=a.useState(null),g=a.useCallback(r=>{const o=[],t=[],s=new URL(window.location.href);for(let i=0;i<r.length;i++){const n=r.item(i);if(!n)continue;const S=URL.createObjectURL(n);o.push(S),t.push(n.name),s.searchParams.append("trace",S),s.searchParams.append("traceFileName",n.name)}const x=s.toString();window.history.pushState({},"",x),d(o),E(t),h(!1),f(null)},[]),P=a.useCallback(r=>{r.preventDefault(),g(r.dataTransfer.files)},[g]),W=a.useCallback(r=>{r.preventDefault(),r.target.files&&g(r.target.files)},[g]);return a.useEffect(()=>{const r=new URL(window.location.href).searchParams,o=r.getAll("trace");k(r.has("isServer"));for(const t of o)if(t.startsWith("file:")){L(t||null);return}r.has("isServer")?U({onEvent(t,s){t==="loadTrace"&&(d(s.url?[s.url]:[]),h(!1),f(null))},onClose(){}}).then(t=>{t("ready")}):o.some(t=>t.startsWith("blob:"))||d(o)},[]),a.useEffect(()=>{(async()=>{if(c.length){const r=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",r),m({done:0,total:1});const o=[];for(let s=0;s<c.length;s++){const x=c[s],i=new URLSearchParams;i.set("trace",x),u.length&&i.set("traceFileName",u[s]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||d([]),f((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",r);const t=new b(o);m({done:0,total:0}),j(t)}else j(N)})()},[l,c,u]),e.jsxs("div",{className:"vbox workbench-loader",onDragOver:r=>{r.preventDefault(),h(!0)},children:[e.jsxs("div",{className:"hbox header",children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(D,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>R()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(M,{model:p}),w&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:w,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!T&&!w&&(!c.length||y)&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",children:y}),e.jsx("div",{className:"title",children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const r=document.createElement("input");r.type="file",r.multiple=!0,r.click(),r.addEventListener("change",o=>W(o))},children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{h(!1)},onDrop:r=>P(r),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new b([]);(async()=>{if(C(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}F.render(e.jsx(O,{}),document.querySelector("#root"))})();
@@ -1,2 +0,0 @@
1
- import{M as E,r as s,c as R,j as c,a as r,T as x,t as C,W as j,b as F,d as O}from"./assets/wsPort-722747dc.js";const I=()=>{const[l,P]=s.useState(!1),[d,h]=s.useState([]),[p,W]=s.useState([]),[v,S]=s.useState(L),[f,m]=s.useState({done:0,total:0}),[b,g]=s.useState(!1),[k,w]=s.useState(null),[T,U]=s.useState(null),u=s.useCallback(e=>{const o=[],a=[],t=new URL(window.location.href);for(let i=0;i<e.length;i++){const n=e.item(i);if(!n)continue;const N=URL.createObjectURL(n);o.push(N),a.push(n.name),t.searchParams.append("trace",N),t.searchParams.append("traceFileName",n.name)}const y=t.toString();window.history.pushState({},"",y),h(o),W(a),g(!1),w(null)},[]),D=s.useCallback(e=>{e.preventDefault(),u(e.dataTransfer.files)},[u]),M=s.useCallback(e=>{e.preventDefault(),e.target.files&&u(e.target.files)},[u]);return s.useEffect(()=>{const e=new URL(window.location.href).searchParams,o=e.getAll("trace");P(e.has("isServer"));for(const a of o)if(a.startsWith("file:")){U(a||null);return}e.has("isServer")?R({onEvent(a,t){a==="loadTrace"&&(h(t.url?[t.url]:[]),g(!1),w(null))},onClose(){}}).then(a=>{a("ready")}):o.some(a=>a.startsWith("blob:"))||h(o)},[]),s.useEffect(()=>{(async()=>{if(d.length){const e=t=>{t.data.method==="progress"&&m(t.data.params)};navigator.serviceWorker.addEventListener("message",e),m({done:0,total:1});const o=[];for(let t=0;t<d.length;t++){const y=d[t],i=new URLSearchParams;i.set("trace",y),p.length&&i.set("traceFileName",p[t]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||h([]),w((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",e);const a=new E(o);m({done:0,total:0}),S(a)}else S(L)})()},[l,d,p]),c("div",{className:"vbox workbench-loader",onDragOver:e=>{e.preventDefault(),g(!0)},children:[c("div",{className:"hbox header",children:[r("div",{className:"logo",children:r("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),r("div",{className:"product",children:"Playwright"}),v.title&&r("div",{className:"title",children:v.title}),r("div",{className:"spacer"}),r(x,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>C()})]}),r("div",{className:"progress",children:r("div",{className:"inner-progress",style:{width:f.total?100*f.done/f.total+"%":0}})}),r(j,{model:v}),T&&c("div",{className:"drop-target",children:[r("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),c("div",{style:{paddingTop:20},children:[c("div",{children:["1. Click ",r("a",{href:T,children:"here"})," to put your trace into the download shelf"]}),c("div",{children:["2. Go to ",r("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),r("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!b&&!T&&(!d.length||k)&&c("div",{className:"drop-target",children:[r("div",{className:"processing-error",children:k}),r("div",{className:"title",children:"Drop Playwright Trace to load"}),r("div",{children:"or"}),r("button",{onClick:()=>{const e=document.createElement("input");e.type="file",e.multiple=!0,e.click(),e.addEventListener("change",o=>M(o))},children:"Select file(s)"}),r("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!d.length&&r("div",{className:"drop-target",children:r("div",{className:"title",children:"Select test to see the trace"})}),b&&r("div",{className:"drop-target",onDragLeave:()=>{g(!1)},onDrop:e=>D(e),children:r("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},L=new E([]);(async()=>{if(F(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}O.render(r(I,{}),document.querySelector("#root"))})();
@@ -1,2 +0,0 @@
1
- import{M as E,r as s,c as R,j as c,a as r,T as x,t as C,W as j,b as F,d as O}from"./assets/wsPort-762c6840.js";const I=()=>{const[l,P]=s.useState(!1),[d,h]=s.useState([]),[p,W]=s.useState([]),[v,S]=s.useState(L),[f,m]=s.useState({done:0,total:0}),[b,g]=s.useState(!1),[k,w]=s.useState(null),[T,U]=s.useState(null),u=s.useCallback(e=>{const o=[],a=[],t=new URL(window.location.href);for(let i=0;i<e.length;i++){const n=e.item(i);if(!n)continue;const N=URL.createObjectURL(n);o.push(N),a.push(n.name),t.searchParams.append("trace",N),t.searchParams.append("traceFileName",n.name)}const y=t.toString();window.history.pushState({},"",y),h(o),W(a),g(!1),w(null)},[]),D=s.useCallback(e=>{e.preventDefault(),u(e.dataTransfer.files)},[u]),M=s.useCallback(e=>{e.preventDefault(),e.target.files&&u(e.target.files)},[u]);return s.useEffect(()=>{const e=new URL(window.location.href).searchParams,o=e.getAll("trace");P(e.has("isServer"));for(const a of o)if(a.startsWith("file:")){U(a||null);return}e.has("isServer")?R({onEvent(a,t){a==="loadTrace"&&(h(t.url?[t.url]:[]),g(!1),w(null))},onClose(){}}).then(a=>{a("ready")}):o.some(a=>a.startsWith("blob:"))||h(o)},[]),s.useEffect(()=>{(async()=>{if(d.length){const e=t=>{t.data.method==="progress"&&m(t.data.params)};navigator.serviceWorker.addEventListener("message",e),m({done:0,total:1});const o=[];for(let t=0;t<d.length;t++){const y=d[t],i=new URLSearchParams;i.set("trace",y),p.length&&i.set("traceFileName",p[t]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||h([]),w((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",e);const a=new E(o);m({done:0,total:0}),S(a)}else S(L)})()},[l,d,p]),c("div",{className:"vbox workbench-loader",onDragOver:e=>{e.preventDefault(),g(!0)},children:[c("div",{className:"hbox header",children:[r("div",{className:"logo",children:r("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),r("div",{className:"product",children:"Playwright"}),v.title&&r("div",{className:"title",children:v.title}),r("div",{className:"spacer"}),r(x,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>C()})]}),r("div",{className:"progress",children:r("div",{className:"inner-progress",style:{width:f.total?100*f.done/f.total+"%":0}})}),r(j,{model:v}),T&&c("div",{className:"drop-target",children:[r("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),c("div",{style:{paddingTop:20},children:[c("div",{children:["1. Click ",r("a",{href:T,children:"here"})," to put your trace into the download shelf"]}),c("div",{children:["2. Go to ",r("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),r("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!b&&!T&&(!d.length||k)&&c("div",{className:"drop-target",children:[r("div",{className:"processing-error",children:k}),r("div",{className:"title",children:"Drop Playwright Trace to load"}),r("div",{children:"or"}),r("button",{onClick:()=>{const e=document.createElement("input");e.type="file",e.multiple=!0,e.click(),e.addEventListener("change",o=>M(o))},children:"Select file(s)"}),r("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!d.length&&r("div",{className:"drop-target",children:r("div",{className:"title",children:"Select test to see the trace"})}),b&&r("div",{className:"drop-target",onDragLeave:()=>{g(!1)},onDrop:e=>D(e),children:r("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},L=new E([]);(async()=>{if(F(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}O.render(r(I,{}),document.querySelector("#root"))})();
@@ -1,2 +0,0 @@
1
- import{M as b,r as a,c as U,j as e,T as D,t as R,W as M,a as C,b as F}from"./assets/wsPort-dlD7vDkY.js";const O=()=>{const[l,k]=a.useState(!1),[c,d]=a.useState([]),[u,E]=a.useState([]),[p,j]=a.useState(N),[v,m]=a.useState({done:0,total:0}),[T,h]=a.useState(!1),[y,f]=a.useState(null),[w,L]=a.useState(null),g=a.useCallback(r=>{const o=[],t=[],s=new URL(window.location.href);for(let i=0;i<r.length;i++){const n=r.item(i);if(!n)continue;const S=URL.createObjectURL(n);o.push(S),t.push(n.name),s.searchParams.append("trace",S),s.searchParams.append("traceFileName",n.name)}const x=s.toString();window.history.pushState({},"",x),d(o),E(t),h(!1),f(null)},[]),P=a.useCallback(r=>{r.preventDefault(),g(r.dataTransfer.files)},[g]),W=a.useCallback(r=>{r.preventDefault(),r.target.files&&g(r.target.files)},[g]);return a.useEffect(()=>{const r=new URL(window.location.href).searchParams,o=r.getAll("trace");k(r.has("isServer"));for(const t of o)if(t.startsWith("file:")){L(t||null);return}r.has("isServer")?U({onEvent(t,s){t==="loadTrace"&&(d(s.url?[s.url]:[]),h(!1),f(null))},onClose(){}}).then(t=>{t("ready")}):o.some(t=>t.startsWith("blob:"))||d(o)},[]),a.useEffect(()=>{(async()=>{if(c.length){const r=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",r),m({done:0,total:1});const o=[];for(let s=0;s<c.length;s++){const x=c[s],i=new URLSearchParams;i.set("trace",x),u.length&&i.set("traceFileName",u[s]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||d([]),f((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",r);const t=new b(o);m({done:0,total:0}),j(t)}else j(N)})()},[l,c,u]),e.jsxs("div",{className:"vbox workbench-loader",onDragOver:r=>{r.preventDefault(),h(!0)},children:[e.jsxs("div",{className:"hbox header",children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(D,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>R()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(M,{model:p}),w&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:w,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!T&&!w&&(!c.length||y)&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",children:y}),e.jsx("div",{className:"title",children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const r=document.createElement("input");r.type="file",r.multiple=!0,r.click(),r.addEventListener("change",o=>W(o))},children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{h(!1)},onDrop:r=>P(r),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new b([]);(async()=>{if(C(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}F.render(e.jsx(O,{}),document.querySelector("#root"))})();
@@ -1,2 +0,0 @@
1
- import{M as b,r as a,c as U,j as e,T as D,t as R,W as M,a as C,b as F}from"./assets/wsPort-sh0wpjYp.js";const O=()=>{const[l,k]=a.useState(!1),[c,d]=a.useState([]),[u,E]=a.useState([]),[p,j]=a.useState(N),[v,m]=a.useState({done:0,total:0}),[T,h]=a.useState(!1),[y,f]=a.useState(null),[w,L]=a.useState(null),g=a.useCallback(r=>{const o=[],t=[],s=new URL(window.location.href);for(let i=0;i<r.length;i++){const n=r.item(i);if(!n)continue;const S=URL.createObjectURL(n);o.push(S),t.push(n.name),s.searchParams.append("trace",S),s.searchParams.append("traceFileName",n.name)}const x=s.toString();window.history.pushState({},"",x),d(o),E(t),h(!1),f(null)},[]),P=a.useCallback(r=>{r.preventDefault(),g(r.dataTransfer.files)},[g]),W=a.useCallback(r=>{r.preventDefault(),r.target.files&&g(r.target.files)},[g]);return a.useEffect(()=>{const r=new URL(window.location.href).searchParams,o=r.getAll("trace");k(r.has("isServer"));for(const t of o)if(t.startsWith("file:")){L(t||null);return}r.has("isServer")?U({onEvent(t,s){t==="loadTrace"&&(d(s.url?[s.url]:[]),h(!1),f(null))},onClose(){}}).then(t=>{t("ready")}):o.some(t=>t.startsWith("blob:"))||d(o)},[]),a.useEffect(()=>{(async()=>{if(c.length){const r=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",r),m({done:0,total:1});const o=[];for(let s=0;s<c.length;s++){const x=c[s],i=new URLSearchParams;i.set("trace",x),u.length&&i.set("traceFileName",u[s]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||d([]),f((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",r);const t=new b(o);m({done:0,total:0}),j(t)}else j(N)})()},[l,c,u]),e.jsxs("div",{className:"vbox workbench-loader",onDragOver:r=>{r.preventDefault(),h(!0)},children:[e.jsxs("div",{className:"hbox header",children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(D,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>R()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(M,{model:p}),w&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:w,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!T&&!w&&(!c.length||y)&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",children:y}),e.jsx("div",{className:"title",children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const r=document.createElement("input");r.type="file",r.multiple=!0,r.click(),r.addEventListener("change",o=>W(o))},children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{h(!1)},onDrop:r=>P(r),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new b([]);(async()=>{if(C(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}F.render(e.jsx(O,{}),document.querySelector("#root"))})();
@@ -1,2 +0,0 @@
1
- import{M as b,r as a,c as U,j as e,T as D,t as R,W as M,a as C,b as F}from"./assets/wsPort-L8WBvZfK.js";const O=()=>{const[l,k]=a.useState(!1),[c,d]=a.useState([]),[u,E]=a.useState([]),[p,j]=a.useState(N),[v,m]=a.useState({done:0,total:0}),[T,h]=a.useState(!1),[y,f]=a.useState(null),[w,L]=a.useState(null),g=a.useCallback(r=>{const o=[],t=[],s=new URL(window.location.href);for(let i=0;i<r.length;i++){const n=r.item(i);if(!n)continue;const S=URL.createObjectURL(n);o.push(S),t.push(n.name),s.searchParams.append("trace",S),s.searchParams.append("traceFileName",n.name)}const x=s.toString();window.history.pushState({},"",x),d(o),E(t),h(!1),f(null)},[]),P=a.useCallback(r=>{r.preventDefault(),g(r.dataTransfer.files)},[g]),W=a.useCallback(r=>{r.preventDefault(),r.target.files&&g(r.target.files)},[g]);return a.useEffect(()=>{const r=new URL(window.location.href).searchParams,o=r.getAll("trace");k(r.has("isServer"));for(const t of o)if(t.startsWith("file:")){L(t||null);return}r.has("isServer")?U({onEvent(t,s){t==="loadTrace"&&(d(s.url?[s.url]:[]),h(!1),f(null))},onClose(){}}).then(t=>{t("ready")}):o.some(t=>t.startsWith("blob:"))||d(o)},[]),a.useEffect(()=>{(async()=>{if(c.length){const r=s=>{s.data.method==="progress"&&m(s.data.params)};navigator.serviceWorker.addEventListener("message",r),m({done:0,total:1});const o=[];for(let s=0;s<c.length;s++){const x=c[s],i=new URLSearchParams;i.set("trace",x),u.length&&i.set("traceFileName",u[s]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||d([]),f((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",r);const t=new b(o);m({done:0,total:0}),j(t)}else j(N)})()},[l,c,u]),e.jsxs("div",{className:"vbox workbench-loader",onDragOver:r=>{r.preventDefault(),h(!0)},children:[e.jsxs("div",{className:"hbox header",children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),p.title&&e.jsx("div",{className:"title",children:p.title}),e.jsx("div",{className:"spacer"}),e.jsx(D,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>R()})]}),e.jsx("div",{className:"progress",children:e.jsx("div",{className:"inner-progress",style:{width:v.total?100*v.done/v.total+"%":0}})}),e.jsx(M,{model:p}),w&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),e.jsxs("div",{style:{paddingTop:20},children:[e.jsxs("div",{children:["1. Click ",e.jsx("a",{href:w,children:"here"})," to put your trace into the download shelf"]}),e.jsxs("div",{children:["2. Go to ",e.jsx("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),e.jsx("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!T&&!w&&(!c.length||y)&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",children:y}),e.jsx("div",{className:"title",children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const r=document.createElement("input");r.type="file",r.multiple=!0,r.click(),r.addEventListener("change",o=>W(o))},children:"Select file(s)"}),e.jsx("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!c.length&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),T&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{h(!1)},onDrop:r=>P(r),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new b([]);(async()=>{if(C(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
2
- Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)}F.render(e.jsx(O,{}),document.querySelector("#root"))})();
@@ -1,10 +0,0 @@
1
- import{u as Ct,r as V,d as yt,_ as Bt,e as Mt,f as Nt,j as l,R as f,g as Rt,c as Pt,s as wt,S as Dt,h as G,T as y,t as Lt,m as Ft,i as It,k as dt,W as Wt,M as Ot,l as At,a as zt,b as Vt}from"./assets/wsPort-qOE2NWrO.js";class ht{constructor(){this._stringCache=new Map}internString(t){let e=this._stringCache.get(t);return e||(this._stringCache.set(t,t),e=t),e}}var Kt={};class ft{constructor(t,e,s,i){this._tests=new Map,this._listOnly=!1,this._clearPreviousResultsWhenTestBegins=!1,this._stringPool=new ht,this._rootSuite=new W("","root"),this._pathSeparator=t,this._reporter=e,this._reuseTestCases=s,this._reportConfig=i}dispatch(t){const{method:e,params:s}=t;if(e==="onConfigure"){this._onConfigure(s.config);return}if(e==="onProject"){this._onProject(s.project);return}if(e==="onBegin"){this._onBegin();return}if(e==="onTestBegin"){this._onTestBegin(s.testId,s.result);return}if(e==="onTestEnd"){this._onTestEnd(s.test,s.result);return}if(e==="onStepBegin"){this._onStepBegin(s.testId,s.resultId,s.step);return}if(e==="onStepEnd"){this._onStepEnd(s.testId,s.resultId,s.step);return}if(e==="onError"){this._onError(s.error);return}if(e==="onStdIO"){this._onStdIO(s.type,s.testId,s.resultId,s.data,s.isBase64);return}if(e==="onEnd")return this._onEnd(s.result);if(e==="onExit")return this._onExit()}_setClearPreviousResultsWhenTestBegins(){this._clearPreviousResultsWhenTestBegins=!0}_onConfigure(t){var e,s;this._rootDir=t.rootDir,this._listOnly=t.listOnly,this._config=this._parseConfig(t),(s=(e=this._reporter).onConfigure)==null||s.call(e,this._config)}_onProject(t){let e=this._rootSuite.suites.find(s=>s.project().__projectId===t.id);if(e||(e=new W(t.name,"project"),this._rootSuite.suites.push(e),e.parent=this._rootSuite),e._project=this._parseProject(t),this._mergeSuitesInto(t.suites,e),this._listOnly){const s=new Set,i=o=>{o.tests.map(c=>c.testId).forEach(c=>s.add(c)),o.suites.forEach(i)};t.suites.forEach(i);const r=o=>{o.tests=o.tests.filter(c=>s.has(c.id)),o.suites.forEach(r)};r(e)}}_onBegin(){var t,e;(e=(t=this._reporter).onBegin)==null||e.call(t,this._rootSuite)}_onTestBegin(t,e){var r,o;const s=this._tests.get(t);this._clearPreviousResultsWhenTestBegins&&s._clearResults();const i=s._createTestResult(e.id);i.retry=e.retry,i.workerIndex=e.workerIndex,i.parallelIndex=e.parallelIndex,i.setStartTimeNumber(e.startTime),i.statusEx="running",(o=(r=this._reporter).onTestBegin)==null||o.call(r,s,i)}_onTestEnd(t,e){var r,o,c;const s=this._tests.get(t.testId);s.timeout=t.timeout,s.expectedStatus=t.expectedStatus,s.annotations=t.annotations;const i=s.resultsMap.get(e.id);i.duration=e.duration,i.status=e.status,i.statusEx=e.status,i.errors=e.errors,i.error=(r=i.errors)==null?void 0:r[0],i.attachments=this._parseAttachments(e.attachments),(c=(o=this._reporter).onTestEnd)==null||c.call(o,s,i),i.stepMap=new Map}_onStepBegin(t,e,s){var p,d;const i=this._tests.get(t),r=i.resultsMap.get(e),o=s.parentStepId?r.stepMap.get(s.parentStepId):void 0,c=this._absoluteLocation(s.location),h=new Ht(s,o,c);o?o.steps.push(h):r.steps.push(h),r.stepMap.set(s.id,h),(d=(p=this._reporter).onStepBegin)==null||d.call(p,i,r,h)}_onStepEnd(t,e,s){var c,h;const i=this._tests.get(t),r=i.resultsMap.get(e),o=r.stepMap.get(s.id);o.duration=s.duration,o.error=s.error,(h=(c=this._reporter).onStepEnd)==null||h.call(c,i,r,o)}_onError(t){var e,s;(s=(e=this._reporter).onError)==null||s.call(e,t)}_onStdIO(t,e,s,i,r){var p,d,v,g;const o=r?globalThis.Buffer?Buffer.from(i,"base64"):atob(i):i,c=e?this._tests.get(e):void 0,h=c&&s?c.resultsMap.get(s):void 0;t==="stdout"?(h==null||h.stdout.push(o),(d=(p=this._reporter).onStdOut)==null||d.call(p,o,c,h)):(h==null||h.stderr.push(o),(g=(v=this._reporter).onStdErr)==null||g.call(v,o,c,h))}async _onEnd(t){var e,s;await((s=(e=this._reporter).onEnd)==null?void 0:s.call(e,{status:t.status,startTime:new Date(t.startTime),duration:t.duration}))}_onExit(){var t,e;return this._stringPool=new ht,(e=(t=this._reporter).onExit)==null?void 0:e.call(t)}_parseConfig(t){const e={...xt,...t};return this._reportConfig&&(e.configFile=this._reportConfig.configFile,e.reportSlowTests=this._reportConfig.reportSlowTests,e.quiet=this._reportConfig.quiet,e.reporter=[...this._reportConfig.reporter]),e}_parseProject(t){return{__projectId:t.id,metadata:t.metadata,name:t.name,outputDir:this._absolutePath(t.outputDir),repeatEach:t.repeatEach,retries:t.retries,testDir:this._absolutePath(t.testDir),testIgnore:Z(t.testIgnore),testMatch:Z(t.testMatch),timeout:t.timeout,grep:Z(t.grep),grepInvert:Z(t.grepInvert),dependencies:t.dependencies,teardown:t.teardown,snapshotDir:this._absolutePath(t.snapshotDir),use:{}}}_parseAttachments(t){return t.map(e=>({...e,body:e.base64&&globalThis.Buffer?Buffer.from(e.base64,"base64"):void 0}))}_mergeSuitesInto(t,e){for(const s of t){let i=e.suites.find(r=>r.title===s.title);i||(i=new W(s.title,s.type),i.parent=e,e.suites.push(i)),i.location=this._absoluteLocation(s.location),i._fileId=s.fileId,i._parallelMode=s.parallelMode,this._mergeSuitesInto(s.suites,i),this._mergeTestsInto(s.tests,i)}}_mergeTestsInto(t,e){for(const s of t){let i=this._reuseTestCases?e.tests.find(r=>r.title===s.title):void 0;i||(i=new Ut(s.testId,s.title,this._absoluteLocation(s.location)),i.parent=e,e.tests.push(i),this._tests.set(i.id,i)),this._updateTest(s,i)}}_updateTest(t,e){return e.id=t.testId,e.location=this._absoluteLocation(t.location),e.retries=t.retries,e}_absoluteLocation(t){return t&&{...t,file:this._absolutePath(t.file)}}_absolutePath(t){return t&&this._stringPool.internString(this._rootDir+this._pathSeparator+t)}}class W{constructor(t,e){this._requireFile="",this.suites=[],this.tests=[],this._parallelMode="none",this.title=t,this._type=e}allTests(){const t=[],e=s=>{for(const i of[...s.suites,...s.tests])i instanceof W?e(i):t.push(i)};return e(this),t}titlePath(){const t=this.parent?this.parent.titlePath():[];return(this.title||this._type!=="describe")&&t.push(this.title),t}project(){var t;return this._project??((t=this.parent)==null?void 0:t.project())}}class Ut{constructor(t,e,s){this.fn=()=>{},this.results=[],this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.repeatEachIndex=0,this.resultsMap=new Map,this.id=t,this.title=e,this.location=s}titlePath(){const t=this.parent?this.parent.titlePath():[];return t.push(this.title),t}outcome(){var s,i;const t=[...this.results];for(;((s=t[0])==null?void 0:s.status)==="skipped"||((i=t[0])==null?void 0:i.status)==="interrupted";)t.shift();if(!t.length)return"skipped";const e=t.filter(r=>r.status!=="skipped"&&r.status!=="interrupted"&&r.status!==this.expectedStatus);return e.length?e.length===t.length?"unexpected":"flaky":"expected"}ok(){const t=this.outcome();return t==="expected"||t==="flaky"||t==="skipped"}_clearResults(){this.results=[],this.resultsMap.clear()}_createTestResult(t){const e=new $t(this.results.length);return this.results.push(e),this.resultsMap.set(t,e),e}}class Ht{constructor(t,e,s){this.duration=-1,this.steps=[],this._startTime=0,this.title=t.title,this.category=t.category,this.location=s,this.parent=e,this._startTime=t.startTime}titlePath(){var e;return[...((e=this.parent)==null?void 0:e.titlePath())||[],this.title]}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}class $t{constructor(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.statusEx="scheduled",this._startTime=0,this.retry=t}setStartTimeNumber(t){this._startTime=t}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}const xt={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[Kt.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:15e3},configFile:"",rootDir:"",quiet:!1,shard:null,updateSnapshots:"missing",version:"",workers:0,webServer:null};function Z(n){return n.map(t=>t.s?t.s:new RegExp(t.r.source,t.r.flags))}const qt=({source:n})=>{const[t,e]=Ct(),[s,i]=V.useState(yt()),[r]=V.useState(Bt(()=>import("./assets/xtermModule-Yt6xwiJ_.js"),__vite__mapDeps([0,1]),import.meta.url).then(c=>c.default)),o=V.useRef(null);return V.useEffect(()=>(Mt(i),()=>Nt(i)),[]),V.useEffect(()=>{const c=n.write,h=n.clear;return(async()=>{const{Terminal:p,FitAddon:d}=await r,v=e.current;if(!v)return;const g=s==="dark-mode"?Xt:Yt;if(o.current&&o.current.terminal.options.theme===g)return;o.current&&(v.textContent="");const a=new p({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"var(--vscode-editor-font-family)",theme:g}),m=new d;a.loadAddon(m);for(const x of n.pending)a.write(x);n.write=x=>{n.pending.push(x),a.write(x)},n.clear=()=>{n.pending=[],a.clear()},a.open(v),m.fit(),o.current={terminal:a,fitAddon:m}})(),()=>{n.clear=h,n.write=c}},[r,o,e,n,s]),V.useEffect(()=>{setTimeout(()=>{o.current&&(o.current.fitAddon.fit(),n.resize(o.current.terminal.cols,o.current.terminal.rows))},250)},[t,n]),l.jsx("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:e})},Yt={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"},Xt={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"},Jt=({title:n,children:t,setExpanded:e,expanded:s,expandOnTitleClick:i})=>l.jsxs("div",{className:"expandable"+(s?" expanded":""),children:[l.jsxs("div",{className:"expandable-title",onClick:()=>i&&e(!s),children:[l.jsx("div",{className:"codicon codicon-"+(s?"chevron-down":"chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!i&&e(!s)}),n]}),s&&l.jsx("div",{style:{marginLeft:25},children:t})]});function Qt(n){return`.playwright-artifacts-${n}`}let lt=()=>{},vt=n=>{},_t={cols:80,rows:24},I=async()=>{};const O={pending:[],clear:()=>{},write:n=>O.pending.push(n),resize:(n,t)=>{_t={cols:n,rows:t},q("resizeTerminal",{cols:n,rows:t})}},Zt=({})=>{var ut;const[n,t]=f.useState(""),[e,s]=f.useState(!1),[i,r]=f.useState(new Map([["passed",!1],["failed",!1],["skipped",!1]])),[o,c]=f.useState(new Map),[h,p]=f.useState({config:void 0,rootSuite:void 0,loadErrors:[]}),[d,v]=f.useState(),[g,a]=f.useState({}),[m,x]=f.useState(new Set),[T,B]=f.useState(!1),[_,R]=f.useState(),[M,X]=Rt("watch-all",!1),[et,A]=f.useState({value:new Set}),u=f.useRef(Promise.resolve()),S=f.useRef(new Set),[w,b]=f.useState(0),[k,E]=f.useState(!1),[J,ct]=f.useState(!0),Tt=f.useRef(null),st=f.useCallback(()=>{B(!0),A({value:new Set}),lt(xt,new W("","root"),[],void 0),bt(!0).then(async()=>{B(!1);const{hasBrowsers:j}=await I("checkBrowsers");ct(j)})},[]);f.useEffect(()=>{var j;(j=Tt.current)==null||j.focus(),B(!0),Pt({onEvent:ie,onClose:()=>E(!0)}).then(C=>{I=async(P,D)=>{const N=window.__logForTest;N==null||N({method:P,params:D}),await C(P,D)},st()})},[st]),lt=f.useCallback((j,C,P,D)=>{const N=j.configFile?wt.getObject(j.configFile+":projects",void 0):void 0;for(const L of o.keys())C.suites.find(Q=>Q.title===L)||o.delete(L);for(const L of C.suites)o.has(L.title)||o.set(L.title,!!(N!=null&&N.includes(L.title)));!N&&o.size&&![...o.values()].includes(!0)&&o.set(o.entries().next().value[0],!0),p({config:j,rootSuite:C,loadErrors:P}),c(new Map(o)),_&&D?v(D):D||v(void 0)},[o,_]);const it=f.useCallback((j,C)=>{j==="bounce-if-busy"&&_||(S.current=new Set([...S.current,...C]),u.current=u.current.then(async()=>{var N,L,Q;const P=S.current;if(S.current=new Set,!P.size)return;{for(const F of((N=h.rootSuite)==null?void 0:N.allTests())||[])P.has(F.id)&&(F._clearResults(),F._createTestResult("pending"));p({...h})}const D=" ["+new Date().toLocaleTimeString()+"]";O.write("\x1B[2m—".repeat(Math.max(0,_t.cols-D.length))+D+"\x1B[22m"),v({total:0,passed:0,failed:0,skipped:0}),R({testIds:P}),await I("run",{testIds:[...P],projects:[...o].filter(([F,Et])=>Et).map(([F])=>F)});for(const F of((L=h.rootSuite)==null?void 0:L.allTests())||[])((Q=F.results[0])==null?void 0:Q.duration)===-1&&F._clearResults();p({...h}),R(void 0)}))},[o,_,h]),z=!!_,nt=f.useRef(null),kt=f.useCallback(j=>{var C;j.preventDefault(),j.stopPropagation(),(C=nt.current)==null||C.showModal()},[]),ot=f.useCallback(j=>{var C;j.preventDefault(),j.stopPropagation(),(C=nt.current)==null||C.close()},[]),jt=f.useCallback(j=>{ot(j),s(!0),I("installBrowsers").then(async()=>{s(!1);const{hasBrowsers:C}=await I("checkBrowsers");ct(C)})},[ot]);return l.jsxs("div",{className:"vbox ui-mode",children:[!J&&l.jsxs("dialog",{ref:nt,children:[l.jsxs("div",{className:"title",children:[l.jsx("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),l.jsxs("div",{className:"body",children:["Playwright did not find installed browsers.",l.jsx("br",{}),"Would you like to run `playwright install`?",l.jsx("br",{}),l.jsx("button",{className:"button",onClick:jt,children:"Install"}),l.jsx("button",{className:"button secondary",onClick:ot,children:"Dismiss"})]})]}),k&&l.jsxs("div",{className:"disconnected",children:[l.jsx("div",{className:"title",children:"UI Mode disconnected"}),l.jsxs("div",{children:[l.jsx("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),l.jsxs(Dt,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",children:[l.jsxs("div",{className:"vbox",children:[l.jsxs("div",{className:"vbox"+(e?"":" hidden"),children:[l.jsxs(G,{children:[l.jsx("div",{className:"section-title",style:{flex:"none"},children:"Output"}),l.jsx(y,{icon:"circle-slash",title:"Clear output",onClick:()=>O.clear()}),l.jsx("div",{className:"spacer"}),l.jsx(y,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),l.jsx(qt,{source:O})]}),l.jsx("div",{className:"vbox"+(e?" hidden":""),children:l.jsx(se,{item:g,rootDir:(ut=h.config)==null?void 0:ut.rootDir})})]}),l.jsxs("div",{className:"vbox ui-mode-sidebar",children:[l.jsxs(G,{noShadow:!0,noMinHeight:!0,children:[l.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),l.jsx("div",{className:"section-title",children:"Playwright"}),l.jsx(y,{icon:"color-mode",title:"Toggle color mode",onClick:()=>Lt()}),l.jsx(y,{icon:"refresh",title:"Reload",onClick:()=>st(),disabled:z||T}),l.jsx(y,{icon:"terminal",title:"Toggle output",toggled:e,onClick:()=>{s(!e)}}),!J&&l.jsx(y,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:kt})]}),l.jsx(Gt,{filterText:n,setFilterText:t,statusFilters:i,setStatusFilters:r,projectFilters:o,setProjectFilters:c,testModel:h,runTests:()=>it("bounce-if-busy",m)}),l.jsxs(G,{noMinHeight:!0,children:[!z&&!d&&l.jsx("div",{className:"section-title",children:"Tests"}),!z&&d&&l.jsx("div",{"data-testid":"status-line",className:"status-line",children:l.jsxs("div",{children:[d.passed,"/",d.total," passed (",d.passed/d.total*100|0,"%)"]})}),z&&d&&l.jsx("div",{"data-testid":"status-line",className:"status-line",children:l.jsxs("div",{children:["Running ",d.passed,"/",_.testIds.size," passed (",d.passed/_.testIds.size*100|0,"%)"]})}),l.jsx(y,{icon:"play",title:"Run all",onClick:()=>it("bounce-if-busy",m),disabled:z||T}),l.jsx(y,{icon:"debug-stop",title:"Stop",onClick:()=>q("stop"),disabled:!z||T}),l.jsx(y,{icon:"eye",title:"Watch all",toggled:M,onClick:()=>{A({value:new Set}),X(!M)}}),l.jsx(y,{icon:"collapse-all",title:"Collapse all",onClick:()=>{b(w+1)}})]}),l.jsx(ee,{statusFilters:i,projectFilters:o,filterText:n,testModel:h,runningState:_,runTests:it,onItemSelected:a,setVisibleTestIds:x,watchAll:M,watchedTreeIds:et,setWatchedTreeIds:A,isLoading:T,requestedCollapseAllCount:w})]})]})]})},Gt=({filterText:n,setFilterText:t,statusFilters:e,setStatusFilters:s,projectFilters:i,setProjectFilters:r,testModel:o,runTests:c})=>{const[h,p]=f.useState(!1),d=f.useRef(null);f.useEffect(()=>{var a;(a=d.current)==null||a.focus()},[]);const v=[...e.entries()].filter(([a,m])=>m).map(([a])=>a).join(" ")||"all",g=[...i.entries()].filter(([a,m])=>m).map(([a])=>a).join(" ")||"all";return l.jsxs("div",{className:"filters",children:[l.jsx(Jt,{expanded:h,setExpanded:p,title:l.jsx("input",{ref:d,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:n,onChange:a=>{t(a.target.value)},onKeyDown:a=>{a.key==="Enter"&&c()}})}),l.jsxs("div",{className:"filter-summary",title:"Status: "+v+`
2
- Projects: `+g,onClick:()=>p(!h),children:[l.jsx("span",{className:"filter-label",children:"Status:"})," ",v,l.jsx("span",{className:"filter-label",children:"Projects:"})," ",g]}),h&&l.jsxs("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[l.jsx("div",{className:"filter-list",children:[...e.entries()].map(([a,m])=>l.jsx("div",{className:"filter-entry",children:l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:m,onClick:()=>{const x=new Map(e);x.set(a,!x.get(a)),s(x)}}),l.jsx("div",{children:a})]})}))}),l.jsx("div",{className:"filter-list",children:[...i.entries()].map(([a,m])=>l.jsx("div",{className:"filter-entry",children:l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:m,onClick:()=>{var B;const x=new Map(i);x.set(a,!x.get(a)),r(x);const T=(B=o==null?void 0:o.config)==null?void 0:B.configFile;T&&wt.setObject(T+":projects",[...x.entries()].filter(([_,R])=>R).map(([_])=>_))}}),l.jsx("div",{children:a||"untitled"})]})}))})]})]})},te=At,ee=({statusFilters:n,projectFilters:t,filterText:e,testModel:s,runTests:i,runningState:r,watchAll:o,watchedTreeIds:c,setWatchedTreeIds:h,isLoading:p,onItemSelected:d,setVisibleTestIds:v,requestedCollapseAllCount:g})=>{const[a,m]=f.useState({expandedItems:new Map}),[x,T]=f.useState(),[B,_]=f.useState(g),{rootItem:R,treeItemMap:M,fileNames:X}=f.useMemo(()=>{let u=re(s.rootSuite,s.loadErrors,t);le(u,e,n,r==null?void 0:r.testIds),St(u),u=ae(u),ce(u);const S=new Map,w=new Set,b=new Set,k=E=>{E.kind==="group"&&E.location.file&&b.add(E.location.file),E.kind==="case"&&E.tests.forEach(J=>w.add(J.id)),E.children.forEach(k),S.set(E.id,E)};return k(u),v(w),{rootItem:u,treeItemMap:S,fileNames:b}},[e,s,n,t,v,r]);f.useEffect(()=>{if(B!==g){a.expandedItems.clear();for(const w of M.keys())a.expandedItems.set(w,!1);_(g),T(void 0),m({...a});return}if(!r||r.itemSelectedByUser)return;let u;const S=w=>{var b;w.children.forEach(S),!u&&w.status==="failed"&&(w.kind==="test"&&r.testIds.has(w.test.id)||w.kind==="case"&&r.testIds.has((b=w.tests[0])==null?void 0:b.id))&&(u=w)};S(R),u&&T(u.id)},[r,T,R,B,_,g,a,m,M]);const{selectedTreeItem:et}=f.useMemo(()=>{const u=x?M.get(x):void 0;let S;u&&(S={file:u.location.file,line:u.location.line,source:{errors:s.loadErrors.filter(b=>{var k;return((k=b.location)==null?void 0:k.file)===u.location.file}).map(b=>({line:b.location.line,message:b.message})),content:void 0}});let w;return(u==null?void 0:u.kind)==="test"?w=u.test:(u==null?void 0:u.kind)==="case"&&u.tests.length===1&&(w=u.tests[0]),d({treeItem:u,testCase:w,testFile:S}),{selectedTreeItem:u}},[d,x,s,M]);f.useEffect(()=>{if(!p)if(o)q("watch",{fileNames:[...X]});else{const u=new Set;for(const S of c.value){const w=M.get(S),b=w==null?void 0:w.location.file;b&&u.add(b)}q("watch",{fileNames:[...u]})}},[p,R,X,o,c,M]);const A=u=>{T(u.id),i("bounce-if-busy",rt(u))};return vt=u=>{const S=[],w=new Set(u);if(o){const b=k=>{const E=k.location.file;E&&w.has(E)&&S.push(...rt(k)),k.kind==="group"&&k.subKind==="folder"&&k.children.forEach(b)};b(R)}else for(const b of c.value){const k=M.get(b),E=k==null?void 0:k.location.file;E&&w.has(E)&&S.push(...rt(k))}i("queue-if-busy",new Set(S))},l.jsx(te,{name:"tests",treeState:a,setTreeState:m,rootItem:R,dataTestId:"test-tree",render:u=>l.jsxs("div",{className:"hbox ui-mode-list-item",children:[l.jsx("div",{className:"ui-mode-list-item-title",title:u.title,children:u.title}),!!u.duration&&u.status!=="skipped"&&l.jsx("div",{className:"ui-mode-list-item-time",children:Ft(u.duration)}),l.jsxs(G,{noMinHeight:!0,noShadow:!0,children:[l.jsx(y,{icon:"play",title:"Run",onClick:()=>A(u),disabled:!!r}),l.jsx(y,{icon:"go-to-file",title:"Open in VS Code",onClick:()=>q("open",{location:oe(u)}),style:u.kind==="group"&&u.subKind==="folder"?{visibility:"hidden"}:{}}),!o&&l.jsx(y,{icon:"eye",title:"Watch",onClick:()=>{c.value.has(u.id)?c.value.delete(u.id):c.value.add(u.id),h({...c})},toggled:c.value.has(u.id)})]})]}),icon:u=>It(u.status),selectedItem:et,onAccepted:A,onSelected:u=>{r&&(r.itemSelectedByUser=!0),T(u.id)},isError:u=>u.kind==="group"?u.hasLoadErrors:!1,autoExpandDepth:e?5:1,noItemsMessage:p?"Loading…":"No tests"})},se=({item:n,rootDir:t})=>{var g;const[e,s]=f.useState(),[i,r]=f.useState(0),o=f.useRef(null),{outputDir:c}=f.useMemo(()=>({outputDir:n.testCase?ne(n.testCase):void 0}),[n]),[h,p]=f.useState(),d=f.useCallback(a=>p(dt(a)),[p]),v=h?e==null?void 0:e.model.actions.find(a=>dt(a)===h):void 0;return f.useEffect(()=>{var T,B;o.current&&clearTimeout(o.current);const a=(T=n.testCase)==null?void 0:T.results[0];if(!a){s(void 0);return}const m=a&&a.duration>=0&&a.attachments.find(_=>_.name==="trace");if(m&&m.path){mt(m.path).then(_=>s({model:_,isLive:!1}));return}if(!c){s(void 0);return}const x=`${c}/${Qt(a.workerIndex)}/traces/${(B=n.testCase)==null?void 0:B.id}.json`;return o.current=setTimeout(async()=>{try{const _=await mt(x);s({model:_,isLive:!0})}catch{s(void 0)}finally{r(i+1)}},500),()=>{o.current&&clearTimeout(o.current)}},[c,n,s,i,r]),l.jsx(Wt,{model:e==null?void 0:e.model,hideStackFrames:!0,showSourcesFirst:!0,rootDir:t,initialSelection:v,onSelectionChanged:d,fallbackLocation:n.testFile,isLive:e==null?void 0:e.isLive,status:(g=n.treeItem)==null?void 0:g.status},"workbench")};let H,$,pt,tt,U;const gt=()=>{clearTimeout(tt),tt=void 0,lt(U.config,U.rootSuite,U.loadErrors,U.progress)},K=(n,t,e,s,i=!1)=>{U={config:n,rootSuite:t,loadErrors:e,progress:s},i?gt():tt||(tt=setTimeout(gt,250))},bt=n=>{if(!n)return I("list",{});let t;const e=[],s={total:0,passed:0,failed:0,skipped:0};let i;return H=new ft(Y,{version:()=>"v2",onConfigure:r=>{i=r,$=new ft(Y,{onBegin:o=>{pt=o.allTests().length,$=void 0}},!1)},onBegin:r=>{t||(t=r),s.total=pt,s.passed=0,s.failed=0,s.skipped=0,K(i,t,e,s,!0)},onEnd:()=>{K(i,t,e,s,!0)},onTestBegin:()=>{K(i,t,e,s)},onTestEnd:r=>{r.outcome()==="skipped"?++s.skipped:r.outcome()==="unexpected"?++s.failed:++s.passed,K(i,t,e,s)},onError:r=>{O.write((r.stack||r.value||"")+`
3
- `),e.push(r),K(i,t??new W("","root"),e,s)},printsToStdio:()=>!1,onStdOut:()=>{},onStdErr:()=>{},onExit:()=>{},onStepBegin:()=>{},onStepEnd:()=>{}},!0),H._setClearPreviousResultsWhenTestBegins(),I("list",{})},q=(n,t)=>{if(window._overrideProtocolForTest){window._overrideProtocolForTest({method:n,params:t}).catch(()=>{});return}I(n,t).catch(e=>{console.error(e)})},ie=(n,t)=>{var e,s;if(n==="listChanged"){bt(!1).catch(()=>{});return}if(n==="testFilesChanged"){vt(t.testFileNames);return}if(n==="stdio"){if(t.buffer){const i=atob(t.buffer);O.write(i)}else O.write(t.text);return}(e=$==null?void 0:$.dispatch({method:n,params:t}))==null||e.catch(()=>{}),(s=H==null?void 0:H.dispatch({method:n,params:t}))==null||s.catch(()=>{})},ne=n=>{var t;for(let e=n.parent;e;e=e.parent)if(e.project())return(t=e.project())==null?void 0:t.outputDir},oe=n=>{if(n)return n.location.file+":"+n.location.line},rt=n=>{const t=new Set;if(!n)return t;const e=s=>{var i;s.kind==="case"?s.tests.map(r=>r.id).forEach(r=>t.add(r)):s.kind==="test"?t.add(s.id):(i=s.children)==null||i.forEach(e)};return e(n),t};function at(n,t,e,s){if(t.length===0)return n;const i=t.join(Y),r=s.get(i);if(r)return r;const o=at(n,t.slice(0,t.length-1),!1,s),c={kind:"group",subKind:e?"file":"folder",id:i,title:t[t.length-1],location:{file:i,line:0,column:0},duration:0,parent:o,children:[],status:"none",hasLoadErrors:!1};return o.children.push(c),s.set(i,c),c}function re(n,t,e){const s=[...e.values()].some(Boolean),i={kind:"group",subKind:"folder",id:"root",title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},r=(c,h,p)=>{for(const d of h.suites){const v=d.title||"<anonymous>";let g=p.children.find(a=>a.kind==="group"&&a.title===v);g||(g={kind:"group",subKind:"describe",id:"suite:"+h.titlePath().join("")+""+v,title:v,location:d.location,duration:0,parent:p,children:[],status:"none",hasLoadErrors:!1},p.children.push(g)),r(c,d,g)}for(const d of h.tests){const v=d.title;let g=p.children.find(x=>x.kind!=="group"&&x.title===v);g||(g={kind:"case",id:"test:"+d.titlePath().join(""),title:v,parent:p,children:[],tests:[],location:d.location,duration:0,status:"none"},p.children.push(g));const a=d.results[0];let m="none";(a==null?void 0:a.statusEx)==="scheduled"?m="scheduled":(a==null?void 0:a.statusEx)==="running"?m="running":(a==null?void 0:a.status)==="skipped"?m="skipped":(a==null?void 0:a.status)==="interrupted"?m="none":a&&d.outcome()!=="expected"?m="failed":a&&d.outcome()==="expected"&&(m="passed"),g.tests.push(d),g.children.push({kind:"test",id:d.id,title:c,location:d.location,test:d,parent:g,children:[],status:m,duration:d.results.length?Math.max(0,d.results[0].duration):0,project:c}),g.duration=g.children.reduce((x,T)=>x+T.duration,0)}},o=new Map;for(const c of(n==null?void 0:n.suites)||[])if(!(s&&!e.get(c.title)))for(const h of c.suites){const p=at(i,h.location.file.split(Y),!0,o);r(c.title,h,p)}for(const c of t){if(!c.location)continue;const h=at(i,c.location.file.split(Y),!0,o);h.hasLoadErrors=!0}return i}function le(n,t,e,s){const i=t.trim().toLowerCase().split(" "),r=[...e.values()].some(Boolean),o=h=>{const p=h.tests[0].titlePath().join(" ").toLowerCase();return!i.every(d=>p.includes(d))&&!h.tests.some(d=>s==null?void 0:s.has(d.id))?!1:(h.children=h.children.filter(d=>!r||(s==null?void 0:s.has(d.test.id))||e.get(d.status)),h.tests=h.children.map(d=>d.test),!!h.children.length)},c=h=>{const p=[];for(const d of h.children)d.kind==="case"?o(d)&&p.push(d):(c(d),(d.children.length||d.hasLoadErrors)&&p.push(d));h.children=p};c(n)}function St(n){for(const o of n.children)St(o);n.kind==="group"&&n.children.sort((o,c)=>o.location.file.localeCompare(c.location.file)||o.location.line-c.location.line);let t=n.children.length>0,e=n.children.length>0,s=!1,i=!1,r=!1;for(const o of n.children)e=e&&o.status==="skipped",t=t&&(o.status==="passed"||o.status==="skipped"),s=s||o.status==="failed",i=i||o.status==="running",r=r||o.status==="scheduled";i?n.status="running":r?n.status="scheduled":s?n.status="failed":e?n.status="skipped":t&&(n.status="passed")}function ae(n){let t=n;for(;t.children.length===1&&t.children[0].kind==="group"&&t.children[0].subKind==="folder";)t=t.children[0];return t.location=n.location,t}function ce(n){const t=e=>{e.kind==="case"&&e.children.length===1?e.children=[]:e.children.forEach(t)};t(n)}async function mt(n){const t=new URLSearchParams;t.set("trace",n);const s=await(await fetch(`contexts?${t.toString()}`)).json();return new Ot(s)}const Y=navigator.userAgent.toLowerCase().includes("windows")?"\\":"/";(async()=>{if(zt(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(n=>setTimeout(n,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
4
- Make sure to serve the website (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.oncontrollerchange=()=>n()}),setInterval(function(){fetch("ping")},1e4)}Vt.render(l.jsx(Zt,{}),document.querySelector("#root"))})();
5
- function __vite__mapDeps(indexes) {
6
- if (!__vite__mapDeps.viteFileDeps) {
7
- __vite__mapDeps.viteFileDeps = ["./assets/xtermModule-Yt6xwiJ_.js","./xtermModule.0lwXJFHT.css"]
8
- }
9
- return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
10
- }
@@ -1,4 +0,0 @@
1
- import{u as Mt,r as K,e as Bt,_ as Nt,f as Rt,g as Pt,a as h,j as _,R as f,h as Dt,c as Lt,s as vt,S as Ft,i as tt,T as B,t as It,m as Wt,k as Ot,l as ht,W as jt,M as At,n as zt,b as Vt,d as Kt}from"./assets/wsPort-762c6840.js";class ft{constructor(){this._stringCache=new Map}internString(t){let e=this._stringCache.get(t);return e||(this._stringCache.set(t,t),e=t),e}}class pt{constructor(t,e,s,i){this._tests=new Map,this._listOnly=!1,this._clearPreviousResultsWhenTestBegins=!1,this._stringPool=new ft,this._rootSuite=new j("","root"),this._pathSeparator=t,this._reporter=e,this._reuseTestCases=s,this._reportConfig=i}dispatch(t){const{method:e,params:s}=t;if(e==="onConfigure"){this._onConfigure(s.config);return}if(e==="onProject"){this._onProject(s.project);return}if(e==="onBegin"){this._onBegin();return}if(e==="onTestBegin"){this._onTestBegin(s.testId,s.result);return}if(e==="onTestEnd"){this._onTestEnd(s.test,s.result);return}if(e==="onStepBegin"){this._onStepBegin(s.testId,s.resultId,s.step);return}if(e==="onStepEnd"){this._onStepEnd(s.testId,s.resultId,s.step);return}if(e==="onError"){this._onError(s.error);return}if(e==="onStdIO"){this._onStdIO(s.type,s.testId,s.resultId,s.data,s.isBase64);return}if(e==="onEnd")return this._onEnd(s.result);if(e==="onExit")return this._onExit()}_setClearPreviousResultsWhenTestBegins(){this._clearPreviousResultsWhenTestBegins=!0}_onConfigure(t){var e,s;this._rootDir=t.rootDir,this._listOnly=t.listOnly,this._config=this._parseConfig(t),(s=(e=this._reporter).onConfigure)==null||s.call(e,this._config)}_onProject(t){let e=this._rootSuite.suites.find(i=>i.project().__projectId===t.id);e||(e=new j(t.name,"project"),this._rootSuite.suites.push(e),e.parent=this._rootSuite);const s=this._parseProject(t);if(e.project=()=>s,this._mergeSuitesInto(t.suites,e),this._listOnly){const i=new Set,r=c=>{c.tests.map(a=>a.testId).forEach(a=>i.add(a)),c.suites.forEach(r)};t.suites.forEach(r);const o=c=>{c.tests=c.tests.filter(a=>i.has(a.id)),c.suites.forEach(o)};o(e)}}_onBegin(){var t,e;(e=(t=this._reporter).onBegin)==null||e.call(t,this._rootSuite)}_onTestBegin(t,e){var r,o;const s=this._tests.get(t);this._clearPreviousResultsWhenTestBegins&&s._clearResults();const i=s._createTestResult(e.id);i.retry=e.retry,i.workerIndex=e.workerIndex,i.parallelIndex=e.parallelIndex,i.setStartTimeNumber(e.startTime),i.statusEx="running",(o=(r=this._reporter).onTestBegin)==null||o.call(r,s,i)}_onTestEnd(t,e){var r,o,c;const s=this._tests.get(t.testId);s.timeout=t.timeout,s.expectedStatus=t.expectedStatus,s.annotations=t.annotations;const i=s.resultsMap.get(e.id);i.duration=e.duration,i.status=e.status,i.statusEx=e.status,i.errors=e.errors,i.error=(r=i.errors)==null?void 0:r[0],i.attachments=this._parseAttachments(e.attachments),(c=(o=this._reporter).onTestEnd)==null||c.call(o,s,i),i.stepMap=new Map}_onStepBegin(t,e,s){var p,d;const i=this._tests.get(t),r=i.resultsMap.get(e),o=s.parentStepId?r.stepMap.get(s.parentStepId):void 0,c=this._absoluteLocation(s.location),a=new Ht(s,o,c);o?o.steps.push(a):r.steps.push(a),r.stepMap.set(s.id,a),(d=(p=this._reporter).onStepBegin)==null||d.call(p,i,r,a)}_onStepEnd(t,e,s){var c,a;const i=this._tests.get(t),r=i.resultsMap.get(e),o=r.stepMap.get(s.id);o.duration=s.duration,o.error=s.error,(a=(c=this._reporter).onStepEnd)==null||a.call(c,i,r,o)}_onError(t){var e,s;(s=(e=this._reporter).onError)==null||s.call(e,t)}_onStdIO(t,e,s,i,r){var p,d,b,g;const o=r?globalThis.Buffer?Buffer.from(i,"base64"):atob(i):i,c=e?this._tests.get(e):void 0,a=c&&s?c.resultsMap.get(s):void 0;t==="stdout"?(a==null||a.stdout.push(o),(d=(p=this._reporter).onStdOut)==null||d.call(p,o,c,a)):(a==null||a.stderr.push(o),(g=(b=this._reporter).onStdErr)==null||g.call(b,o,c,a))}async _onEnd(t){var e,s;await((s=(e=this._reporter).onEnd)==null?void 0:s.call(e,{status:t.status,startTime:new Date(t.startTime),duration:t.duration}))}_onExit(){var t,e;return this._stringPool=new ft,(e=(t=this._reporter).onExit)==null?void 0:e.call(t)}_parseConfig(t){const e={...bt,...t};return this._reportConfig&&(e.configFile=this._reportConfig.configFile,e.reportSlowTests=this._reportConfig.reportSlowTests,e.quiet=this._reportConfig.quiet,e.reporter=[...this._reportConfig.reporter]),e}_parseProject(t){return{__projectId:t.id,metadata:t.metadata,name:t.name,outputDir:this._absolutePath(t.outputDir),repeatEach:t.repeatEach,retries:t.retries,testDir:this._absolutePath(t.testDir),testIgnore:G(t.testIgnore),testMatch:G(t.testMatch),timeout:t.timeout,grep:G(t.grep),grepInvert:G(t.grepInvert),dependencies:t.dependencies,teardown:t.teardown,snapshotDir:this._absolutePath(t.snapshotDir),use:{}}}_parseAttachments(t){return t.map(e=>({...e,body:e.base64&&globalThis.Buffer?Buffer.from(e.base64,"base64"):void 0}))}_mergeSuitesInto(t,e){for(const s of t){let i=e.suites.find(r=>r.title===s.title);i||(i=new j(s.title,s.type),i.parent=e,e.suites.push(i)),i.location=this._absoluteLocation(s.location),i._fileId=s.fileId,i._parallelMode=s.parallelMode,this._mergeSuitesInto(s.suites,i),this._mergeTestsInto(s.tests,i)}}_mergeTestsInto(t,e){for(const s of t){let i=this._reuseTestCases?e.tests.find(r=>r.title===s.title):void 0;i||(i=new Ut(s.testId,s.title,this._absoluteLocation(s.location)),i.parent=e,e.tests.push(i),this._tests.set(i.id,i)),this._updateTest(s,i)}}_updateTest(t,e){return e.id=t.testId,e.location=this._absoluteLocation(t.location),e.retries=t.retries,e}_absoluteLocation(t){return t&&{...t,file:this._absolutePath(t.file)}}_absolutePath(t){return t&&this._stringPool.internString(this._rootDir+this._pathSeparator+t)}}class j{constructor(t,e){this._requireFile="",this.suites=[],this.tests=[],this._parallelMode="none",this.title=t,this._type=e}allTests(){const t=[],e=s=>{for(const i of[...s.suites,...s.tests])i instanceof j?e(i):t.push(i)};return e(this),t}titlePath(){const t=this.parent?this.parent.titlePath():[];return(this.title||this._type!=="describe")&&t.push(this.title),t}project(){}}class Ut{constructor(t,e,s){this.fn=()=>{},this.results=[],this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.repeatEachIndex=0,this.resultsMap=new Map,this.id=t,this.title=e,this.location=s}titlePath(){const t=this.parent?this.parent.titlePath():[];return t.push(this.title),t}outcome(){var s,i;const t=[...this.results];for(;((s=t[0])==null?void 0:s.status)==="skipped"||((i=t[0])==null?void 0:i.status)==="interrupted";)t.shift();if(!t.length)return"skipped";const e=t.filter(r=>r.status!=="skipped"&&r.status!=="interrupted"&&r.status!==this.expectedStatus);return e.length?e.length===t.length?"unexpected":"flaky":"expected"}ok(){const t=this.outcome();return t==="expected"||t==="flaky"||t==="skipped"}_clearResults(){this.results=[],this.resultsMap.clear()}_createTestResult(t){const e=new $t(this.results.length);return this.results.push(e),this.resultsMap.set(t,e),e}}class Ht{constructor(t,e,s){this.duration=-1,this.steps=[],this._startTime=0,this.title=t.title,this.category=t.category,this.location=s,this.parent=e,this._startTime=t.startTime}titlePath(){var e;return[...((e=this.parent)==null?void 0:e.titlePath())||[],this.title]}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}class $t{constructor(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.statusEx="scheduled",this._startTime=0,this.retry=t}setStartTimeNumber(t){this._startTime=t}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}const bt={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[{}.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:15e3},configFile:"",rootDir:"",quiet:!1,shard:null,updateSnapshots:"missing",version:"",workers:0,webServer:null};function G(n){return n.map(t=>t.s?t.s:new RegExp(t.r.source,t.r.flags))}const qt=({source:n})=>{const[t,e]=Mt(),[s,i]=K.useState(Bt()),[r]=K.useState(Nt(()=>import("./assets/xtermModule-443332e6.js"),["./assets/xtermModule-443332e6.js","./xtermModule.6428296b.css"],import.meta.url).then(c=>c.default)),o=K.useRef(null);return K.useEffect(()=>(Rt(i),()=>Pt(i)),[]),K.useEffect(()=>{const c=n.write,a=n.clear;return(async()=>{const{Terminal:p,FitAddon:d}=await r,b=e.current;if(!b)return;const g=s==="dark-mode"?Xt:Yt;if(o.current&&o.current.terminal.options.theme===g)return;o.current&&(b.textContent="");const l=new p({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"var(--vscode-editor-font-family)",theme:g}),m=new d;l.loadAddon(m);for(const v of n.pending)l.write(v);n.write=v=>{n.pending.push(v),l.write(v)},n.clear=()=>{n.pending=[],l.clear()},l.open(b),m.fit(),o.current={terminal:l,fitAddon:m}})(),()=>{n.clear=a,n.write=c}},[r,o,e,n,s]),K.useEffect(()=>{setTimeout(()=>{o.current&&(o.current.fitAddon.fit(),n.resize(o.current.terminal.cols,o.current.terminal.rows))},250)},[t,n]),h("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:e})},Yt={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"},Xt={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"};const Jt=({title:n,children:t,setExpanded:e,expanded:s,expandOnTitleClick:i})=>_("div",{className:"expandable"+(s?" expanded":""),children:[_("div",{className:"expandable-title",onClick:()=>i&&e(!s),children:[h("div",{className:"codicon codicon-"+(s?"chevron-down":"chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!i&&e(!s)}),n]}),s&&h("div",{style:{marginLeft:25},children:t})]});function Qt(n){return`.playwright-artifacts-${n}`}let at=()=>{},_t=n=>{},St={cols:80,rows:24},O=async()=>{};const A={pending:[],clear:()=>{},write:n=>A.pending.push(n),resize:(n,t)=>{St={cols:n,rows:t},Y("resizeTerminal",{cols:n,rows:t})}},Zt=({})=>{var dt;const[n,t]=f.useState(""),[e,s]=f.useState(!1),[i,r]=f.useState(new Map([["passed",!1],["failed",!1],["skipped",!1]])),[o,c]=f.useState(new Map),[a,p]=f.useState({config:void 0,rootSuite:void 0,loadErrors:[]}),[d,b]=f.useState(),[g,l]=f.useState({}),[m,v]=f.useState(new Set),[E,N]=f.useState(!1),[S,D]=f.useState(),[R,J]=Dt("watch-all",!1),[st,z]=f.useState({value:new Set}),u=f.useRef(Promise.resolve()),k=f.useRef(new Set),[w,T]=f.useState(0),[C,y]=f.useState(!1),[Q,ut]=f.useState(!0),Et=f.useRef(null),it=f.useCallback(()=>{N(!0),z({value:new Set}),at(bt,new j("","root"),[],void 0),Tt(!0).then(async()=>{N(!1);const{hasBrowsers:x}=await O("checkBrowsers");ut(x)})},[]);f.useEffect(()=>{var x;(x=Et.current)==null||x.focus(),N(!0),Lt({onEvent:ie,onClose:()=>y(!0)}).then(M=>{O=async(L,F)=>{const P=window.__logForTest;P==null||P({method:L,params:F}),await M(L,F)},it()})},[it]),at=f.useCallback((x,M,L,F)=>{const P=x.configFile?vt.getObject(x.configFile+":projects",void 0):void 0;for(const I of o.keys())M.suites.find(Z=>Z.title===I)||o.delete(I);for(const I of M.suites)o.has(I.title)||o.set(I.title,!!(P!=null&&P.includes(I.title)));!P&&o.size&&![...o.values()].includes(!0)&&o.set(o.entries().next().value[0],!0),p({config:x,rootSuite:M,loadErrors:L}),c(new Map(o)),S&&F?b(F):F||b(void 0)},[o,S]);const nt=f.useCallback((x,M)=>{x==="bounce-if-busy"&&S||(k.current=new Set([...k.current,...M]),u.current=u.current.then(async()=>{var P,I,Z;const L=k.current;if(k.current=new Set,!L.size)return;{for(const W of((P=a.rootSuite)==null?void 0:P.allTests())||[])L.has(W.id)&&(W._clearResults(),W._createTestResult("pending"));p({...a})}const F=" ["+new Date().toLocaleTimeString()+"]";A.write("\x1B[2m—".repeat(Math.max(0,St.cols-F.length))+F+"\x1B[22m"),b({total:0,passed:0,failed:0,skipped:0}),D({testIds:L}),await O("run",{testIds:[...L],projects:[...o].filter(([W,yt])=>yt).map(([W])=>W)});for(const W of((I=a.rootSuite)==null?void 0:I.allTests())||[])((Z=W.results[0])==null?void 0:Z.duration)===-1&&W._clearResults();p({...a}),D(void 0)}))},[o,S,a]),V=!!S,ot=f.useRef(null),Ct=f.useCallback(x=>{var M;x.preventDefault(),x.stopPropagation(),(M=ot.current)==null||M.showModal()},[]),rt=f.useCallback(x=>{var M;x.preventDefault(),x.stopPropagation(),(M=ot.current)==null||M.close()},[]),xt=f.useCallback(x=>{rt(x),s(!0),O("installBrowsers").then(async()=>{s(!1);const{hasBrowsers:M}=await O("checkBrowsers");ut(M)})},[rt]);return _("div",{className:"vbox ui-mode",children:[!Q&&_("dialog",{ref:ot,children:[_("div",{className:"title",children:[h("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),_("div",{className:"body",children:["Playwright did not find installed browsers.",h("br",{}),"Would you like to run `playwright install`?",h("br",{}),h("button",{className:"button",onClick:xt,children:"Install"}),h("button",{className:"button secondary",onClick:rt,children:"Dismiss"})]})]}),C&&_("div",{className:"disconnected",children:[h("div",{className:"title",children:"UI Mode disconnected"}),_("div",{children:[h("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),_(Ft,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",children:[_("div",{className:"vbox",children:[_("div",{className:"vbox"+(e?"":" hidden"),children:[_(tt,{children:[h("div",{className:"section-title",style:{flex:"none"},children:"Output"}),h(B,{icon:"circle-slash",title:"Clear output",onClick:()=>A.clear()}),h("div",{className:"spacer"}),h(B,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),h(qt,{source:A})]}),h("div",{className:"vbox"+(e?" hidden":""),children:h(se,{item:g,rootDir:(dt=a.config)==null?void 0:dt.rootDir})})]}),_("div",{className:"vbox ui-mode-sidebar",children:[_(tt,{noShadow:!0,noMinHeight:!0,children:[h("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),h("div",{className:"section-title",children:"Playwright"}),h(B,{icon:"color-mode",title:"Toggle color mode",onClick:()=>It()}),h(B,{icon:"refresh",title:"Reload",onClick:()=>it(),disabled:V||E}),h(B,{icon:"terminal",title:"Toggle output",toggled:e,onClick:()=>{s(!e)}}),!Q&&h(B,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:Ct})]}),h(Gt,{filterText:n,setFilterText:t,statusFilters:i,setStatusFilters:r,projectFilters:o,setProjectFilters:c,testModel:a,runTests:()=>nt("bounce-if-busy",m)}),_(tt,{noMinHeight:!0,children:[!V&&!d&&h("div",{className:"section-title",children:"Tests"}),!V&&d&&h("div",{"data-testid":"status-line",className:"status-line",children:_("div",{children:[d.passed,"/",d.total," passed (",d.passed/d.total*100|0,"%)"]})}),V&&d&&h("div",{"data-testid":"status-line",className:"status-line",children:_("div",{children:["Running ",d.passed,"/",S.testIds.size," passed (",d.passed/S.testIds.size*100|0,"%)"]})}),h(B,{icon:"play",title:"Run all",onClick:()=>nt("bounce-if-busy",m),disabled:V||E}),h(B,{icon:"debug-stop",title:"Stop",onClick:()=>Y("stop"),disabled:!V||E}),h(B,{icon:"eye",title:"Watch all",toggled:R,onClick:()=>{z({value:new Set}),J(!R)}}),h(B,{icon:"collapse-all",title:"Collapse all",onClick:()=>{T(w+1)}})]}),h(ee,{statusFilters:i,projectFilters:o,filterText:n,testModel:a,runningState:S,runTests:nt,onItemSelected:l,setVisibleTestIds:v,watchAll:R,watchedTreeIds:st,setWatchedTreeIds:z,isLoading:E,requestedCollapseAllCount:w})]})]})]})},Gt=({filterText:n,setFilterText:t,statusFilters:e,setStatusFilters:s,projectFilters:i,setProjectFilters:r,testModel:o,runTests:c})=>{const[a,p]=f.useState(!1),d=f.useRef(null);f.useEffect(()=>{var l;(l=d.current)==null||l.focus()},[]);const b=[...e.entries()].filter(([l,m])=>m).map(([l])=>l).join(" ")||"all",g=[...i.entries()].filter(([l,m])=>m).map(([l])=>l).join(" ")||"all";return _("div",{className:"filters",children:[h(Jt,{expanded:a,setExpanded:p,title:h("input",{ref:d,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:n,onChange:l=>{t(l.target.value)},onKeyDown:l=>{l.key==="Enter"&&c()}})}),_("div",{className:"filter-summary",title:"Status: "+b+`
2
- Projects: `+g,onClick:()=>p(!a),children:[h("span",{className:"filter-label",children:"Status:"})," ",b,h("span",{className:"filter-label",children:"Projects:"})," ",g]}),a&&_("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[h("div",{className:"filter-list",children:[...e.entries()].map(([l,m])=>h("div",{className:"filter-entry",children:_("label",{children:[h("input",{type:"checkbox",checked:m,onClick:()=>{const v=new Map(e);v.set(l,!v.get(l)),s(v)}}),h("div",{children:l})]})}))}),h("div",{className:"filter-list",children:[...i.entries()].map(([l,m])=>h("div",{className:"filter-entry",children:_("label",{children:[h("input",{type:"checkbox",checked:m,onClick:()=>{var N;const v=new Map(i);v.set(l,!v.get(l)),r(v);const E=(N=o==null?void 0:o.config)==null?void 0:N.configFile;E&&vt.setObject(E+":projects",[...v.entries()].filter(([S,D])=>D).map(([S])=>S))}}),h("div",{children:l||"untitled"})]})}))})]})]})},te=zt,ee=({statusFilters:n,projectFilters:t,filterText:e,testModel:s,runTests:i,runningState:r,watchAll:o,watchedTreeIds:c,setWatchedTreeIds:a,isLoading:p,onItemSelected:d,setVisibleTestIds:b,requestedCollapseAllCount:g})=>{const[l,m]=f.useState({expandedItems:new Map}),[v,E]=f.useState(),[N,S]=f.useState(g),{rootItem:D,treeItemMap:R,fileNames:J}=f.useMemo(()=>{let u=re(s.rootSuite,s.loadErrors,t);le(u,e,n,r==null?void 0:r.testIds),kt(u),u=ae(u),ce(u);const k=new Map,w=new Set,T=new Set,C=y=>{y.kind==="group"&&y.location.file&&T.add(y.location.file),y.kind==="case"&&y.tests.forEach(Q=>w.add(Q.id)),y.children.forEach(C),k.set(y.id,y)};return C(u),b(w),{rootItem:u,treeItemMap:k,fileNames:T}},[e,s,n,t,b,r]);f.useEffect(()=>{if(N!==g){l.expandedItems.clear();for(const w of R.keys())l.expandedItems.set(w,!1);S(g),E(void 0),m({...l});return}if(!r||r.itemSelectedByUser)return;let u;const k=w=>{var T;w.children.forEach(k),!u&&w.status==="failed"&&(w.kind==="test"&&r.testIds.has(w.test.id)||w.kind==="case"&&r.testIds.has((T=w.tests[0])==null?void 0:T.id))&&(u=w)};k(D),u&&E(u.id)},[r,E,D,N,S,g,l,m,R]);const{selectedTreeItem:st}=f.useMemo(()=>{const u=v?R.get(v):void 0;let k;u&&(k={file:u.location.file,line:u.location.line,source:{errors:s.loadErrors.filter(T=>{var C;return((C=T.location)==null?void 0:C.file)===u.location.file}).map(T=>({line:T.location.line,message:T.message})),content:void 0}});let w;return(u==null?void 0:u.kind)==="test"?w=u.test:(u==null?void 0:u.kind)==="case"&&u.tests.length===1&&(w=u.tests[0]),d({treeItem:u,testCase:w,testFile:k}),{selectedTreeItem:u}},[d,v,s,R]);f.useEffect(()=>{if(!p)if(o)Y("watch",{fileNames:[...J]});else{const u=new Set;for(const k of c.value){const w=R.get(k),T=w==null?void 0:w.location.file;T&&u.add(T)}Y("watch",{fileNames:[...u]})}},[p,D,J,o,c,R]);const z=u=>{E(u.id),i("bounce-if-busy",lt(u))};return _t=u=>{const k=[],w=new Set(u);if(o){const T=C=>{const y=C.location.file;y&&w.has(y)&&k.push(...lt(C)),C.kind==="group"&&C.subKind==="folder"&&C.children.forEach(T)};T(D)}else for(const T of c.value){const C=R.get(T),y=C==null?void 0:C.location.file;y&&w.has(y)&&k.push(...lt(C))}i("queue-if-busy",new Set(k))},h(te,{name:"tests",treeState:l,setTreeState:m,rootItem:D,dataTestId:"test-tree",render:u=>_("div",{className:"hbox ui-mode-list-item",children:[h("div",{className:"ui-mode-list-item-title",title:u.title,children:u.title}),!!u.duration&&u.status!=="skipped"&&h("div",{className:"ui-mode-list-item-time",children:Wt(u.duration)}),_(tt,{noMinHeight:!0,noShadow:!0,children:[h(B,{icon:"play",title:"Run",onClick:()=>z(u),disabled:!!r}),h(B,{icon:"go-to-file",title:"Open in VS Code",onClick:()=>Y("open",{location:oe(u)}),style:u.kind==="group"&&u.subKind==="folder"?{visibility:"hidden"}:{}}),!o&&h(B,{icon:"eye",title:"Watch",onClick:()=>{c.value.has(u.id)?c.value.delete(u.id):c.value.add(u.id),a({...c})},toggled:c.value.has(u.id)})]})]}),icon:u=>Ot(u.status),selectedItem:st,onAccepted:z,onSelected:u=>{r&&(r.itemSelectedByUser=!0),E(u.id)},isError:u=>u.kind==="group"?u.hasLoadErrors:!1,autoExpandDepth:e?5:1,noItemsMessage:p?"Loading…":"No tests"})},se=({item:n,rootDir:t})=>{var g;const[e,s]=f.useState(),[i,r]=f.useState(0),o=f.useRef(null),{outputDir:c}=f.useMemo(()=>({outputDir:n.testCase?ne(n.testCase):void 0}),[n]),[a,p]=f.useState(),d=f.useCallback(l=>p(ht(l)),[p]),b=a?e==null?void 0:e.model.actions.find(l=>ht(l)===a):void 0;return f.useEffect(()=>{var E,N;o.current&&clearTimeout(o.current);const l=(E=n.testCase)==null?void 0:E.results[0];if(!l){s(void 0);return}const m=l&&l.duration>=0&&l.attachments.find(S=>S.name==="trace");if(m&&m.path){wt(m.path).then(S=>s({model:S,isLive:!1}));return}if(!c){s(void 0);return}const v=`${c}/${Qt(l.workerIndex)}/traces/${(N=n.testCase)==null?void 0:N.id}.json`;return o.current=setTimeout(async()=>{try{const S=await wt(v);s({model:S,isLive:!0})}catch{s(void 0)}finally{r(i+1)}},500),()=>{o.current&&clearTimeout(o.current)}},[c,n,s,i,r]),h(jt,{model:e==null?void 0:e.model,hideStackFrames:!0,showSourcesFirst:!0,rootDir:t,initialSelection:b,onSelectionChanged:d,fallbackLocation:n.testFile,isLive:e==null?void 0:e.isLive,status:(g=n.treeItem)==null?void 0:g.status},"workbench")};let $,q,gt,et,H;const mt=()=>{clearTimeout(et),et=void 0,at(H.config,H.rootSuite,H.loadErrors,H.progress)},U=(n,t,e,s,i=!1)=>{H={config:n,rootSuite:t,loadErrors:e,progress:s},i?mt():et||(et=setTimeout(mt,250))},Tt=n=>{if(!n)return O("list",{});let t;const e=[],s={total:0,passed:0,failed:0,skipped:0};let i;return $=new pt(X,{version:()=>"v2",onConfigure:r=>{i=r,q=new pt(X,{onBegin:o=>{gt=o.allTests().length,q=void 0}},!1)},onBegin:r=>{t||(t=r),s.total=gt,s.passed=0,s.failed=0,s.skipped=0,U(i,t,e,s,!0)},onEnd:()=>{U(i,t,e,s,!0)},onTestBegin:()=>{U(i,t,e,s)},onTestEnd:r=>{r.outcome()==="skipped"?++s.skipped:r.outcome()==="unexpected"?++s.failed:++s.passed,U(i,t,e,s)},onError:r=>{A.write((r.stack||r.value||"")+`
3
- `),e.push(r),U(i,t??new j("","root"),e,s)},printsToStdio:()=>!1,onStdOut:()=>{},onStdErr:()=>{},onExit:()=>{},onStepBegin:()=>{},onStepEnd:()=>{}},!0),$._setClearPreviousResultsWhenTestBegins(),O("list",{})},Y=(n,t)=>{if(window._overrideProtocolForTest){window._overrideProtocolForTest({method:n,params:t}).catch(()=>{});return}O(n,t).catch(e=>{console.error(e)})},ie=(n,t)=>{var e,s;if(n==="listChanged"){Tt(!1).catch(()=>{});return}if(n==="testFilesChanged"){_t(t.testFileNames);return}if(n==="stdio"){if(t.buffer){const i=atob(t.buffer);A.write(i)}else A.write(t.text);return}(e=q==null?void 0:q.dispatch({method:n,params:t}))==null||e.catch(()=>{}),(s=$==null?void 0:$.dispatch({method:n,params:t}))==null||s.catch(()=>{})},ne=n=>{var t;for(let e=n.parent;e;e=e.parent)if(e.project())return(t=e.project())==null?void 0:t.outputDir},oe=n=>{if(n)return n.location.file+":"+n.location.line},lt=n=>{const t=new Set;if(!n)return t;const e=s=>{var i;s.kind==="case"?s.tests.map(r=>r.id).forEach(r=>t.add(r)):s.kind==="test"?t.add(s.id):(i=s.children)==null||i.forEach(e)};return e(n),t};function ct(n,t,e,s){if(t.length===0)return n;const i=t.join(X),r=s.get(i);if(r)return r;const o=ct(n,t.slice(0,t.length-1),!1,s),c={kind:"group",subKind:e?"file":"folder",id:i,title:t[t.length-1],location:{file:i,line:0,column:0},duration:0,parent:o,children:[],status:"none",hasLoadErrors:!1};return o.children.push(c),s.set(i,c),c}function re(n,t,e){const s=[...e.values()].some(Boolean),i={kind:"group",subKind:"folder",id:"root",title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},r=(c,a,p)=>{for(const d of a.suites){const b=d.title||"<anonymous>";let g=p.children.find(l=>l.kind==="group"&&l.title===b);g||(g={kind:"group",subKind:"describe",id:"suite:"+a.titlePath().join("")+""+b,title:b,location:d.location,duration:0,parent:p,children:[],status:"none",hasLoadErrors:!1},p.children.push(g)),r(c,d,g)}for(const d of a.tests){const b=d.title;let g=p.children.find(v=>v.kind!=="group"&&v.title===b);g||(g={kind:"case",id:"test:"+d.titlePath().join(""),title:b,parent:p,children:[],tests:[],location:d.location,duration:0,status:"none"},p.children.push(g));const l=d.results[0];let m="none";(l==null?void 0:l.statusEx)==="scheduled"?m="scheduled":(l==null?void 0:l.statusEx)==="running"?m="running":(l==null?void 0:l.status)==="skipped"?m="skipped":(l==null?void 0:l.status)==="interrupted"?m="none":l&&d.outcome()!=="expected"?m="failed":l&&d.outcome()==="expected"&&(m="passed"),g.tests.push(d),g.children.push({kind:"test",id:d.id,title:c,location:d.location,test:d,parent:g,children:[],status:m,duration:d.results.length?Math.max(0,d.results[0].duration):0,project:c}),g.duration=g.children.reduce((v,E)=>v+E.duration,0)}},o=new Map;for(const c of(n==null?void 0:n.suites)||[])if(!(s&&!e.get(c.title)))for(const a of c.suites){const p=ct(i,a.location.file.split(X),!0,o);r(c.title,a,p)}for(const c of t){if(!c.location)continue;const a=ct(i,c.location.file.split(X),!0,o);a.hasLoadErrors=!0}return i}function le(n,t,e,s){const i=t.trim().toLowerCase().split(" "),r=[...e.values()].some(Boolean),o=a=>{const p=a.tests[0].titlePath().join(" ").toLowerCase();return!i.every(d=>p.includes(d))&&!a.tests.some(d=>s==null?void 0:s.has(d.id))?!1:(a.children=a.children.filter(d=>!r||(s==null?void 0:s.has(d.test.id))||e.get(d.status)),a.tests=a.children.map(d=>d.test),!!a.children.length)},c=a=>{const p=[];for(const d of a.children)d.kind==="case"?o(d)&&p.push(d):(c(d),(d.children.length||d.hasLoadErrors)&&p.push(d));a.children=p};c(n)}function kt(n){for(const o of n.children)kt(o);n.kind==="group"&&n.children.sort((o,c)=>o.location.file.localeCompare(c.location.file)||o.location.line-c.location.line);let t=n.children.length>0,e=n.children.length>0,s=!1,i=!1,r=!1;for(const o of n.children)e=e&&o.status==="skipped",t=t&&(o.status==="passed"||o.status==="skipped"),s=s||o.status==="failed",i=i||o.status==="running",r=r||o.status==="scheduled";i?n.status="running":r?n.status="scheduled":s?n.status="failed":e?n.status="skipped":t&&(n.status="passed")}function ae(n){let t=n;for(;t.children.length===1&&t.children[0].kind==="group"&&t.children[0].subKind==="folder";)t=t.children[0];return t.location=n.location,t}function ce(n){const t=e=>{e.kind==="case"&&e.children.length===1?e.children=[]:e.children.forEach(t)};t(n)}async function wt(n){const t=new URLSearchParams;t.set("trace",n);const s=await(await fetch(`contexts?${t.toString()}`)).json();return new At(s)}const X=navigator.userAgent.toLowerCase().includes("windows")?"\\":"/";(async()=>{if(Vt(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(n=>setTimeout(n,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
4
- Make sure to serve the website (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.oncontrollerchange=()=>n()}),setInterval(function(){fetch("ping")},1e4)}Kt.render(h(Zt,{}),document.querySelector("#root"))})();
@@ -1,4 +0,0 @@
1
- import{u as Mt,r as K,e as Bt,_ as Nt,f as Rt,g as Pt,a as h,j as _,R as f,h as Dt,c as Lt,s as vt,S as Ft,i as tt,T as B,t as It,m as Wt,k as Ot,l as ht,W as jt,M as At,n as zt,b as Vt,d as Kt}from"./assets/wsPort-722747dc.js";class ft{constructor(){this._stringCache=new Map}internString(t){let e=this._stringCache.get(t);return e||(this._stringCache.set(t,t),e=t),e}}class pt{constructor(t,e,s,i){this._tests=new Map,this._listOnly=!1,this._clearPreviousResultsWhenTestBegins=!1,this._stringPool=new ft,this._rootSuite=new j("","root"),this._pathSeparator=t,this._reporter=e,this._reuseTestCases=s,this._reportConfig=i}dispatch(t){const{method:e,params:s}=t;if(e==="onConfigure"){this._onConfigure(s.config);return}if(e==="onProject"){this._onProject(s.project);return}if(e==="onBegin"){this._onBegin();return}if(e==="onTestBegin"){this._onTestBegin(s.testId,s.result);return}if(e==="onTestEnd"){this._onTestEnd(s.test,s.result);return}if(e==="onStepBegin"){this._onStepBegin(s.testId,s.resultId,s.step);return}if(e==="onStepEnd"){this._onStepEnd(s.testId,s.resultId,s.step);return}if(e==="onError"){this._onError(s.error);return}if(e==="onStdIO"){this._onStdIO(s.type,s.testId,s.resultId,s.data,s.isBase64);return}if(e==="onEnd")return this._onEnd(s.result);if(e==="onExit")return this._onExit()}_setClearPreviousResultsWhenTestBegins(){this._clearPreviousResultsWhenTestBegins=!0}_onConfigure(t){var e,s;this._rootDir=t.rootDir,this._listOnly=t.listOnly,this._config=this._parseConfig(t),(s=(e=this._reporter).onConfigure)==null||s.call(e,this._config)}_onProject(t){let e=this._rootSuite.suites.find(i=>i.project().__projectId===t.id);e||(e=new j(t.name,"project"),this._rootSuite.suites.push(e),e.parent=this._rootSuite);const s=this._parseProject(t);if(e.project=()=>s,this._mergeSuitesInto(t.suites,e),this._listOnly){const i=new Set,r=c=>{c.tests.map(a=>a.testId).forEach(a=>i.add(a)),c.suites.forEach(r)};t.suites.forEach(r);const o=c=>{c.tests=c.tests.filter(a=>i.has(a.id)),c.suites.forEach(o)};o(e)}}_onBegin(){var t,e;(e=(t=this._reporter).onBegin)==null||e.call(t,this._rootSuite)}_onTestBegin(t,e){var r,o;const s=this._tests.get(t);this._clearPreviousResultsWhenTestBegins&&s._clearResults();const i=s._createTestResult(e.id);i.retry=e.retry,i.workerIndex=e.workerIndex,i.parallelIndex=e.parallelIndex,i.setStartTimeNumber(e.startTime),i.statusEx="running",(o=(r=this._reporter).onTestBegin)==null||o.call(r,s,i)}_onTestEnd(t,e){var r,o,c;const s=this._tests.get(t.testId);s.timeout=t.timeout,s.expectedStatus=t.expectedStatus,s.annotations=t.annotations;const i=s.resultsMap.get(e.id);i.duration=e.duration,i.status=e.status,i.statusEx=e.status,i.errors=e.errors,i.error=(r=i.errors)==null?void 0:r[0],i.attachments=this._parseAttachments(e.attachments),(c=(o=this._reporter).onTestEnd)==null||c.call(o,s,i),i.stepMap=new Map}_onStepBegin(t,e,s){var p,d;const i=this._tests.get(t),r=i.resultsMap.get(e),o=s.parentStepId?r.stepMap.get(s.parentStepId):void 0,c=this._absoluteLocation(s.location),a=new Ht(s,o,c);o?o.steps.push(a):r.steps.push(a),r.stepMap.set(s.id,a),(d=(p=this._reporter).onStepBegin)==null||d.call(p,i,r,a)}_onStepEnd(t,e,s){var c,a;const i=this._tests.get(t),r=i.resultsMap.get(e),o=r.stepMap.get(s.id);o.duration=s.duration,o.error=s.error,(a=(c=this._reporter).onStepEnd)==null||a.call(c,i,r,o)}_onError(t){var e,s;(s=(e=this._reporter).onError)==null||s.call(e,t)}_onStdIO(t,e,s,i,r){var p,d,b,g;const o=r?globalThis.Buffer?Buffer.from(i,"base64"):atob(i):i,c=e?this._tests.get(e):void 0,a=c&&s?c.resultsMap.get(s):void 0;t==="stdout"?(a==null||a.stdout.push(o),(d=(p=this._reporter).onStdOut)==null||d.call(p,o,c,a)):(a==null||a.stderr.push(o),(g=(b=this._reporter).onStdErr)==null||g.call(b,o,c,a))}async _onEnd(t){var e,s;await((s=(e=this._reporter).onEnd)==null?void 0:s.call(e,{status:t.status,startTime:new Date(t.startTime),duration:t.duration}))}_onExit(){var t,e;return this._stringPool=new ft,(e=(t=this._reporter).onExit)==null?void 0:e.call(t)}_parseConfig(t){const e={...bt,...t};return this._reportConfig&&(e.configFile=this._reportConfig.configFile,e.reportSlowTests=this._reportConfig.reportSlowTests,e.quiet=this._reportConfig.quiet,e.reporter=[...this._reportConfig.reporter]),e}_parseProject(t){return{__projectId:t.id,metadata:t.metadata,name:t.name,outputDir:this._absolutePath(t.outputDir),repeatEach:t.repeatEach,retries:t.retries,testDir:this._absolutePath(t.testDir),testIgnore:G(t.testIgnore),testMatch:G(t.testMatch),timeout:t.timeout,grep:G(t.grep),grepInvert:G(t.grepInvert),dependencies:t.dependencies,teardown:t.teardown,snapshotDir:this._absolutePath(t.snapshotDir),use:{}}}_parseAttachments(t){return t.map(e=>({...e,body:e.base64&&globalThis.Buffer?Buffer.from(e.base64,"base64"):void 0}))}_mergeSuitesInto(t,e){for(const s of t){let i=e.suites.find(r=>r.title===s.title);i||(i=new j(s.title,s.type),i.parent=e,e.suites.push(i)),i.location=this._absoluteLocation(s.location),i._fileId=s.fileId,i._parallelMode=s.parallelMode,this._mergeSuitesInto(s.suites,i),this._mergeTestsInto(s.tests,i)}}_mergeTestsInto(t,e){for(const s of t){let i=this._reuseTestCases?e.tests.find(r=>r.title===s.title):void 0;i||(i=new Ut(s.testId,s.title,this._absoluteLocation(s.location)),i.parent=e,e.tests.push(i),this._tests.set(i.id,i)),this._updateTest(s,i)}}_updateTest(t,e){return e.id=t.testId,e.location=this._absoluteLocation(t.location),e.retries=t.retries,e}_absoluteLocation(t){return t&&{...t,file:this._absolutePath(t.file)}}_absolutePath(t){return t&&this._stringPool.internString(this._rootDir+this._pathSeparator+t)}}class j{constructor(t,e){this._requireFile="",this.suites=[],this.tests=[],this._parallelMode="none",this.title=t,this._type=e}allTests(){const t=[],e=s=>{for(const i of[...s.suites,...s.tests])i instanceof j?e(i):t.push(i)};return e(this),t}titlePath(){const t=this.parent?this.parent.titlePath():[];return(this.title||this._type!=="describe")&&t.push(this.title),t}project(){}}class Ut{constructor(t,e,s){this.fn=()=>{},this.results=[],this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.repeatEachIndex=0,this.resultsMap=new Map,this.id=t,this.title=e,this.location=s}titlePath(){const t=this.parent?this.parent.titlePath():[];return t.push(this.title),t}outcome(){var s,i;const t=[...this.results];for(;((s=t[0])==null?void 0:s.status)==="skipped"||((i=t[0])==null?void 0:i.status)==="interrupted";)t.shift();if(!t.length)return"skipped";const e=t.filter(r=>r.status!=="skipped"&&r.status!=="interrupted"&&r.status!==this.expectedStatus);return e.length?e.length===t.length?"unexpected":"flaky":"expected"}ok(){const t=this.outcome();return t==="expected"||t==="flaky"||t==="skipped"}_clearResults(){this.results=[],this.resultsMap.clear()}_createTestResult(t){const e=new $t(this.results.length);return this.results.push(e),this.resultsMap.set(t,e),e}}class Ht{constructor(t,e,s){this.duration=-1,this.steps=[],this._startTime=0,this.title=t.title,this.category=t.category,this.location=s,this.parent=e,this._startTime=t.startTime}titlePath(){var e;return[...((e=this.parent)==null?void 0:e.titlePath())||[],this.title]}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}class $t{constructor(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.statusEx="scheduled",this._startTime=0,this.retry=t}setStartTimeNumber(t){this._startTime=t}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}const bt={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[{}.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:15e3},configFile:"",rootDir:"",quiet:!1,shard:null,updateSnapshots:"missing",version:"",workers:0,webServer:null};function G(n){return n.map(t=>t.s?t.s:new RegExp(t.r.source,t.r.flags))}const qt=({source:n})=>{const[t,e]=Mt(),[s,i]=K.useState(Bt()),[r]=K.useState(Nt(()=>import("./assets/xtermModule-443332e6.js"),["./assets/xtermModule-443332e6.js","./xtermModule.6428296b.css"],import.meta.url).then(c=>c.default)),o=K.useRef(null);return K.useEffect(()=>(Rt(i),()=>Pt(i)),[]),K.useEffect(()=>{const c=n.write,a=n.clear;return(async()=>{const{Terminal:p,FitAddon:d}=await r,b=e.current;if(!b)return;const g=s==="dark-mode"?Xt:Yt;if(o.current&&o.current.terminal.options.theme===g)return;o.current&&(b.textContent="");const l=new p({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"var(--vscode-editor-font-family)",theme:g}),m=new d;l.loadAddon(m);for(const v of n.pending)l.write(v);n.write=v=>{n.pending.push(v),l.write(v)},n.clear=()=>{n.pending=[],l.clear()},l.open(b),m.fit(),o.current={terminal:l,fitAddon:m}})(),()=>{n.clear=a,n.write=c}},[r,o,e,n,s]),K.useEffect(()=>{setTimeout(()=>{o.current&&(o.current.fitAddon.fit(),n.resize(o.current.terminal.cols,o.current.terminal.rows))},250)},[t,n]),h("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:e})},Yt={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"},Xt={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"};const Jt=({title:n,children:t,setExpanded:e,expanded:s,expandOnTitleClick:i})=>_("div",{className:"expandable"+(s?" expanded":""),children:[_("div",{className:"expandable-title",onClick:()=>i&&e(!s),children:[h("div",{className:"codicon codicon-"+(s?"chevron-down":"chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!i&&e(!s)}),n]}),s&&h("div",{style:{marginLeft:25},children:t})]});function Qt(n){return`.playwright-artifacts-${n}`}let at=()=>{},_t=n=>{},St={cols:80,rows:24},O=async()=>{};const A={pending:[],clear:()=>{},write:n=>A.pending.push(n),resize:(n,t)=>{St={cols:n,rows:t},Y("resizeTerminal",{cols:n,rows:t})}},Zt=({})=>{var dt;const[n,t]=f.useState(""),[e,s]=f.useState(!1),[i,r]=f.useState(new Map([["passed",!1],["failed",!1],["skipped",!1]])),[o,c]=f.useState(new Map),[a,p]=f.useState({config:void 0,rootSuite:void 0,loadErrors:[]}),[d,b]=f.useState(),[g,l]=f.useState({}),[m,v]=f.useState(new Set),[E,N]=f.useState(!1),[S,D]=f.useState(),[R,J]=Dt("watch-all",!1),[st,z]=f.useState({value:new Set}),u=f.useRef(Promise.resolve()),k=f.useRef(new Set),[w,T]=f.useState(0),[C,y]=f.useState(!1),[Q,ut]=f.useState(!0),Et=f.useRef(null),it=f.useCallback(()=>{N(!0),z({value:new Set}),at(bt,new j("","root"),[],void 0),Tt(!0).then(async()=>{N(!1);const{hasBrowsers:x}=await O("checkBrowsers");ut(x)})},[]);f.useEffect(()=>{var x;(x=Et.current)==null||x.focus(),N(!0),Lt({onEvent:ie,onClose:()=>y(!0)}).then(M=>{O=async(L,F)=>{const P=window.__logForTest;P==null||P({method:L,params:F}),await M(L,F)},it()})},[it]),at=f.useCallback((x,M,L,F)=>{const P=x.configFile?vt.getObject(x.configFile+":projects",void 0):void 0;for(const I of o.keys())M.suites.find(Z=>Z.title===I)||o.delete(I);for(const I of M.suites)o.has(I.title)||o.set(I.title,!!(P!=null&&P.includes(I.title)));!P&&o.size&&![...o.values()].includes(!0)&&o.set(o.entries().next().value[0],!0),p({config:x,rootSuite:M,loadErrors:L}),c(new Map(o)),S&&F?b(F):F||b(void 0)},[o,S]);const nt=f.useCallback((x,M)=>{x==="bounce-if-busy"&&S||(k.current=new Set([...k.current,...M]),u.current=u.current.then(async()=>{var P,I,Z;const L=k.current;if(k.current=new Set,!L.size)return;{for(const W of((P=a.rootSuite)==null?void 0:P.allTests())||[])L.has(W.id)&&(W._clearResults(),W._createTestResult("pending"));p({...a})}const F=" ["+new Date().toLocaleTimeString()+"]";A.write("\x1B[2m—".repeat(Math.max(0,St.cols-F.length))+F+"\x1B[22m"),b({total:0,passed:0,failed:0,skipped:0}),D({testIds:L}),await O("run",{testIds:[...L],projects:[...o].filter(([W,yt])=>yt).map(([W])=>W)});for(const W of((I=a.rootSuite)==null?void 0:I.allTests())||[])((Z=W.results[0])==null?void 0:Z.duration)===-1&&W._clearResults();p({...a}),D(void 0)}))},[o,S,a]),V=!!S,ot=f.useRef(null),Ct=f.useCallback(x=>{var M;x.preventDefault(),x.stopPropagation(),(M=ot.current)==null||M.showModal()},[]),rt=f.useCallback(x=>{var M;x.preventDefault(),x.stopPropagation(),(M=ot.current)==null||M.close()},[]),xt=f.useCallback(x=>{rt(x),s(!0),O("installBrowsers").then(async()=>{s(!1);const{hasBrowsers:M}=await O("checkBrowsers");ut(M)})},[rt]);return _("div",{className:"vbox ui-mode",children:[!Q&&_("dialog",{ref:ot,children:[_("div",{className:"title",children:[h("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),_("div",{className:"body",children:["Playwright did not find installed browsers.",h("br",{}),"Would you like to run `playwright install`?",h("br",{}),h("button",{className:"button",onClick:xt,children:"Install"}),h("button",{className:"button secondary",onClick:rt,children:"Dismiss"})]})]}),C&&_("div",{className:"disconnected",children:[h("div",{className:"title",children:"UI Mode disconnected"}),_("div",{children:[h("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),_(Ft,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",children:[_("div",{className:"vbox",children:[_("div",{className:"vbox"+(e?"":" hidden"),children:[_(tt,{children:[h("div",{className:"section-title",style:{flex:"none"},children:"Output"}),h(B,{icon:"circle-slash",title:"Clear output",onClick:()=>A.clear()}),h("div",{className:"spacer"}),h(B,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),h(qt,{source:A})]}),h("div",{className:"vbox"+(e?" hidden":""),children:h(se,{item:g,rootDir:(dt=a.config)==null?void 0:dt.rootDir})})]}),_("div",{className:"vbox ui-mode-sidebar",children:[_(tt,{noShadow:!0,noMinHeight:!0,children:[h("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),h("div",{className:"section-title",children:"Playwright"}),h(B,{icon:"color-mode",title:"Toggle color mode",onClick:()=>It()}),h(B,{icon:"refresh",title:"Reload",onClick:()=>it(),disabled:V||E}),h(B,{icon:"terminal",title:"Toggle output",toggled:e,onClick:()=>{s(!e)}}),!Q&&h(B,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:Ct})]}),h(Gt,{filterText:n,setFilterText:t,statusFilters:i,setStatusFilters:r,projectFilters:o,setProjectFilters:c,testModel:a,runTests:()=>nt("bounce-if-busy",m)}),_(tt,{noMinHeight:!0,children:[!V&&!d&&h("div",{className:"section-title",children:"Tests"}),!V&&d&&h("div",{"data-testid":"status-line",className:"status-line",children:_("div",{children:[d.passed,"/",d.total," passed (",d.passed/d.total*100|0,"%)"]})}),V&&d&&h("div",{"data-testid":"status-line",className:"status-line",children:_("div",{children:["Running ",d.passed,"/",S.testIds.size," passed (",d.passed/S.testIds.size*100|0,"%)"]})}),h(B,{icon:"play",title:"Run all",onClick:()=>nt("bounce-if-busy",m),disabled:V||E}),h(B,{icon:"debug-stop",title:"Stop",onClick:()=>Y("stop"),disabled:!V||E}),h(B,{icon:"eye",title:"Watch all",toggled:R,onClick:()=>{z({value:new Set}),J(!R)}}),h(B,{icon:"collapse-all",title:"Collapse all",onClick:()=>{T(w+1)}})]}),h(ee,{statusFilters:i,projectFilters:o,filterText:n,testModel:a,runningState:S,runTests:nt,onItemSelected:l,setVisibleTestIds:v,watchAll:R,watchedTreeIds:st,setWatchedTreeIds:z,isLoading:E,requestedCollapseAllCount:w})]})]})]})},Gt=({filterText:n,setFilterText:t,statusFilters:e,setStatusFilters:s,projectFilters:i,setProjectFilters:r,testModel:o,runTests:c})=>{const[a,p]=f.useState(!1),d=f.useRef(null);f.useEffect(()=>{var l;(l=d.current)==null||l.focus()},[]);const b=[...e.entries()].filter(([l,m])=>m).map(([l])=>l).join(" ")||"all",g=[...i.entries()].filter(([l,m])=>m).map(([l])=>l).join(" ")||"all";return _("div",{className:"filters",children:[h(Jt,{expanded:a,setExpanded:p,title:h("input",{ref:d,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:n,onChange:l=>{t(l.target.value)},onKeyDown:l=>{l.key==="Enter"&&c()}})}),_("div",{className:"filter-summary",title:"Status: "+b+`
2
- Projects: `+g,onClick:()=>p(!a),children:[h("span",{className:"filter-label",children:"Status:"})," ",b,h("span",{className:"filter-label",children:"Projects:"})," ",g]}),a&&_("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[h("div",{className:"filter-list",children:[...e.entries()].map(([l,m])=>h("div",{className:"filter-entry",children:_("label",{children:[h("input",{type:"checkbox",checked:m,onClick:()=>{const v=new Map(e);v.set(l,!v.get(l)),s(v)}}),h("div",{children:l})]})}))}),h("div",{className:"filter-list",children:[...i.entries()].map(([l,m])=>h("div",{className:"filter-entry",children:_("label",{children:[h("input",{type:"checkbox",checked:m,onClick:()=>{var N;const v=new Map(i);v.set(l,!v.get(l)),r(v);const E=(N=o==null?void 0:o.config)==null?void 0:N.configFile;E&&vt.setObject(E+":projects",[...v.entries()].filter(([S,D])=>D).map(([S])=>S))}}),h("div",{children:l||"untitled"})]})}))})]})]})},te=zt,ee=({statusFilters:n,projectFilters:t,filterText:e,testModel:s,runTests:i,runningState:r,watchAll:o,watchedTreeIds:c,setWatchedTreeIds:a,isLoading:p,onItemSelected:d,setVisibleTestIds:b,requestedCollapseAllCount:g})=>{const[l,m]=f.useState({expandedItems:new Map}),[v,E]=f.useState(),[N,S]=f.useState(g),{rootItem:D,treeItemMap:R,fileNames:J}=f.useMemo(()=>{let u=re(s.rootSuite,s.loadErrors,t);le(u,e,n,r==null?void 0:r.testIds),kt(u),u=ae(u),ce(u);const k=new Map,w=new Set,T=new Set,C=y=>{y.kind==="group"&&y.location.file&&T.add(y.location.file),y.kind==="case"&&y.tests.forEach(Q=>w.add(Q.id)),y.children.forEach(C),k.set(y.id,y)};return C(u),b(w),{rootItem:u,treeItemMap:k,fileNames:T}},[e,s,n,t,b,r]);f.useEffect(()=>{if(N!==g){l.expandedItems.clear();for(const w of R.keys())l.expandedItems.set(w,!1);S(g),E(void 0),m({...l});return}if(!r||r.itemSelectedByUser)return;let u;const k=w=>{var T;w.children.forEach(k),!u&&w.status==="failed"&&(w.kind==="test"&&r.testIds.has(w.test.id)||w.kind==="case"&&r.testIds.has((T=w.tests[0])==null?void 0:T.id))&&(u=w)};k(D),u&&E(u.id)},[r,E,D,N,S,g,l,m,R]);const{selectedTreeItem:st}=f.useMemo(()=>{const u=v?R.get(v):void 0;let k;u&&(k={file:u.location.file,line:u.location.line,source:{errors:s.loadErrors.filter(T=>{var C;return((C=T.location)==null?void 0:C.file)===u.location.file}).map(T=>({line:T.location.line,message:T.message})),content:void 0}});let w;return(u==null?void 0:u.kind)==="test"?w=u.test:(u==null?void 0:u.kind)==="case"&&u.tests.length===1&&(w=u.tests[0]),d({treeItem:u,testCase:w,testFile:k}),{selectedTreeItem:u}},[d,v,s,R]);f.useEffect(()=>{if(!p)if(o)Y("watch",{fileNames:[...J]});else{const u=new Set;for(const k of c.value){const w=R.get(k),T=w==null?void 0:w.location.file;T&&u.add(T)}Y("watch",{fileNames:[...u]})}},[p,D,J,o,c,R]);const z=u=>{E(u.id),i("bounce-if-busy",lt(u))};return _t=u=>{const k=[],w=new Set(u);if(o){const T=C=>{const y=C.location.file;y&&w.has(y)&&k.push(...lt(C)),C.kind==="group"&&C.subKind==="folder"&&C.children.forEach(T)};T(D)}else for(const T of c.value){const C=R.get(T),y=C==null?void 0:C.location.file;y&&w.has(y)&&k.push(...lt(C))}i("queue-if-busy",new Set(k))},h(te,{name:"tests",treeState:l,setTreeState:m,rootItem:D,dataTestId:"test-tree",render:u=>_("div",{className:"hbox ui-mode-list-item",children:[h("div",{className:"ui-mode-list-item-title",title:u.title,children:u.title}),!!u.duration&&u.status!=="skipped"&&h("div",{className:"ui-mode-list-item-time",children:Wt(u.duration)}),_(tt,{noMinHeight:!0,noShadow:!0,children:[h(B,{icon:"play",title:"Run",onClick:()=>z(u),disabled:!!r}),h(B,{icon:"go-to-file",title:"Open in VS Code",onClick:()=>Y("open",{location:oe(u)}),style:u.kind==="group"&&u.subKind==="folder"?{visibility:"hidden"}:{}}),!o&&h(B,{icon:"eye",title:"Watch",onClick:()=>{c.value.has(u.id)?c.value.delete(u.id):c.value.add(u.id),a({...c})},toggled:c.value.has(u.id)})]})]}),icon:u=>Ot(u.status),selectedItem:st,onAccepted:z,onSelected:u=>{r&&(r.itemSelectedByUser=!0),E(u.id)},isError:u=>u.kind==="group"?u.hasLoadErrors:!1,autoExpandDepth:e?5:1,noItemsMessage:p?"Loading…":"No tests"})},se=({item:n,rootDir:t})=>{var g;const[e,s]=f.useState(),[i,r]=f.useState(0),o=f.useRef(null),{outputDir:c}=f.useMemo(()=>({outputDir:n.testCase?ne(n.testCase):void 0}),[n]),[a,p]=f.useState(),d=f.useCallback(l=>p(ht(l)),[p]),b=a?e==null?void 0:e.model.actions.find(l=>ht(l)===a):void 0;return f.useEffect(()=>{var E,N;o.current&&clearTimeout(o.current);const l=(E=n.testCase)==null?void 0:E.results[0];if(!l){s(void 0);return}const m=l&&l.duration>=0&&l.attachments.find(S=>S.name==="trace");if(m&&m.path){wt(m.path).then(S=>s({model:S,isLive:!1}));return}if(!c){s(void 0);return}const v=`${c}/${Qt(l.workerIndex)}/traces/${(N=n.testCase)==null?void 0:N.id}.json`;return o.current=setTimeout(async()=>{try{const S=await wt(v);s({model:S,isLive:!0})}catch{s(void 0)}finally{r(i+1)}},500),()=>{o.current&&clearTimeout(o.current)}},[c,n,s,i,r]),h(jt,{model:e==null?void 0:e.model,hideStackFrames:!0,showSourcesFirst:!0,rootDir:t,initialSelection:b,onSelectionChanged:d,fallbackLocation:n.testFile,isLive:e==null?void 0:e.isLive,status:(g=n.treeItem)==null?void 0:g.status},"workbench")};let $,q,gt,et,H;const mt=()=>{clearTimeout(et),et=void 0,at(H.config,H.rootSuite,H.loadErrors,H.progress)},U=(n,t,e,s,i=!1)=>{H={config:n,rootSuite:t,loadErrors:e,progress:s},i?mt():et||(et=setTimeout(mt,250))},Tt=n=>{if(!n)return O("list",{});let t;const e=[],s={total:0,passed:0,failed:0,skipped:0};let i;return $=new pt(X,{version:()=>"v2",onConfigure:r=>{i=r,q=new pt(X,{onBegin:o=>{gt=o.allTests().length,q=void 0}},!1)},onBegin:r=>{t||(t=r),s.total=gt,s.passed=0,s.failed=0,s.skipped=0,U(i,t,e,s,!0)},onEnd:()=>{U(i,t,e,s,!0)},onTestBegin:()=>{U(i,t,e,s)},onTestEnd:r=>{r.outcome()==="skipped"?++s.skipped:r.outcome()==="unexpected"?++s.failed:++s.passed,U(i,t,e,s)},onError:r=>{A.write((r.stack||r.value||"")+`
3
- `),e.push(r),U(i,t??new j("","root"),e,s)},printsToStdio:()=>!1,onStdOut:()=>{},onStdErr:()=>{},onExit:()=>{},onStepBegin:()=>{},onStepEnd:()=>{}},!0),$._setClearPreviousResultsWhenTestBegins(),O("list",{})},Y=(n,t)=>{if(window._overrideProtocolForTest){window._overrideProtocolForTest({method:n,params:t}).catch(()=>{});return}O(n,t).catch(e=>{console.error(e)})},ie=(n,t)=>{var e,s;if(n==="listChanged"){Tt(!1).catch(()=>{});return}if(n==="testFilesChanged"){_t(t.testFileNames);return}if(n==="stdio"){if(t.buffer){const i=atob(t.buffer);A.write(i)}else A.write(t.text);return}(e=q==null?void 0:q.dispatch({method:n,params:t}))==null||e.catch(()=>{}),(s=$==null?void 0:$.dispatch({method:n,params:t}))==null||s.catch(()=>{})},ne=n=>{var t;for(let e=n.parent;e;e=e.parent)if(e.project())return(t=e.project())==null?void 0:t.outputDir},oe=n=>{if(n)return n.location.file+":"+n.location.line},lt=n=>{const t=new Set;if(!n)return t;const e=s=>{var i;s.kind==="case"?s.tests.map(r=>r.id).forEach(r=>t.add(r)):s.kind==="test"?t.add(s.id):(i=s.children)==null||i.forEach(e)};return e(n),t};function ct(n,t,e,s){if(t.length===0)return n;const i=t.join(X),r=s.get(i);if(r)return r;const o=ct(n,t.slice(0,t.length-1),!1,s),c={kind:"group",subKind:e?"file":"folder",id:i,title:t[t.length-1],location:{file:i,line:0,column:0},duration:0,parent:o,children:[],status:"none",hasLoadErrors:!1};return o.children.push(c),s.set(i,c),c}function re(n,t,e){const s=[...e.values()].some(Boolean),i={kind:"group",subKind:"folder",id:"root",title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},r=(c,a,p)=>{for(const d of a.suites){const b=d.title||"<anonymous>";let g=p.children.find(l=>l.kind==="group"&&l.title===b);g||(g={kind:"group",subKind:"describe",id:"suite:"+a.titlePath().join("")+""+b,title:b,location:d.location,duration:0,parent:p,children:[],status:"none",hasLoadErrors:!1},p.children.push(g)),r(c,d,g)}for(const d of a.tests){const b=d.title;let g=p.children.find(v=>v.kind!=="group"&&v.title===b);g||(g={kind:"case",id:"test:"+d.titlePath().join(""),title:b,parent:p,children:[],tests:[],location:d.location,duration:0,status:"none"},p.children.push(g));const l=d.results[0];let m="none";(l==null?void 0:l.statusEx)==="scheduled"?m="scheduled":(l==null?void 0:l.statusEx)==="running"?m="running":(l==null?void 0:l.status)==="skipped"?m="skipped":(l==null?void 0:l.status)==="interrupted"?m="none":l&&d.outcome()!=="expected"?m="failed":l&&d.outcome()==="expected"&&(m="passed"),g.tests.push(d),g.children.push({kind:"test",id:d.id,title:c,location:d.location,test:d,parent:g,children:[],status:m,duration:d.results.length?Math.max(0,d.results[0].duration):0,project:c}),g.duration=g.children.reduce((v,E)=>v+E.duration,0)}},o=new Map;for(const c of(n==null?void 0:n.suites)||[])if(!(s&&!e.get(c.title)))for(const a of c.suites){const p=ct(i,a.location.file.split(X),!0,o);r(c.title,a,p)}for(const c of t){if(!c.location)continue;const a=ct(i,c.location.file.split(X),!0,o);a.hasLoadErrors=!0}return i}function le(n,t,e,s){const i=t.trim().toLowerCase().split(" "),r=[...e.values()].some(Boolean),o=a=>{const p=a.tests[0].titlePath().join(" ").toLowerCase();return!i.every(d=>p.includes(d))&&!a.tests.some(d=>s==null?void 0:s.has(d.id))?!1:(a.children=a.children.filter(d=>!r||(s==null?void 0:s.has(d.test.id))||e.get(d.status)),a.tests=a.children.map(d=>d.test),!!a.children.length)},c=a=>{const p=[];for(const d of a.children)d.kind==="case"?o(d)&&p.push(d):(c(d),(d.children.length||d.hasLoadErrors)&&p.push(d));a.children=p};c(n)}function kt(n){for(const o of n.children)kt(o);n.kind==="group"&&n.children.sort((o,c)=>o.location.file.localeCompare(c.location.file)||o.location.line-c.location.line);let t=n.children.length>0,e=n.children.length>0,s=!1,i=!1,r=!1;for(const o of n.children)e=e&&o.status==="skipped",t=t&&(o.status==="passed"||o.status==="skipped"),s=s||o.status==="failed",i=i||o.status==="running",r=r||o.status==="scheduled";i?n.status="running":r?n.status="scheduled":s?n.status="failed":e?n.status="skipped":t&&(n.status="passed")}function ae(n){let t=n;for(;t.children.length===1&&t.children[0].kind==="group"&&t.children[0].subKind==="folder";)t=t.children[0];return t.location=n.location,t}function ce(n){const t=e=>{e.kind==="case"&&e.children.length===1?e.children=[]:e.children.forEach(t)};t(n)}async function wt(n){const t=new URLSearchParams;t.set("trace",n);const s=await(await fetch(`contexts?${t.toString()}`)).json();return new At(s)}const X=navigator.userAgent.toLowerCase().includes("windows")?"\\":"/";(async()=>{if(Vt(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(n=>setTimeout(n,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
4
- Make sure to serve the website (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.oncontrollerchange=()=>n()}),setInterval(function(){fetch("ping")},1e4)}Kt.render(h(Zt,{}),document.querySelector("#root"))})();
@@ -1,10 +0,0 @@
1
- import{u as Ct,r as V,d as yt,_ as Bt,e as Mt,f as Nt,j as l,R as f,g as Rt,c as Pt,s as wt,S as Dt,h as G,T as y,t as Lt,m as Ft,i as It,k as dt,W as Wt,M as Ot,l as At,a as zt,b as Vt}from"./assets/wsPort-Rvwd4WC-.js";class ht{constructor(){this._stringCache=new Map}internString(t){let e=this._stringCache.get(t);return e||(this._stringCache.set(t,t),e=t),e}}var Kt={};class ft{constructor(t,e,s,i){this._tests=new Map,this._listOnly=!1,this._clearPreviousResultsWhenTestBegins=!1,this._stringPool=new ht,this._rootSuite=new W("","root"),this._pathSeparator=t,this._reporter=e,this._reuseTestCases=s,this._reportConfig=i}dispatch(t){const{method:e,params:s}=t;if(e==="onConfigure"){this._onConfigure(s.config);return}if(e==="onProject"){this._onProject(s.project);return}if(e==="onBegin"){this._onBegin();return}if(e==="onTestBegin"){this._onTestBegin(s.testId,s.result);return}if(e==="onTestEnd"){this._onTestEnd(s.test,s.result);return}if(e==="onStepBegin"){this._onStepBegin(s.testId,s.resultId,s.step);return}if(e==="onStepEnd"){this._onStepEnd(s.testId,s.resultId,s.step);return}if(e==="onError"){this._onError(s.error);return}if(e==="onStdIO"){this._onStdIO(s.type,s.testId,s.resultId,s.data,s.isBase64);return}if(e==="onEnd")return this._onEnd(s.result);if(e==="onExit")return this._onExit()}_setClearPreviousResultsWhenTestBegins(){this._clearPreviousResultsWhenTestBegins=!0}_onConfigure(t){var e,s;this._rootDir=t.rootDir,this._listOnly=t.listOnly,this._config=this._parseConfig(t),(s=(e=this._reporter).onConfigure)==null||s.call(e,this._config)}_onProject(t){let e=this._rootSuite.suites.find(s=>s.project().__projectId===t.id);if(e||(e=new W(t.name,"project"),this._rootSuite.suites.push(e),e.parent=this._rootSuite),e._project=this._parseProject(t),this._mergeSuitesInto(t.suites,e),this._listOnly){const s=new Set,i=o=>{o.tests.map(c=>c.testId).forEach(c=>s.add(c)),o.suites.forEach(i)};t.suites.forEach(i);const r=o=>{o.tests=o.tests.filter(c=>s.has(c.id)),o.suites.forEach(r)};r(e)}}_onBegin(){var t,e;(e=(t=this._reporter).onBegin)==null||e.call(t,this._rootSuite)}_onTestBegin(t,e){var r,o;const s=this._tests.get(t);this._clearPreviousResultsWhenTestBegins&&s._clearResults();const i=s._createTestResult(e.id);i.retry=e.retry,i.workerIndex=e.workerIndex,i.parallelIndex=e.parallelIndex,i.setStartTimeNumber(e.startTime),i.statusEx="running",(o=(r=this._reporter).onTestBegin)==null||o.call(r,s,i)}_onTestEnd(t,e){var r,o,c;const s=this._tests.get(t.testId);s.timeout=t.timeout,s.expectedStatus=t.expectedStatus,s.annotations=t.annotations;const i=s.resultsMap.get(e.id);i.duration=e.duration,i.status=e.status,i.statusEx=e.status,i.errors=e.errors,i.error=(r=i.errors)==null?void 0:r[0],i.attachments=this._parseAttachments(e.attachments),(c=(o=this._reporter).onTestEnd)==null||c.call(o,s,i),i.stepMap=new Map}_onStepBegin(t,e,s){var p,d;const i=this._tests.get(t),r=i.resultsMap.get(e),o=s.parentStepId?r.stepMap.get(s.parentStepId):void 0,c=this._absoluteLocation(s.location),h=new Ht(s,o,c);o?o.steps.push(h):r.steps.push(h),r.stepMap.set(s.id,h),(d=(p=this._reporter).onStepBegin)==null||d.call(p,i,r,h)}_onStepEnd(t,e,s){var c,h;const i=this._tests.get(t),r=i.resultsMap.get(e),o=r.stepMap.get(s.id);o.duration=s.duration,o.error=s.error,(h=(c=this._reporter).onStepEnd)==null||h.call(c,i,r,o)}_onError(t){var e,s;(s=(e=this._reporter).onError)==null||s.call(e,t)}_onStdIO(t,e,s,i,r){var p,d,v,g;const o=r?globalThis.Buffer?Buffer.from(i,"base64"):atob(i):i,c=e?this._tests.get(e):void 0,h=c&&s?c.resultsMap.get(s):void 0;t==="stdout"?(h==null||h.stdout.push(o),(d=(p=this._reporter).onStdOut)==null||d.call(p,o,c,h)):(h==null||h.stderr.push(o),(g=(v=this._reporter).onStdErr)==null||g.call(v,o,c,h))}async _onEnd(t){var e,s;await((s=(e=this._reporter).onEnd)==null?void 0:s.call(e,{status:t.status,startTime:new Date(t.startTime),duration:t.duration}))}_onExit(){var t,e;return this._stringPool=new ht,(e=(t=this._reporter).onExit)==null?void 0:e.call(t)}_parseConfig(t){const e={...xt,...t};return this._reportConfig&&(e.configFile=this._reportConfig.configFile,e.reportSlowTests=this._reportConfig.reportSlowTests,e.quiet=this._reportConfig.quiet,e.reporter=[...this._reportConfig.reporter]),e}_parseProject(t){return{__projectId:t.id,metadata:t.metadata,name:t.name,outputDir:this._absolutePath(t.outputDir),repeatEach:t.repeatEach,retries:t.retries,testDir:this._absolutePath(t.testDir),testIgnore:Z(t.testIgnore),testMatch:Z(t.testMatch),timeout:t.timeout,grep:Z(t.grep),grepInvert:Z(t.grepInvert),dependencies:t.dependencies,teardown:t.teardown,snapshotDir:this._absolutePath(t.snapshotDir),use:{}}}_parseAttachments(t){return t.map(e=>({...e,body:e.base64&&globalThis.Buffer?Buffer.from(e.base64,"base64"):void 0}))}_mergeSuitesInto(t,e){for(const s of t){let i=e.suites.find(r=>r.title===s.title);i||(i=new W(s.title,s.type),i.parent=e,e.suites.push(i)),i.location=this._absoluteLocation(s.location),i._fileId=s.fileId,i._parallelMode=s.parallelMode,this._mergeSuitesInto(s.suites,i),this._mergeTestsInto(s.tests,i)}}_mergeTestsInto(t,e){for(const s of t){let i=this._reuseTestCases?e.tests.find(r=>r.title===s.title):void 0;i||(i=new Ut(s.testId,s.title,this._absoluteLocation(s.location)),i.parent=e,e.tests.push(i),this._tests.set(i.id,i)),this._updateTest(s,i)}}_updateTest(t,e){return e.id=t.testId,e.location=this._absoluteLocation(t.location),e.retries=t.retries,e}_absoluteLocation(t){return t&&{...t,file:this._absolutePath(t.file)}}_absolutePath(t){return t&&this._stringPool.internString(this._rootDir+this._pathSeparator+t)}}class W{constructor(t,e){this._requireFile="",this.suites=[],this.tests=[],this._parallelMode="none",this.title=t,this._type=e}allTests(){const t=[],e=s=>{for(const i of[...s.suites,...s.tests])i instanceof W?e(i):t.push(i)};return e(this),t}titlePath(){const t=this.parent?this.parent.titlePath():[];return(this.title||this._type!=="describe")&&t.push(this.title),t}project(){var t;return this._project??((t=this.parent)==null?void 0:t.project())}}class Ut{constructor(t,e,s){this.fn=()=>{},this.results=[],this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.repeatEachIndex=0,this.resultsMap=new Map,this.id=t,this.title=e,this.location=s}titlePath(){const t=this.parent?this.parent.titlePath():[];return t.push(this.title),t}outcome(){var s,i;const t=[...this.results];for(;((s=t[0])==null?void 0:s.status)==="skipped"||((i=t[0])==null?void 0:i.status)==="interrupted";)t.shift();if(!t.length)return"skipped";const e=t.filter(r=>r.status!=="skipped"&&r.status!=="interrupted"&&r.status!==this.expectedStatus);return e.length?e.length===t.length?"unexpected":"flaky":"expected"}ok(){const t=this.outcome();return t==="expected"||t==="flaky"||t==="skipped"}_clearResults(){this.results=[],this.resultsMap.clear()}_createTestResult(t){const e=new $t(this.results.length);return this.results.push(e),this.resultsMap.set(t,e),e}}class Ht{constructor(t,e,s){this.duration=-1,this.steps=[],this._startTime=0,this.title=t.title,this.category=t.category,this.location=s,this.parent=e,this._startTime=t.startTime}titlePath(){var e;return[...((e=this.parent)==null?void 0:e.titlePath())||[],this.title]}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}class $t{constructor(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.statusEx="scheduled",this._startTime=0,this.retry=t}setStartTimeNumber(t){this._startTime=t}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}const xt={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[Kt.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:15e3},configFile:"",rootDir:"",quiet:!1,shard:null,updateSnapshots:"missing",version:"",workers:0,webServer:null};function Z(n){return n.map(t=>t.s?t.s:new RegExp(t.r.source,t.r.flags))}const qt=({source:n})=>{const[t,e]=Ct(),[s,i]=V.useState(yt()),[r]=V.useState(Bt(()=>import("./assets/xtermModule-Yt6xwiJ_.js"),__vite__mapDeps([0,1]),import.meta.url).then(c=>c.default)),o=V.useRef(null);return V.useEffect(()=>(Mt(i),()=>Nt(i)),[]),V.useEffect(()=>{const c=n.write,h=n.clear;return(async()=>{const{Terminal:p,FitAddon:d}=await r,v=e.current;if(!v)return;const g=s==="dark-mode"?Xt:Yt;if(o.current&&o.current.terminal.options.theme===g)return;o.current&&(v.textContent="");const a=new p({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"var(--vscode-editor-font-family)",theme:g}),m=new d;a.loadAddon(m);for(const x of n.pending)a.write(x);n.write=x=>{n.pending.push(x),a.write(x)},n.clear=()=>{n.pending=[],a.clear()},a.open(v),m.fit(),o.current={terminal:a,fitAddon:m}})(),()=>{n.clear=h,n.write=c}},[r,o,e,n,s]),V.useEffect(()=>{setTimeout(()=>{o.current&&(o.current.fitAddon.fit(),n.resize(o.current.terminal.cols,o.current.terminal.rows))},250)},[t,n]),l.jsx("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:e})},Yt={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"},Xt={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"},Jt=({title:n,children:t,setExpanded:e,expanded:s,expandOnTitleClick:i})=>l.jsxs("div",{className:"expandable"+(s?" expanded":""),children:[l.jsxs("div",{className:"expandable-title",onClick:()=>i&&e(!s),children:[l.jsx("div",{className:"codicon codicon-"+(s?"chevron-down":"chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!i&&e(!s)}),n]}),s&&l.jsx("div",{style:{marginLeft:25},children:t})]});function Qt(n){return`.playwright-artifacts-${n}`}let lt=()=>{},vt=n=>{},_t={cols:80,rows:24},I=async()=>{};const O={pending:[],clear:()=>{},write:n=>O.pending.push(n),resize:(n,t)=>{_t={cols:n,rows:t},q("resizeTerminal",{cols:n,rows:t})}},Zt=({})=>{var ut;const[n,t]=f.useState(""),[e,s]=f.useState(!1),[i,r]=f.useState(new Map([["passed",!1],["failed",!1],["skipped",!1]])),[o,c]=f.useState(new Map),[h,p]=f.useState({config:void 0,rootSuite:void 0,loadErrors:[]}),[d,v]=f.useState(),[g,a]=f.useState({}),[m,x]=f.useState(new Set),[T,B]=f.useState(!1),[_,R]=f.useState(),[M,X]=Rt("watch-all",!1),[et,A]=f.useState({value:new Set}),u=f.useRef(Promise.resolve()),S=f.useRef(new Set),[w,b]=f.useState(0),[k,E]=f.useState(!1),[J,ct]=f.useState(!0),Tt=f.useRef(null),st=f.useCallback(()=>{B(!0),A({value:new Set}),lt(xt,new W("","root"),[],void 0),bt(!0).then(async()=>{B(!1);const{hasBrowsers:j}=await I("checkBrowsers");ct(j)})},[]);f.useEffect(()=>{var j;(j=Tt.current)==null||j.focus(),B(!0),Pt({onEvent:ie,onClose:()=>E(!0)}).then(C=>{I=async(P,D)=>{const N=window.__logForTest;N==null||N({method:P,params:D}),await C(P,D)},st()})},[st]),lt=f.useCallback((j,C,P,D)=>{const N=j.configFile?wt.getObject(j.configFile+":projects",void 0):void 0;for(const L of o.keys())C.suites.find(Q=>Q.title===L)||o.delete(L);for(const L of C.suites)o.has(L.title)||o.set(L.title,!!(N!=null&&N.includes(L.title)));!N&&o.size&&![...o.values()].includes(!0)&&o.set(o.entries().next().value[0],!0),p({config:j,rootSuite:C,loadErrors:P}),c(new Map(o)),_&&D?v(D):D||v(void 0)},[o,_]);const it=f.useCallback((j,C)=>{j==="bounce-if-busy"&&_||(S.current=new Set([...S.current,...C]),u.current=u.current.then(async()=>{var N,L,Q;const P=S.current;if(S.current=new Set,!P.size)return;{for(const F of((N=h.rootSuite)==null?void 0:N.allTests())||[])P.has(F.id)&&(F._clearResults(),F._createTestResult("pending"));p({...h})}const D=" ["+new Date().toLocaleTimeString()+"]";O.write("\x1B[2m—".repeat(Math.max(0,_t.cols-D.length))+D+"\x1B[22m"),v({total:0,passed:0,failed:0,skipped:0}),R({testIds:P}),await I("run",{testIds:[...P],projects:[...o].filter(([F,Et])=>Et).map(([F])=>F)});for(const F of((L=h.rootSuite)==null?void 0:L.allTests())||[])((Q=F.results[0])==null?void 0:Q.duration)===-1&&F._clearResults();p({...h}),R(void 0)}))},[o,_,h]),z=!!_,nt=f.useRef(null),kt=f.useCallback(j=>{var C;j.preventDefault(),j.stopPropagation(),(C=nt.current)==null||C.showModal()},[]),ot=f.useCallback(j=>{var C;j.preventDefault(),j.stopPropagation(),(C=nt.current)==null||C.close()},[]),jt=f.useCallback(j=>{ot(j),s(!0),I("installBrowsers").then(async()=>{s(!1);const{hasBrowsers:C}=await I("checkBrowsers");ct(C)})},[ot]);return l.jsxs("div",{className:"vbox ui-mode",children:[!J&&l.jsxs("dialog",{ref:nt,children:[l.jsxs("div",{className:"title",children:[l.jsx("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),l.jsxs("div",{className:"body",children:["Playwright did not find installed browsers.",l.jsx("br",{}),"Would you like to run `playwright install`?",l.jsx("br",{}),l.jsx("button",{className:"button",onClick:jt,children:"Install"}),l.jsx("button",{className:"button secondary",onClick:ot,children:"Dismiss"})]})]}),k&&l.jsxs("div",{className:"disconnected",children:[l.jsx("div",{className:"title",children:"UI Mode disconnected"}),l.jsxs("div",{children:[l.jsx("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),l.jsxs(Dt,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",children:[l.jsxs("div",{className:"vbox",children:[l.jsxs("div",{className:"vbox"+(e?"":" hidden"),children:[l.jsxs(G,{children:[l.jsx("div",{className:"section-title",style:{flex:"none"},children:"Output"}),l.jsx(y,{icon:"circle-slash",title:"Clear output",onClick:()=>O.clear()}),l.jsx("div",{className:"spacer"}),l.jsx(y,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),l.jsx(qt,{source:O})]}),l.jsx("div",{className:"vbox"+(e?" hidden":""),children:l.jsx(se,{item:g,rootDir:(ut=h.config)==null?void 0:ut.rootDir})})]}),l.jsxs("div",{className:"vbox ui-mode-sidebar",children:[l.jsxs(G,{noShadow:!0,noMinHeight:!0,children:[l.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),l.jsx("div",{className:"section-title",children:"Playwright"}),l.jsx(y,{icon:"color-mode",title:"Toggle color mode",onClick:()=>Lt()}),l.jsx(y,{icon:"refresh",title:"Reload",onClick:()=>st(),disabled:z||T}),l.jsx(y,{icon:"terminal",title:"Toggle output",toggled:e,onClick:()=>{s(!e)}}),!J&&l.jsx(y,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:kt})]}),l.jsx(Gt,{filterText:n,setFilterText:t,statusFilters:i,setStatusFilters:r,projectFilters:o,setProjectFilters:c,testModel:h,runTests:()=>it("bounce-if-busy",m)}),l.jsxs(G,{noMinHeight:!0,children:[!z&&!d&&l.jsx("div",{className:"section-title",children:"Tests"}),!z&&d&&l.jsx("div",{"data-testid":"status-line",className:"status-line",children:l.jsxs("div",{children:[d.passed,"/",d.total," passed (",d.passed/d.total*100|0,"%)"]})}),z&&d&&l.jsx("div",{"data-testid":"status-line",className:"status-line",children:l.jsxs("div",{children:["Running ",d.passed,"/",_.testIds.size," passed (",d.passed/_.testIds.size*100|0,"%)"]})}),l.jsx(y,{icon:"play",title:"Run all",onClick:()=>it("bounce-if-busy",m),disabled:z||T}),l.jsx(y,{icon:"debug-stop",title:"Stop",onClick:()=>q("stop"),disabled:!z||T}),l.jsx(y,{icon:"eye",title:"Watch all",toggled:M,onClick:()=>{A({value:new Set}),X(!M)}}),l.jsx(y,{icon:"collapse-all",title:"Collapse all",onClick:()=>{b(w+1)}})]}),l.jsx(ee,{statusFilters:i,projectFilters:o,filterText:n,testModel:h,runningState:_,runTests:it,onItemSelected:a,setVisibleTestIds:x,watchAll:M,watchedTreeIds:et,setWatchedTreeIds:A,isLoading:T,requestedCollapseAllCount:w})]})]})]})},Gt=({filterText:n,setFilterText:t,statusFilters:e,setStatusFilters:s,projectFilters:i,setProjectFilters:r,testModel:o,runTests:c})=>{const[h,p]=f.useState(!1),d=f.useRef(null);f.useEffect(()=>{var a;(a=d.current)==null||a.focus()},[]);const v=[...e.entries()].filter(([a,m])=>m).map(([a])=>a).join(" ")||"all",g=[...i.entries()].filter(([a,m])=>m).map(([a])=>a).join(" ")||"all";return l.jsxs("div",{className:"filters",children:[l.jsx(Jt,{expanded:h,setExpanded:p,title:l.jsx("input",{ref:d,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:n,onChange:a=>{t(a.target.value)},onKeyDown:a=>{a.key==="Enter"&&c()}})}),l.jsxs("div",{className:"filter-summary",title:"Status: "+v+`
2
- Projects: `+g,onClick:()=>p(!h),children:[l.jsx("span",{className:"filter-label",children:"Status:"})," ",v,l.jsx("span",{className:"filter-label",children:"Projects:"})," ",g]}),h&&l.jsxs("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[l.jsx("div",{className:"filter-list",children:[...e.entries()].map(([a,m])=>l.jsx("div",{className:"filter-entry",children:l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:m,onClick:()=>{const x=new Map(e);x.set(a,!x.get(a)),s(x)}}),l.jsx("div",{children:a})]})}))}),l.jsx("div",{className:"filter-list",children:[...i.entries()].map(([a,m])=>l.jsx("div",{className:"filter-entry",children:l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:m,onClick:()=>{var B;const x=new Map(i);x.set(a,!x.get(a)),r(x);const T=(B=o==null?void 0:o.config)==null?void 0:B.configFile;T&&wt.setObject(T+":projects",[...x.entries()].filter(([_,R])=>R).map(([_])=>_))}}),l.jsx("div",{children:a||"untitled"})]})}))})]})]})},te=At,ee=({statusFilters:n,projectFilters:t,filterText:e,testModel:s,runTests:i,runningState:r,watchAll:o,watchedTreeIds:c,setWatchedTreeIds:h,isLoading:p,onItemSelected:d,setVisibleTestIds:v,requestedCollapseAllCount:g})=>{const[a,m]=f.useState({expandedItems:new Map}),[x,T]=f.useState(),[B,_]=f.useState(g),{rootItem:R,treeItemMap:M,fileNames:X}=f.useMemo(()=>{let u=re(s.rootSuite,s.loadErrors,t);le(u,e,n,r==null?void 0:r.testIds),St(u),u=ae(u),ce(u);const S=new Map,w=new Set,b=new Set,k=E=>{E.kind==="group"&&E.location.file&&b.add(E.location.file),E.kind==="case"&&E.tests.forEach(J=>w.add(J.id)),E.children.forEach(k),S.set(E.id,E)};return k(u),v(w),{rootItem:u,treeItemMap:S,fileNames:b}},[e,s,n,t,v,r]);f.useEffect(()=>{if(B!==g){a.expandedItems.clear();for(const w of M.keys())a.expandedItems.set(w,!1);_(g),T(void 0),m({...a});return}if(!r||r.itemSelectedByUser)return;let u;const S=w=>{var b;w.children.forEach(S),!u&&w.status==="failed"&&(w.kind==="test"&&r.testIds.has(w.test.id)||w.kind==="case"&&r.testIds.has((b=w.tests[0])==null?void 0:b.id))&&(u=w)};S(R),u&&T(u.id)},[r,T,R,B,_,g,a,m,M]);const{selectedTreeItem:et}=f.useMemo(()=>{const u=x?M.get(x):void 0;let S;u&&(S={file:u.location.file,line:u.location.line,source:{errors:s.loadErrors.filter(b=>{var k;return((k=b.location)==null?void 0:k.file)===u.location.file}).map(b=>({line:b.location.line,message:b.message})),content:void 0}});let w;return(u==null?void 0:u.kind)==="test"?w=u.test:(u==null?void 0:u.kind)==="case"&&u.tests.length===1&&(w=u.tests[0]),d({treeItem:u,testCase:w,testFile:S}),{selectedTreeItem:u}},[d,x,s,M]);f.useEffect(()=>{if(!p)if(o)q("watch",{fileNames:[...X]});else{const u=new Set;for(const S of c.value){const w=M.get(S),b=w==null?void 0:w.location.file;b&&u.add(b)}q("watch",{fileNames:[...u]})}},[p,R,X,o,c,M]);const A=u=>{T(u.id),i("bounce-if-busy",rt(u))};return vt=u=>{const S=[],w=new Set(u);if(o){const b=k=>{const E=k.location.file;E&&w.has(E)&&S.push(...rt(k)),k.kind==="group"&&k.subKind==="folder"&&k.children.forEach(b)};b(R)}else for(const b of c.value){const k=M.get(b),E=k==null?void 0:k.location.file;E&&w.has(E)&&S.push(...rt(k))}i("queue-if-busy",new Set(S))},l.jsx(te,{name:"tests",treeState:a,setTreeState:m,rootItem:R,dataTestId:"test-tree",render:u=>l.jsxs("div",{className:"hbox ui-mode-list-item",children:[l.jsx("div",{className:"ui-mode-list-item-title",title:u.title,children:u.title}),!!u.duration&&u.status!=="skipped"&&l.jsx("div",{className:"ui-mode-list-item-time",children:Ft(u.duration)}),l.jsxs(G,{noMinHeight:!0,noShadow:!0,children:[l.jsx(y,{icon:"play",title:"Run",onClick:()=>A(u),disabled:!!r}),l.jsx(y,{icon:"go-to-file",title:"Open in VS Code",onClick:()=>q("open",{location:oe(u)}),style:u.kind==="group"&&u.subKind==="folder"?{visibility:"hidden"}:{}}),!o&&l.jsx(y,{icon:"eye",title:"Watch",onClick:()=>{c.value.has(u.id)?c.value.delete(u.id):c.value.add(u.id),h({...c})},toggled:c.value.has(u.id)})]})]}),icon:u=>It(u.status),selectedItem:et,onAccepted:A,onSelected:u=>{r&&(r.itemSelectedByUser=!0),T(u.id)},isError:u=>u.kind==="group"?u.hasLoadErrors:!1,autoExpandDepth:e?5:1,noItemsMessage:p?"Loading…":"No tests"})},se=({item:n,rootDir:t})=>{var g;const[e,s]=f.useState(),[i,r]=f.useState(0),o=f.useRef(null),{outputDir:c}=f.useMemo(()=>({outputDir:n.testCase?ne(n.testCase):void 0}),[n]),[h,p]=f.useState(),d=f.useCallback(a=>p(dt(a)),[p]),v=h?e==null?void 0:e.model.actions.find(a=>dt(a)===h):void 0;return f.useEffect(()=>{var T,B;o.current&&clearTimeout(o.current);const a=(T=n.testCase)==null?void 0:T.results[0];if(!a){s(void 0);return}const m=a&&a.duration>=0&&a.attachments.find(_=>_.name==="trace");if(m&&m.path){mt(m.path).then(_=>s({model:_,isLive:!1}));return}if(!c){s(void 0);return}const x=`${c}/${Qt(a.workerIndex)}/traces/${(B=n.testCase)==null?void 0:B.id}.json`;return o.current=setTimeout(async()=>{try{const _=await mt(x);s({model:_,isLive:!0})}catch{s(void 0)}finally{r(i+1)}},500),()=>{o.current&&clearTimeout(o.current)}},[c,n,s,i,r]),l.jsx(Wt,{model:e==null?void 0:e.model,hideStackFrames:!0,showSourcesFirst:!0,rootDir:t,initialSelection:v,onSelectionChanged:d,fallbackLocation:n.testFile,isLive:e==null?void 0:e.isLive,status:(g=n.treeItem)==null?void 0:g.status},"workbench")};let H,$,pt,tt,U;const gt=()=>{clearTimeout(tt),tt=void 0,lt(U.config,U.rootSuite,U.loadErrors,U.progress)},K=(n,t,e,s,i=!1)=>{U={config:n,rootSuite:t,loadErrors:e,progress:s},i?gt():tt||(tt=setTimeout(gt,250))},bt=n=>{if(!n)return I("list",{});let t;const e=[],s={total:0,passed:0,failed:0,skipped:0};let i;return H=new ft(Y,{version:()=>"v2",onConfigure:r=>{i=r,$=new ft(Y,{onBegin:o=>{pt=o.allTests().length,$=void 0}},!1)},onBegin:r=>{t||(t=r),s.total=pt,s.passed=0,s.failed=0,s.skipped=0,K(i,t,e,s,!0)},onEnd:()=>{K(i,t,e,s,!0)},onTestBegin:()=>{K(i,t,e,s)},onTestEnd:r=>{r.outcome()==="skipped"?++s.skipped:r.outcome()==="unexpected"?++s.failed:++s.passed,K(i,t,e,s)},onError:r=>{O.write((r.stack||r.value||"")+`
3
- `),e.push(r),K(i,t??new W("","root"),e,s)},printsToStdio:()=>!1,onStdOut:()=>{},onStdErr:()=>{},onExit:()=>{},onStepBegin:()=>{},onStepEnd:()=>{}},!0),H._setClearPreviousResultsWhenTestBegins(),I("list",{})},q=(n,t)=>{if(window._overrideProtocolForTest){window._overrideProtocolForTest({method:n,params:t}).catch(()=>{});return}I(n,t).catch(e=>{console.error(e)})},ie=(n,t)=>{var e,s;if(n==="listChanged"){bt(!1).catch(()=>{});return}if(n==="testFilesChanged"){vt(t.testFileNames);return}if(n==="stdio"){if(t.buffer){const i=atob(t.buffer);O.write(i)}else O.write(t.text);return}(e=$==null?void 0:$.dispatch({method:n,params:t}))==null||e.catch(()=>{}),(s=H==null?void 0:H.dispatch({method:n,params:t}))==null||s.catch(()=>{})},ne=n=>{var t;for(let e=n.parent;e;e=e.parent)if(e.project())return(t=e.project())==null?void 0:t.outputDir},oe=n=>{if(n)return n.location.file+":"+n.location.line},rt=n=>{const t=new Set;if(!n)return t;const e=s=>{var i;s.kind==="case"?s.tests.map(r=>r.id).forEach(r=>t.add(r)):s.kind==="test"?t.add(s.id):(i=s.children)==null||i.forEach(e)};return e(n),t};function at(n,t,e,s){if(t.length===0)return n;const i=t.join(Y),r=s.get(i);if(r)return r;const o=at(n,t.slice(0,t.length-1),!1,s),c={kind:"group",subKind:e?"file":"folder",id:i,title:t[t.length-1],location:{file:i,line:0,column:0},duration:0,parent:o,children:[],status:"none",hasLoadErrors:!1};return o.children.push(c),s.set(i,c),c}function re(n,t,e){const s=[...e.values()].some(Boolean),i={kind:"group",subKind:"folder",id:"root",title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},r=(c,h,p)=>{for(const d of h.suites){const v=d.title||"<anonymous>";let g=p.children.find(a=>a.kind==="group"&&a.title===v);g||(g={kind:"group",subKind:"describe",id:"suite:"+h.titlePath().join("")+""+v,title:v,location:d.location,duration:0,parent:p,children:[],status:"none",hasLoadErrors:!1},p.children.push(g)),r(c,d,g)}for(const d of h.tests){const v=d.title;let g=p.children.find(x=>x.kind!=="group"&&x.title===v);g||(g={kind:"case",id:"test:"+d.titlePath().join(""),title:v,parent:p,children:[],tests:[],location:d.location,duration:0,status:"none"},p.children.push(g));const a=d.results[0];let m="none";(a==null?void 0:a.statusEx)==="scheduled"?m="scheduled":(a==null?void 0:a.statusEx)==="running"?m="running":(a==null?void 0:a.status)==="skipped"?m="skipped":(a==null?void 0:a.status)==="interrupted"?m="none":a&&d.outcome()!=="expected"?m="failed":a&&d.outcome()==="expected"&&(m="passed"),g.tests.push(d),g.children.push({kind:"test",id:d.id,title:c,location:d.location,test:d,parent:g,children:[],status:m,duration:d.results.length?Math.max(0,d.results[0].duration):0,project:c}),g.duration=g.children.reduce((x,T)=>x+T.duration,0)}},o=new Map;for(const c of(n==null?void 0:n.suites)||[])if(!(s&&!e.get(c.title)))for(const h of c.suites){const p=at(i,h.location.file.split(Y),!0,o);r(c.title,h,p)}for(const c of t){if(!c.location)continue;const h=at(i,c.location.file.split(Y),!0,o);h.hasLoadErrors=!0}return i}function le(n,t,e,s){const i=t.trim().toLowerCase().split(" "),r=[...e.values()].some(Boolean),o=h=>{const p=h.tests[0].titlePath().join(" ").toLowerCase();return!i.every(d=>p.includes(d))&&!h.tests.some(d=>s==null?void 0:s.has(d.id))?!1:(h.children=h.children.filter(d=>!r||(s==null?void 0:s.has(d.test.id))||e.get(d.status)),h.tests=h.children.map(d=>d.test),!!h.children.length)},c=h=>{const p=[];for(const d of h.children)d.kind==="case"?o(d)&&p.push(d):(c(d),(d.children.length||d.hasLoadErrors)&&p.push(d));h.children=p};c(n)}function St(n){for(const o of n.children)St(o);n.kind==="group"&&n.children.sort((o,c)=>o.location.file.localeCompare(c.location.file)||o.location.line-c.location.line);let t=n.children.length>0,e=n.children.length>0,s=!1,i=!1,r=!1;for(const o of n.children)e=e&&o.status==="skipped",t=t&&(o.status==="passed"||o.status==="skipped"),s=s||o.status==="failed",i=i||o.status==="running",r=r||o.status==="scheduled";i?n.status="running":r?n.status="scheduled":s?n.status="failed":e?n.status="skipped":t&&(n.status="passed")}function ae(n){let t=n;for(;t.children.length===1&&t.children[0].kind==="group"&&t.children[0].subKind==="folder";)t=t.children[0];return t.location=n.location,t}function ce(n){const t=e=>{e.kind==="case"&&e.children.length===1?e.children=[]:e.children.forEach(t)};t(n)}async function mt(n){const t=new URLSearchParams;t.set("trace",n);const s=await(await fetch(`contexts?${t.toString()}`)).json();return new Ot(s)}const Y=navigator.userAgent.toLowerCase().includes("windows")?"\\":"/";(async()=>{if(zt(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(n=>setTimeout(n,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
4
- Make sure to serve the website (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.oncontrollerchange=()=>n()}),setInterval(function(){fetch("ping")},1e4)}Vt.render(l.jsx(Zt,{}),document.querySelector("#root"))})();
5
- function __vite__mapDeps(indexes) {
6
- if (!__vite__mapDeps.viteFileDeps) {
7
- __vite__mapDeps.viteFileDeps = ["./assets/xtermModule-Yt6xwiJ_.js","./xtermModule.0lwXJFHT.css"]
8
- }
9
- return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
10
- }
@@ -1,10 +0,0 @@
1
- import{u as Ce,r as V,d as ye,_ as Be,e as Me,f as Ne,j as l,R as f,g as Re,c as Pe,s as we,S as De,h as G,T as y,t as Le,m as Fe,i as Ie,k as de,W as We,M as Oe,l as Ae,a as ze,b as Ve}from"./assets/wsPort-sh0wpjYp.js";class he{constructor(){this._stringCache=new Map}internString(e){let t=this._stringCache.get(e);return t||(this._stringCache.set(e,e),t=e),t}}var Ke={};class fe{constructor(e,t,s,i){this._tests=new Map,this._listOnly=!1,this._clearPreviousResultsWhenTestBegins=!1,this._stringPool=new he,this._rootSuite=new W("","root"),this._pathSeparator=e,this._reporter=t,this._reuseTestCases=s,this._reportConfig=i}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()}_setClearPreviousResultsWhenTestBegins(){this._clearPreviousResultsWhenTestBegins=!0}_onConfigure(e){var t,s;this._rootDir=e.rootDir,this._listOnly=e.listOnly,this._config=this._parseConfig(e),(s=(t=this._reporter).onConfigure)==null||s.call(t,this._config)}_onProject(e){let t=this._rootSuite.suites.find(i=>i.project().__projectId===e.id);t||(t=new W(e.name,"project"),this._rootSuite.suites.push(t),t.parent=this._rootSuite);const s=this._parseProject(e);if(t.project=()=>s,this._mergeSuitesInto(e.suites,t),this._listOnly){const i=new Set,r=u=>{u.tests.map(c=>c.testId).forEach(c=>i.add(c)),u.suites.forEach(r)};e.suites.forEach(r);const o=u=>{u.tests=u.tests.filter(c=>i.has(c.id)),u.suites.forEach(o)};o(t)}}_onBegin(){var e,t;(t=(e=this._reporter).onBegin)==null||t.call(e,this._rootSuite)}_onTestBegin(e,t){var r,o;const s=this._tests.get(e);this._clearPreviousResultsWhenTestBegins&&s._clearResults();const i=s._createTestResult(t.id);i.retry=t.retry,i.workerIndex=t.workerIndex,i.parallelIndex=t.parallelIndex,i.setStartTimeNumber(t.startTime),i.statusEx="running",(o=(r=this._reporter).onTestBegin)==null||o.call(r,s,i)}_onTestEnd(e,t){var r,o,u;const s=this._tests.get(e.testId);s.timeout=e.timeout,s.expectedStatus=e.expectedStatus,s.annotations=e.annotations;const i=s.resultsMap.get(t.id);i.duration=t.duration,i.status=t.status,i.statusEx=t.status,i.errors=t.errors,i.error=(r=i.errors)==null?void 0:r[0],i.attachments=this._parseAttachments(t.attachments),(u=(o=this._reporter).onTestEnd)==null||u.call(o,s,i),i.stepMap=new Map}_onStepBegin(e,t,s){var p,h;const i=this._tests.get(e),r=i.resultsMap.get(t),o=s.parentStepId?r.stepMap.get(s.parentStepId):void 0,u=this._absoluteLocation(s.location),c=new He(s,o,u);o?o.steps.push(c):r.steps.push(c),r.stepMap.set(s.id,c),(h=(p=this._reporter).onStepBegin)==null||h.call(p,i,r,c)}_onStepEnd(e,t,s){var u,c;const i=this._tests.get(e),r=i.resultsMap.get(t),o=r.stepMap.get(s.id);o.duration=s.duration,o.error=s.error,(c=(u=this._reporter).onStepEnd)==null||c.call(u,i,r,o)}_onError(e){var t,s;(s=(t=this._reporter).onError)==null||s.call(t,e)}_onStdIO(e,t,s,i,r){var p,h,v,g;const o=r?globalThis.Buffer?Buffer.from(i,"base64"):atob(i):i,u=t?this._tests.get(t):void 0,c=u&&s?u.resultsMap.get(s):void 0;e==="stdout"?(c==null||c.stdout.push(o),(h=(p=this._reporter).onStdOut)==null||h.call(p,o,u,c)):(c==null||c.stderr.push(o),(g=(v=this._reporter).onStdErr)==null||g.call(v,o,u,c))}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 this._stringPool=new he,(t=(e=this._reporter).onExit)==null?void 0:t.call(e)}_parseConfig(e){const t={...xe,...e};return this._reportConfig&&(t.configFile=this._reportConfig.configFile,t.reportSlowTests=this._reportConfig.reportSlowTests,t.quiet=this._reportConfig.quiet,t.reporter=[...this._reportConfig.reporter]),t}_parseProject(e){return{__projectId:e.id,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}))}_mergeSuitesInto(e,t){for(const s of e){let i=t.suites.find(r=>r.title===s.title);i||(i=new W(s.title,s.type),i.parent=t,t.suites.push(i)),i.location=this._absoluteLocation(s.location),i._fileId=s.fileId,i._parallelMode=s.parallelMode,this._mergeSuitesInto(s.suites,i),this._mergeTestsInto(s.tests,i)}}_mergeTestsInto(e,t){for(const s of e){let i=this._reuseTestCases?t.tests.find(r=>r.title===s.title):void 0;i||(i=new Ue(s.testId,s.title,this._absoluteLocation(s.location)),i.parent=t,t.tests.push(i),this._tests.set(i.id,i)),this._updateTest(s,i)}}_updateTest(e,t){return t.id=e.testId,t.location=this._absoluteLocation(e.location),t.retries=e.retries,t}_absoluteLocation(e){return e&&{...e,file:this._absolutePath(e.file)}}_absolutePath(e){return e&&this._stringPool.internString(this._rootDir+this._pathSeparator+e)}}class W{constructor(e,t){this._requireFile="",this.suites=[],this.tests=[],this._parallelMode="none",this.title=e,this._type=t}allTests(){const e=[],t=s=>{for(const i of[...s.suites,...s.tests])i instanceof W?t(i):e.push(i)};return t(this),e}titlePath(){const e=this.parent?this.parent.titlePath():[];return(this.title||this._type!=="describe")&&e.push(this.title),e}project(){}}class Ue{constructor(e,t,s){this.fn=()=>{},this.results=[],this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.repeatEachIndex=0,this.resultsMap=new Map,this.id=e,this.title=t,this.location=s}titlePath(){const e=this.parent?this.parent.titlePath():[];return e.push(this.title),e}outcome(){var s,i;const e=[...this.results];for(;((s=e[0])==null?void 0:s.status)==="skipped"||((i=e[0])==null?void 0:i.status)==="interrupted";)e.shift();if(!e.length)return"skipped";const t=e.filter(r=>r.status!=="skipped"&&r.status!=="interrupted"&&r.status!==this.expectedStatus);return t.length?t.length===e.length?"unexpected":"flaky":"expected"}ok(){const e=this.outcome();return e==="expected"||e==="flaky"||e==="skipped"}_clearResults(){this.results=[],this.resultsMap.clear()}_createTestResult(e){const t=new $e(this.results.length);return this.results.push(t),this.resultsMap.set(e,t),t}}class He{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 $e{constructor(e){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.statusEx="scheduled",this._startTime=0,this.retry=e}setStartTimeNumber(e){this._startTime=e}get startTime(){return new Date(this._startTime)}set startTime(e){this._startTime=+e}}const xe={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[Ke.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:15e3},configFile:"",rootDir:"",quiet:!1,shard:null,updateSnapshots:"missing",version:"",workers:0,webServer:null};function Z(n){return n.map(e=>e.s?e.s:new RegExp(e.r.source,e.r.flags))}const qe=({source:n})=>{const[e,t]=Ce(),[s,i]=V.useState(ye()),[r]=V.useState(Be(()=>import("./assets/xtermModule-Yt6xwiJ_.js"),__vite__mapDeps([0,1]),import.meta.url).then(u=>u.default)),o=V.useRef(null);return V.useEffect(()=>(Me(i),()=>Ne(i)),[]),V.useEffect(()=>{const u=n.write,c=n.clear;return(async()=>{const{Terminal:p,FitAddon:h}=await r,v=t.current;if(!v)return;const g=s==="dark-mode"?Xe:Ye;if(o.current&&o.current.terminal.options.theme===g)return;o.current&&(v.textContent="");const a=new p({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"var(--vscode-editor-font-family)",theme:g}),m=new h;a.loadAddon(m);for(const x of n.pending)a.write(x);n.write=x=>{n.pending.push(x),a.write(x)},n.clear=()=>{n.pending=[],a.clear()},a.open(v),m.fit(),o.current={terminal:a,fitAddon:m}})(),()=>{n.clear=c,n.write=u}},[r,o,t,n,s]),V.useEffect(()=>{setTimeout(()=>{o.current&&(o.current.fitAddon.fit(),n.resize(o.current.terminal.cols,o.current.terminal.rows))},250)},[e,n]),l.jsx("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:t})},Ye={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"},Xe={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"},Je=({title:n,children:e,setExpanded:t,expanded:s,expandOnTitleClick:i})=>l.jsxs("div",{className:"expandable"+(s?" expanded":""),children:[l.jsxs("div",{className:"expandable-title",onClick:()=>i&&t(!s),children:[l.jsx("div",{className:"codicon codicon-"+(s?"chevron-down":"chevron-right"),style:{cursor:"pointer",color:"var(--vscode-foreground)",marginLeft:"5px"},onClick:()=>!i&&t(!s)}),n]}),s&&l.jsx("div",{style:{marginLeft:25},children:e})]});function Qe(n){return`.playwright-artifacts-${n}`}let le=()=>{},ve=n=>{},_e={cols:80,rows:24},I=async()=>{};const O={pending:[],clear:()=>{},write:n=>O.pending.push(n),resize:(n,e)=>{_e={cols:n,rows:e},q("resizeTerminal",{cols:n,rows:e})}},Ze=({})=>{var ue;const[n,e]=f.useState(""),[t,s]=f.useState(!1),[i,r]=f.useState(new Map([["passed",!1],["failed",!1],["skipped",!1]])),[o,u]=f.useState(new Map),[c,p]=f.useState({config:void 0,rootSuite:void 0,loadErrors:[]}),[h,v]=f.useState(),[g,a]=f.useState({}),[m,x]=f.useState(new Set),[T,B]=f.useState(!1),[_,R]=f.useState(),[M,X]=Re("watch-all",!1),[te,A]=f.useState({value:new Set}),d=f.useRef(Promise.resolve()),S=f.useRef(new Set),[w,b]=f.useState(0),[k,E]=f.useState(!1),[J,ce]=f.useState(!0),Te=f.useRef(null),se=f.useCallback(()=>{B(!0),A({value:new Set}),le(xe,new W("","root"),[],void 0),be(!0).then(async()=>{B(!1);const{hasBrowsers:j}=await I("checkBrowsers");ce(j)})},[]);f.useEffect(()=>{var j;(j=Te.current)==null||j.focus(),B(!0),Pe({onEvent:it,onClose:()=>E(!0)}).then(C=>{I=async(P,D)=>{const N=window.__logForTest;N==null||N({method:P,params:D}),await C(P,D)},se()})},[se]),le=f.useCallback((j,C,P,D)=>{const N=j.configFile?we.getObject(j.configFile+":projects",void 0):void 0;for(const L of o.keys())C.suites.find(Q=>Q.title===L)||o.delete(L);for(const L of C.suites)o.has(L.title)||o.set(L.title,!!(N!=null&&N.includes(L.title)));!N&&o.size&&![...o.values()].includes(!0)&&o.set(o.entries().next().value[0],!0),p({config:j,rootSuite:C,loadErrors:P}),u(new Map(o)),_&&D?v(D):D||v(void 0)},[o,_]);const ie=f.useCallback((j,C)=>{j==="bounce-if-busy"&&_||(S.current=new Set([...S.current,...C]),d.current=d.current.then(async()=>{var N,L,Q;const P=S.current;if(S.current=new Set,!P.size)return;{for(const F of((N=c.rootSuite)==null?void 0:N.allTests())||[])P.has(F.id)&&(F._clearResults(),F._createTestResult("pending"));p({...c})}const D=" ["+new Date().toLocaleTimeString()+"]";O.write("\x1B[2m—".repeat(Math.max(0,_e.cols-D.length))+D+"\x1B[22m"),v({total:0,passed:0,failed:0,skipped:0}),R({testIds:P}),await I("run",{testIds:[...P],projects:[...o].filter(([F,Ee])=>Ee).map(([F])=>F)});for(const F of((L=c.rootSuite)==null?void 0:L.allTests())||[])((Q=F.results[0])==null?void 0:Q.duration)===-1&&F._clearResults();p({...c}),R(void 0)}))},[o,_,c]),z=!!_,ne=f.useRef(null),ke=f.useCallback(j=>{var C;j.preventDefault(),j.stopPropagation(),(C=ne.current)==null||C.showModal()},[]),oe=f.useCallback(j=>{var C;j.preventDefault(),j.stopPropagation(),(C=ne.current)==null||C.close()},[]),je=f.useCallback(j=>{oe(j),s(!0),I("installBrowsers").then(async()=>{s(!1);const{hasBrowsers:C}=await I("checkBrowsers");ce(C)})},[oe]);return l.jsxs("div",{className:"vbox ui-mode",children:[!J&&l.jsxs("dialog",{ref:ne,children:[l.jsxs("div",{className:"title",children:[l.jsx("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),l.jsxs("div",{className:"body",children:["Playwright did not find installed browsers.",l.jsx("br",{}),"Would you like to run `playwright install`?",l.jsx("br",{}),l.jsx("button",{className:"button",onClick:je,children:"Install"}),l.jsx("button",{className:"button secondary",onClick:oe,children:"Dismiss"})]})]}),k&&l.jsxs("div",{className:"disconnected",children:[l.jsx("div",{className:"title",children:"UI Mode disconnected"}),l.jsxs("div",{children:[l.jsx("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),l.jsxs(De,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",children:[l.jsxs("div",{className:"vbox",children:[l.jsxs("div",{className:"vbox"+(t?"":" hidden"),children:[l.jsxs(G,{children:[l.jsx("div",{className:"section-title",style:{flex:"none"},children:"Output"}),l.jsx(y,{icon:"circle-slash",title:"Clear output",onClick:()=>O.clear()}),l.jsx("div",{className:"spacer"}),l.jsx(y,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),l.jsx(qe,{source:O})]}),l.jsx("div",{className:"vbox"+(t?" hidden":""),children:l.jsx(st,{item:g,rootDir:(ue=c.config)==null?void 0:ue.rootDir})})]}),l.jsxs("div",{className:"vbox ui-mode-sidebar",children:[l.jsxs(G,{noShadow:!0,noMinHeight:!0,children:[l.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),l.jsx("div",{className:"section-title",children:"Playwright"}),l.jsx(y,{icon:"color-mode",title:"Toggle color mode",onClick:()=>Le()}),l.jsx(y,{icon:"refresh",title:"Reload",onClick:()=>se(),disabled:z||T}),l.jsx(y,{icon:"terminal",title:"Toggle output",toggled:t,onClick:()=>{s(!t)}}),!J&&l.jsx(y,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:ke})]}),l.jsx(Ge,{filterText:n,setFilterText:e,statusFilters:i,setStatusFilters:r,projectFilters:o,setProjectFilters:u,testModel:c,runTests:()=>ie("bounce-if-busy",m)}),l.jsxs(G,{noMinHeight:!0,children:[!z&&!h&&l.jsx("div",{className:"section-title",children:"Tests"}),!z&&h&&l.jsx("div",{"data-testid":"status-line",className:"status-line",children:l.jsxs("div",{children:[h.passed,"/",h.total," passed (",h.passed/h.total*100|0,"%)"]})}),z&&h&&l.jsx("div",{"data-testid":"status-line",className:"status-line",children:l.jsxs("div",{children:["Running ",h.passed,"/",_.testIds.size," passed (",h.passed/_.testIds.size*100|0,"%)"]})}),l.jsx(y,{icon:"play",title:"Run all",onClick:()=>ie("bounce-if-busy",m),disabled:z||T}),l.jsx(y,{icon:"debug-stop",title:"Stop",onClick:()=>q("stop"),disabled:!z||T}),l.jsx(y,{icon:"eye",title:"Watch all",toggled:M,onClick:()=>{A({value:new Set}),X(!M)}}),l.jsx(y,{icon:"collapse-all",title:"Collapse all",onClick:()=>{b(w+1)}})]}),l.jsx(tt,{statusFilters:i,projectFilters:o,filterText:n,testModel:c,runningState:_,runTests:ie,onItemSelected:a,setVisibleTestIds:x,watchAll:M,watchedTreeIds:te,setWatchedTreeIds:A,isLoading:T,requestedCollapseAllCount:w})]})]})]})},Ge=({filterText:n,setFilterText:e,statusFilters:t,setStatusFilters:s,projectFilters:i,setProjectFilters:r,testModel:o,runTests:u})=>{const[c,p]=f.useState(!1),h=f.useRef(null);f.useEffect(()=>{var a;(a=h.current)==null||a.focus()},[]);const v=[...t.entries()].filter(([a,m])=>m).map(([a])=>a).join(" ")||"all",g=[...i.entries()].filter(([a,m])=>m).map(([a])=>a).join(" ")||"all";return l.jsxs("div",{className:"filters",children:[l.jsx(Je,{expanded:c,setExpanded:p,title:l.jsx("input",{ref:h,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:n,onChange:a=>{e(a.target.value)},onKeyDown:a=>{a.key==="Enter"&&u()}})}),l.jsxs("div",{className:"filter-summary",title:"Status: "+v+`
2
- Projects: `+g,onClick:()=>p(!c),children:[l.jsx("span",{className:"filter-label",children:"Status:"})," ",v,l.jsx("span",{className:"filter-label",children:"Projects:"})," ",g]}),c&&l.jsxs("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[l.jsx("div",{className:"filter-list",children:[...t.entries()].map(([a,m])=>l.jsx("div",{className:"filter-entry",children:l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:m,onClick:()=>{const x=new Map(t);x.set(a,!x.get(a)),s(x)}}),l.jsx("div",{children:a})]})}))}),l.jsx("div",{className:"filter-list",children:[...i.entries()].map(([a,m])=>l.jsx("div",{className:"filter-entry",children:l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:m,onClick:()=>{var B;const x=new Map(i);x.set(a,!x.get(a)),r(x);const T=(B=o==null?void 0:o.config)==null?void 0:B.configFile;T&&we.setObject(T+":projects",[...x.entries()].filter(([_,R])=>R).map(([_])=>_))}}),l.jsx("div",{children:a||"untitled"})]})}))})]})]})},et=Ae,tt=({statusFilters:n,projectFilters:e,filterText:t,testModel:s,runTests:i,runningState:r,watchAll:o,watchedTreeIds:u,setWatchedTreeIds:c,isLoading:p,onItemSelected:h,setVisibleTestIds:v,requestedCollapseAllCount:g})=>{const[a,m]=f.useState({expandedItems:new Map}),[x,T]=f.useState(),[B,_]=f.useState(g),{rootItem:R,treeItemMap:M,fileNames:X}=f.useMemo(()=>{let d=rt(s.rootSuite,s.loadErrors,e);lt(d,t,n,r==null?void 0:r.testIds),Se(d),d=at(d),ct(d);const S=new Map,w=new Set,b=new Set,k=E=>{E.kind==="group"&&E.location.file&&b.add(E.location.file),E.kind==="case"&&E.tests.forEach(J=>w.add(J.id)),E.children.forEach(k),S.set(E.id,E)};return k(d),v(w),{rootItem:d,treeItemMap:S,fileNames:b}},[t,s,n,e,v,r]);f.useEffect(()=>{if(B!==g){a.expandedItems.clear();for(const w of M.keys())a.expandedItems.set(w,!1);_(g),T(void 0),m({...a});return}if(!r||r.itemSelectedByUser)return;let d;const S=w=>{var b;w.children.forEach(S),!d&&w.status==="failed"&&(w.kind==="test"&&r.testIds.has(w.test.id)||w.kind==="case"&&r.testIds.has((b=w.tests[0])==null?void 0:b.id))&&(d=w)};S(R),d&&T(d.id)},[r,T,R,B,_,g,a,m,M]);const{selectedTreeItem:te}=f.useMemo(()=>{const d=x?M.get(x):void 0;let S;d&&(S={file:d.location.file,line:d.location.line,source:{errors:s.loadErrors.filter(b=>{var k;return((k=b.location)==null?void 0:k.file)===d.location.file}).map(b=>({line:b.location.line,message:b.message})),content:void 0}});let w;return(d==null?void 0:d.kind)==="test"?w=d.test:(d==null?void 0:d.kind)==="case"&&d.tests.length===1&&(w=d.tests[0]),h({treeItem:d,testCase:w,testFile:S}),{selectedTreeItem:d}},[h,x,s,M]);f.useEffect(()=>{if(!p)if(o)q("watch",{fileNames:[...X]});else{const d=new Set;for(const S of u.value){const w=M.get(S),b=w==null?void 0:w.location.file;b&&d.add(b)}q("watch",{fileNames:[...d]})}},[p,R,X,o,u,M]);const A=d=>{T(d.id),i("bounce-if-busy",re(d))};return ve=d=>{const S=[],w=new Set(d);if(o){const b=k=>{const E=k.location.file;E&&w.has(E)&&S.push(...re(k)),k.kind==="group"&&k.subKind==="folder"&&k.children.forEach(b)};b(R)}else for(const b of u.value){const k=M.get(b),E=k==null?void 0:k.location.file;E&&w.has(E)&&S.push(...re(k))}i("queue-if-busy",new Set(S))},l.jsx(et,{name:"tests",treeState:a,setTreeState:m,rootItem:R,dataTestId:"test-tree",render:d=>l.jsxs("div",{className:"hbox ui-mode-list-item",children:[l.jsx("div",{className:"ui-mode-list-item-title",title:d.title,children:d.title}),!!d.duration&&d.status!=="skipped"&&l.jsx("div",{className:"ui-mode-list-item-time",children:Fe(d.duration)}),l.jsxs(G,{noMinHeight:!0,noShadow:!0,children:[l.jsx(y,{icon:"play",title:"Run",onClick:()=>A(d),disabled:!!r}),l.jsx(y,{icon:"go-to-file",title:"Open in VS Code",onClick:()=>q("open",{location:ot(d)}),style:d.kind==="group"&&d.subKind==="folder"?{visibility:"hidden"}:{}}),!o&&l.jsx(y,{icon:"eye",title:"Watch",onClick:()=>{u.value.has(d.id)?u.value.delete(d.id):u.value.add(d.id),c({...u})},toggled:u.value.has(d.id)})]})]}),icon:d=>Ie(d.status),selectedItem:te,onAccepted:A,onSelected:d=>{r&&(r.itemSelectedByUser=!0),T(d.id)},isError:d=>d.kind==="group"?d.hasLoadErrors:!1,autoExpandDepth:t?5:1,noItemsMessage:p?"Loading…":"No tests"})},st=({item:n,rootDir:e})=>{var g;const[t,s]=f.useState(),[i,r]=f.useState(0),o=f.useRef(null),{outputDir:u}=f.useMemo(()=>({outputDir:n.testCase?nt(n.testCase):void 0}),[n]),[c,p]=f.useState(),h=f.useCallback(a=>p(de(a)),[p]),v=c?t==null?void 0:t.model.actions.find(a=>de(a)===c):void 0;return f.useEffect(()=>{var T,B;o.current&&clearTimeout(o.current);const a=(T=n.testCase)==null?void 0:T.results[0];if(!a){s(void 0);return}const m=a&&a.duration>=0&&a.attachments.find(_=>_.name==="trace");if(m&&m.path){me(m.path).then(_=>s({model:_,isLive:!1}));return}if(!u){s(void 0);return}const x=`${u}/${Qe(a.workerIndex)}/traces/${(B=n.testCase)==null?void 0:B.id}.json`;return o.current=setTimeout(async()=>{try{const _=await me(x);s({model:_,isLive:!0})}catch{s(void 0)}finally{r(i+1)}},500),()=>{o.current&&clearTimeout(o.current)}},[u,n,s,i,r]),l.jsx(We,{model:t==null?void 0:t.model,hideStackFrames:!0,showSourcesFirst:!0,rootDir:e,initialSelection:v,onSelectionChanged:h,fallbackLocation:n.testFile,isLive:t==null?void 0:t.isLive,status:(g=n.treeItem)==null?void 0:g.status},"workbench")};let H,$,pe,ee,U;const ge=()=>{clearTimeout(ee),ee=void 0,le(U.config,U.rootSuite,U.loadErrors,U.progress)},K=(n,e,t,s,i=!1)=>{U={config:n,rootSuite:e,loadErrors:t,progress:s},i?ge():ee||(ee=setTimeout(ge,250))},be=n=>{if(!n)return I("list",{});let e;const t=[],s={total:0,passed:0,failed:0,skipped:0};let i;return H=new fe(Y,{version:()=>"v2",onConfigure:r=>{i=r,$=new fe(Y,{onBegin:o=>{pe=o.allTests().length,$=void 0}},!1)},onBegin:r=>{e||(e=r),s.total=pe,s.passed=0,s.failed=0,s.skipped=0,K(i,e,t,s,!0)},onEnd:()=>{K(i,e,t,s,!0)},onTestBegin:()=>{K(i,e,t,s)},onTestEnd:r=>{r.outcome()==="skipped"?++s.skipped:r.outcome()==="unexpected"?++s.failed:++s.passed,K(i,e,t,s)},onError:r=>{O.write((r.stack||r.value||"")+`
3
- `),t.push(r),K(i,e??new W("","root"),t,s)},printsToStdio:()=>!1,onStdOut:()=>{},onStdErr:()=>{},onExit:()=>{},onStepBegin:()=>{},onStepEnd:()=>{}},!0),H._setClearPreviousResultsWhenTestBegins(),I("list",{})},q=(n,e)=>{if(window._overrideProtocolForTest){window._overrideProtocolForTest({method:n,params:e}).catch(()=>{});return}I(n,e).catch(t=>{console.error(t)})},it=(n,e)=>{var t,s;if(n==="listChanged"){be(!1).catch(()=>{});return}if(n==="testFilesChanged"){ve(e.testFileNames);return}if(n==="stdio"){if(e.buffer){const i=atob(e.buffer);O.write(i)}else O.write(e.text);return}(t=$==null?void 0:$.dispatch({method:n,params:e}))==null||t.catch(()=>{}),(s=H==null?void 0:H.dispatch({method:n,params:e}))==null||s.catch(()=>{})},nt=n=>{var e;for(let t=n.parent;t;t=t.parent)if(t.project())return(e=t.project())==null?void 0:e.outputDir},ot=n=>{if(n)return n.location.file+":"+n.location.line},re=n=>{const e=new Set;if(!n)return e;const t=s=>{var i;s.kind==="case"?s.tests.map(r=>r.id).forEach(r=>e.add(r)):s.kind==="test"?e.add(s.id):(i=s.children)==null||i.forEach(t)};return t(n),e};function ae(n,e,t,s){if(e.length===0)return n;const i=e.join(Y),r=s.get(i);if(r)return r;const o=ae(n,e.slice(0,e.length-1),!1,s),u={kind:"group",subKind:t?"file":"folder",id:i,title:e[e.length-1],location:{file:i,line:0,column:0},duration:0,parent:o,children:[],status:"none",hasLoadErrors:!1};return o.children.push(u),s.set(i,u),u}function rt(n,e,t){const s=[...t.values()].some(Boolean),i={kind:"group",subKind:"folder",id:"root",title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},r=(u,c,p)=>{for(const h of c.suites){const v=h.title||"<anonymous>";let g=p.children.find(a=>a.kind==="group"&&a.title===v);g||(g={kind:"group",subKind:"describe",id:"suite:"+c.titlePath().join("")+""+v,title:v,location:h.location,duration:0,parent:p,children:[],status:"none",hasLoadErrors:!1},p.children.push(g)),r(u,h,g)}for(const h of c.tests){const v=h.title;let g=p.children.find(x=>x.kind!=="group"&&x.title===v);g||(g={kind:"case",id:"test:"+h.titlePath().join(""),title:v,parent:p,children:[],tests:[],location:h.location,duration:0,status:"none"},p.children.push(g));const a=h.results[0];let m="none";(a==null?void 0:a.statusEx)==="scheduled"?m="scheduled":(a==null?void 0:a.statusEx)==="running"?m="running":(a==null?void 0:a.status)==="skipped"?m="skipped":(a==null?void 0:a.status)==="interrupted"?m="none":a&&h.outcome()!=="expected"?m="failed":a&&h.outcome()==="expected"&&(m="passed"),g.tests.push(h),g.children.push({kind:"test",id:h.id,title:u,location:h.location,test:h,parent:g,children:[],status:m,duration:h.results.length?Math.max(0,h.results[0].duration):0,project:u}),g.duration=g.children.reduce((x,T)=>x+T.duration,0)}},o=new Map;for(const u of(n==null?void 0:n.suites)||[])if(!(s&&!t.get(u.title)))for(const c of u.suites){const p=ae(i,c.location.file.split(Y),!0,o);r(u.title,c,p)}for(const u of e){if(!u.location)continue;const c=ae(i,u.location.file.split(Y),!0,o);c.hasLoadErrors=!0}return i}function lt(n,e,t,s){const i=e.trim().toLowerCase().split(" "),r=[...t.values()].some(Boolean),o=c=>{const p=c.tests[0].titlePath().join(" ").toLowerCase();return!i.every(h=>p.includes(h))&&!c.tests.some(h=>s==null?void 0:s.has(h.id))?!1:(c.children=c.children.filter(h=>!r||(s==null?void 0:s.has(h.test.id))||t.get(h.status)),c.tests=c.children.map(h=>h.test),!!c.children.length)},u=c=>{const p=[];for(const h of c.children)h.kind==="case"?o(h)&&p.push(h):(u(h),(h.children.length||h.hasLoadErrors)&&p.push(h));c.children=p};u(n)}function Se(n){for(const o of n.children)Se(o);n.kind==="group"&&n.children.sort((o,u)=>o.location.file.localeCompare(u.location.file)||o.location.line-u.location.line);let e=n.children.length>0,t=n.children.length>0,s=!1,i=!1,r=!1;for(const o of n.children)t=t&&o.status==="skipped",e=e&&(o.status==="passed"||o.status==="skipped"),s=s||o.status==="failed",i=i||o.status==="running",r=r||o.status==="scheduled";i?n.status="running":r?n.status="scheduled":s?n.status="failed":t?n.status="skipped":e&&(n.status="passed")}function at(n){let e=n;for(;e.children.length===1&&e.children[0].kind==="group"&&e.children[0].subKind==="folder";)e=e.children[0];return e.location=n.location,e}function ct(n){const e=t=>{t.kind==="case"&&t.children.length===1?t.children=[]:t.children.forEach(e)};e(n)}async function me(n){const e=new URLSearchParams;e.set("trace",n);const s=await(await fetch(`contexts?${e.toString()}`)).json();return new Oe(s)}const Y=navigator.userAgent.toLowerCase().includes("windows")?"\\":"/";(async()=>{if(ze(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(n=>setTimeout(n,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
4
- Make sure to serve the website (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(n=>{navigator.serviceWorker.oncontrollerchange=()=>n()}),setInterval(function(){fetch("ping")},1e4)}Ve.render(l.jsx(Ze,{}),document.querySelector("#root"))})();
5
- function __vite__mapDeps(indexes) {
6
- if (!__vite__mapDeps.viteFileDeps) {
7
- __vite__mapDeps.viteFileDeps = ["./assets/xtermModule-Yt6xwiJ_.js","./xtermModule.0lwXJFHT.css"]
8
- }
9
- return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
10
- }