@checkly/playwright-core 1.42.14 → 1.42.16

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 (68) hide show
  1. package/lib/vite/{traceViewer/assets/codeMirrorModule-75b0ca4f.js → recorder/assets/codeMirrorModule-LTVFY0Ab.js} +1 -1
  2. package/lib/vite/recorder/assets/{index-Ly3PcVUb.js → index-wuONJPd7.js} +2 -2
  3. package/lib/vite/recorder/index.html +1 -1
  4. package/lib/vite/traceViewer/assets/{codeMirrorModule-c1454a2e.js → codeMirrorModule-Vg1kIqMp.js} +10 -10
  5. package/lib/vite/traceViewer/assets/{codeMirrorModule-e5a15eec.js → codeMirrorModule-wLpsbIhd.js} +13 -13
  6. package/lib/vite/traceViewer/assets/wsPort-RIoVGhlT.js +69 -0
  7. package/lib/vite/traceViewer/assets/wsPort-f2dAQL4I.js +69 -0
  8. package/lib/vite/traceViewer/index.-_8-eHEE.js +2 -0
  9. package/lib/vite/traceViewer/index.html +2 -2
  10. package/lib/vite/traceViewer/index.qOFdH9Ja.js +2 -0
  11. package/lib/vite/traceViewer/uiMode.9CwNsWc6.js +10 -0
  12. package/lib/vite/traceViewer/uiMode.html +2 -2
  13. package/lib/vite/traceViewer/uiMode.iNIhieBM.js +10 -0
  14. package/package.json +1 -1
  15. package/lib/checkly/sWatcher.js +0 -150
  16. package/lib/cli/cli.js +0 -62
  17. package/lib/common/debugLogger.js +0 -91
  18. package/lib/vite/recorder/assets/codeMirrorModule-W69B4LBB.js +0 -24
  19. package/lib/vite/traceViewer/assets/codeMirrorModule-5nkjDDU_.js +0 -15578
  20. package/lib/vite/traceViewer/assets/codeMirrorModule-cc2329e4.js +0 -15593
  21. package/lib/vite/traceViewer/assets/codeMirrorModule-d725feea.js +0 -15586
  22. package/lib/vite/traceViewer/assets/codeMirrorModule-kT-uS7F4.js +0 -15592
  23. package/lib/vite/traceViewer/assets/codeMirrorModule-rcsC5no8.js +0 -15592
  24. package/lib/vite/traceViewer/assets/codeMirrorModule-ytMY1awF.js +0 -15585
  25. package/lib/vite/traceViewer/assets/wsPort-54626118.js +0 -18361
  26. package/lib/vite/traceViewer/assets/wsPort-98e00a94.js +0 -64
  27. package/lib/vite/traceViewer/assets/wsPort-KEbz4l8i.js +0 -18540
  28. package/lib/vite/traceViewer/assets/wsPort-a88a6a12.js +0 -18361
  29. package/lib/vite/traceViewer/assets/wsPort-cb764cde.js +0 -64
  30. package/lib/vite/traceViewer/assets/wsPort-ee2830d7.js +0 -64
  31. package/lib/vite/traceViewer/assets/wsPort-lTlmZhJd.js +0 -18564
  32. package/lib/vite/traceViewer/assets/wsPort-xpIMLVfx.js +0 -18540
  33. package/lib/vite/traceViewer/assets/wsPort-yM58htfg.js +0 -18360
  34. package/lib/vite/traceViewer/assets/xtermModule-443332e6.js +0 -9
  35. package/lib/vite/traceViewer/assets/xtermModule-60687b6b.js +0 -6410
  36. package/lib/vite/traceViewer/codeMirrorModule.5d0f417c.css +0 -1
  37. package/lib/vite/traceViewer/codeMirrorModule.eb494ea9.css +0 -344
  38. package/lib/vite/traceViewer/codicon.79f233d0.ttf +0 -0
  39. package/lib/vite/traceViewer/index.1a1fe659.css +0 -1
  40. package/lib/vite/traceViewer/index.4a8ee36e.js +0 -2
  41. package/lib/vite/traceViewer/index.55e65778.js +0 -181
  42. package/lib/vite/traceViewer/index.742fd3e5.js +0 -181
  43. package/lib/vite/traceViewer/index.76e9f312.css +0 -124
  44. package/lib/vite/traceViewer/index.ZUjC4zt1.js +0 -180
  45. package/lib/vite/traceViewer/index.a265fbdb.js +0 -2
  46. package/lib/vite/traceViewer/index.decad628.js +0 -2
  47. package/lib/vite/traceViewer/index.ici1bqta.js +0 -180
  48. package/lib/vite/traceViewer/index.mxOcKqpu.js +0 -180
  49. package/lib/vite/traceViewer/index.zXVxM5ps.js +0 -180
  50. package/lib/vite/traceViewer/uiMode.08ab2d90.js +0 -4
  51. package/lib/vite/traceViewer/uiMode.0d0d667b.js +0 -4
  52. package/lib/vite/traceViewer/uiMode.216233d5.js +0 -1484
  53. package/lib/vite/traceViewer/uiMode.2c31018f.css +0 -1324
  54. package/lib/vite/traceViewer/uiMode.468b0309.js +0 -4
  55. package/lib/vite/traceViewer/uiMode.67C8Ij-c.js +0 -1490
  56. package/lib/vite/traceViewer/uiMode.8b41a49d.css +0 -1
  57. package/lib/vite/traceViewer/uiMode.F_k6a2aC.js +0 -1488
  58. package/lib/vite/traceViewer/uiMode.NjZAwD_B.js +0 -1485
  59. package/lib/vite/traceViewer/uiMode.YQRCZjm8.js +0 -1485
  60. package/lib/vite/traceViewer/uiMode.b2068d00.js +0 -1484
  61. package/lib/vite/traceViewer/uiMode.kvEeWpo2.js +0 -1490
  62. package/lib/vite/traceViewer/uiMode.ljHA9Ynz.js +0 -1490
  63. package/lib/vite/traceViewer/uiMode.ybQP_6Xr.js +0 -10
  64. package/lib/vite/traceViewer/wsPort.997c92cf.css +0 -3513
  65. package/lib/vite/traceViewer/wsPort.9c9a6767.css +0 -1
  66. package/lib/vite/traceViewer/wsPort.Oa05jfrO.css +0 -3513
  67. package/lib/vite/traceViewer/xtermModule.125f4259.css +0 -191
  68. package/lib/vite/traceViewer/xtermModule.6428296b.css +0 -32
@@ -1,10 +0,0 @@
1
- import{u as Ce,r as K,d as ye,_ as Be,e as Ne,f as Re,j as a,R as f,g as Pe,c as Me,s as we,S as De,h as ee,T as y,t as Le,m as Fe,i as Ie,k as fe,W as Oe,M as We,l as Ae,a as ze,b as Ve}from"./assets/wsPort-964mA9MZ.js";var Ke={};class pe{constructor(e,t){this._tests=new Map,this._listOnly=!1,this._clearPreviousResultsWhenTestBegins=!1,this._rootSuite=new W("","root"),this._options=t,this._reporter=e}dispatch(e,t){const{method:s,params:i}=t;if(s==="onConfigure"){this._onConfigure(i.config),this._listOnly=e==="list";return}if(s==="onProject"){this._onProject(i.project);return}if(s==="onBegin"){this._onBegin();return}if(s==="onTestBegin"){this._onTestBegin(i.testId,i.result);return}if(s==="onTestEnd"){this._onTestEnd(i.test,i.result);return}if(s==="onStepBegin"){this._onStepBegin(i.testId,i.resultId,i.step);return}if(s==="onStepEnd"){this._onStepEnd(i.testId,i.resultId,i.step);return}if(s==="onError"){this._onError(i.error);return}if(s==="onStdIO"){this._onStdIO(i.type,i.testId,i.resultId,i.data,i.isBase64);return}if(s==="onEnd")return this._onEnd(i.result);if(s==="onExit")return this._onExit()}_setClearPreviousResultsWhenTestBegins(){this._clearPreviousResultsWhenTestBegins=!0}_onConfigure(e){var t,s;this._rootDir=e.rootDir,this._config=this._parseConfig(e),(s=(t=this._reporter).onConfigure)==null||s.call(t,this._config)}_onProject(e){let t=this._options.mergeProjects?this._rootSuite.suites.find(s=>s.project().name===e.name):void 0;if(t||(t=new W(e.name,"project"),this._rootSuite.suites.push(t),t.parent=this._rootSuite),t._project=this._parseProject(e),this._mergeSuitesInto(e.suites,t),this._listOnly){const s=new Set,i=o=>{o.tests.map(c=>c.testId).forEach(c=>s.add(c)),o.suites.forEach(i)};e.suites.forEach(i);const r=o=>{o.tests=o.tests.filter(c=>s.has(c.id)),o.suites.forEach(r)};r(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),(o=(r=this._reporter).onTestBegin)==null||o.call(r,s,i)}_onTestEnd(e,t){var r,o,c;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.errors=t.errors,i.error=(r=i.errors)==null?void 0:r[0],i.attachments=this._parseAttachments(t.attachments),(c=(o=this._reporter).onTestEnd)==null||c.call(o,s,i),i._stepMap=new Map}_onStepBegin(e,t,s){var p,d;const i=this._tests.get(e),r=i._resultsMap.get(t),o=s.parentStepId?r._stepMap.get(s.parentStepId):void 0,c=this._absoluteLocation(s.location),h=new He(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(e,t,s){var c,h;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,(h=(c=this._reporter).onStepEnd)==null||h.call(c,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,d,x,g;const o=r?globalThis.Buffer?Buffer.from(i,"base64"):atob(i):i,c=t?this._tests.get(t):void 0,h=c&&s?c._resultsMap.get(s):void 0;e==="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=(x=this._reporter).onStdErr)==null||g.call(x,o,c,h))}async _onEnd(e){var t,s;await((s=(t=this._reporter).onEnd)==null?void 0:s.call(t,{status:e.status,startTime:new Date(e.startTime),duration:e.duration}))}_onExit(){var e,t;return(t=(e=this._reporter).onExit)==null?void 0:t.call(e)}_parseConfig(e){const t={...xe,...e};return this._options.configOverrides&&(t.configFile=this._options.configOverrides.configFile,t.reportSlowTests=this._options.configOverrides.reportSlowTests,t.quiet=this._options.configOverrides.quiet,t.reporter=[...this._options.configOverrides.reporter]),t}_parseProject(e){return{metadata:e.metadata,name:e.name,outputDir:this._absolutePath(e.outputDir),repeatEach:e.repeatEach,retries:e.retries,testDir:this._absolutePath(e.testDir),testIgnore:G(e.testIgnore),testMatch:G(e.testMatch),timeout:e.timeout,grep:G(e.grep),grepInvert:G(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,t._type==="project"?"file":"describe"),i.parent=t,t.suites.push(i)),i.location=this._absoluteLocation(s.location),this._mergeSuitesInto(s.suites,i),this._mergeTestsInto(s.tests,i)}}_mergeTestsInto(e,t){for(const s of e){let i=this._options.mergeTestCases?t.tests.find(r=>r.title===s.title&&r.repeatEachIndex===s.repeatEachIndex):void 0;i||(i=new Ue(s.testId,s.title,this._absoluteLocation(s.location),s.repeatEachIndex),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.tags=e.tags??[],t}_absoluteLocation(e){return e&&{...e,file:this._absolutePath(e.file)}}_absolutePath(e){if(e!==void 0)return this._options.resolvePath(this._rootDir,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(){var e;return this._project??((e=this.parent)==null?void 0:e.project())}}class Ue{constructor(e,t,s,i){this.fn=()=>{},this.results=[],this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.tags=[],this.repeatEachIndex=0,this._resultsMap=new Map,this.id=e,this.title=t,this.location=s,this.repeatEachIndex=i}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._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 G(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]=K.useState(ye()),[r]=K.useState(Be(()=>import("./assets/xtermModule-Yt6xwiJ_.js"),__vite__mapDeps([0,1]),import.meta.url).then(c=>c.default)),o=K.useRef(null);return K.useEffect(()=>(Ne(i),()=>Re(i)),[]),K.useEffect(()=>{const c=n.write,h=n.clear;return(async()=>{const{Terminal:p,FitAddon:d}=await r,x=t.current;if(!x)return;const g=s==="dark-mode"?Xe:Ye;if(o.current&&o.current.terminal.options.theme===g)return;o.current&&(x.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 w of n.pending)l.write(w);n.write=w=>{n.pending.push(w),l.write(w)},n.clear=()=>{n.pending=[],l.clear()},l.open(x),m.fit(),o.current={terminal:l,fitAddon:m}})(),()=>{n.clear=h,n.write=c}},[r,o,t,n,s]),K.useEffect(()=>{setTimeout(()=>{o.current&&(o.current.fitAddon.fit(),n.resize(o.current.terminal.cols,o.current.terminal.rows))},250)},[e,n]),a.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})=>a.jsxs("div",{className:"expandable"+(s?" expanded":""),children:[a.jsxs("div",{className:"expandable-title",onClick:()=>i&&t(!s),children:[a.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&&a.jsx("div",{style:{marginLeft:25},children:e})]});function Qe(n){return`.playwright-artifacts-${n}`}let ce=()=>{},_e=n=>{},be={cols:80,rows:24},O=async()=>{};const A={pending:[],clear:()=>{},write:n=>A.pending.push(n),resize:(n,e)=>{be={cols:n,rows:e},q("resizeTerminal",{cols:n,rows:e})}},Ze=({})=>{var he;const[n,e]=f.useState(""),[t,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,x]=f.useState(),[g,l]=f.useState({}),[m,w]=f.useState(new Set),[T,B]=f.useState(!1),[_,P]=f.useState(),[N,J]=Pe("watch-all",!1),[se,z]=f.useState({value:new Set}),u=f.useRef(Promise.resolve()),S=f.useRef(new Set),[v,b]=f.useState(0),[k,E]=f.useState(!1),[Q,de]=f.useState(!0),ke=f.useRef(null),ie=f.useCallback(()=>{B(!0),z({value:new Set}),ce(xe,new W("","root"),[],void 0),Se(!0).then(async()=>{B(!1);const{hasBrowsers:j}=await O("checkBrowsers");de(j)})},[]);f.useEffect(()=>{var j;(j=ke.current)==null||j.focus(),B(!0),Me({onEvent:it,onClose:()=>E(!0)}).then(C=>{O=async(M,D)=>{const R=window.__logForTest;R==null||R({method:M,params:D}),await C(M,D)},ie()})},[ie]),ce=f.useCallback((j,C,M,D)=>{const R=j.configFile?we.getObject(j.configFile+":projects",void 0):void 0;for(const L of o.keys())C.suites.find(Z=>Z.title===L)||o.delete(L);for(const L of C.suites)o.has(L.title)||o.set(L.title,!!(R!=null&&R.includes(L.title)));!R&&o.size&&![...o.values()].includes(!0)&&o.set(o.entries().next().value[0],!0),p({config:j,rootSuite:C,loadErrors:M}),c(new Map(o)),_&&D?x(D):D||x(void 0)},[o,_]);const ne=f.useCallback((j,C)=>{j==="bounce-if-busy"&&_||(S.current=new Set([...S.current,...C]),u.current=u.current.then(async()=>{var R,L,Z;const M=S.current;if(S.current=new Set,!M.size)return;{for(const F of((R=h.rootSuite)==null?void 0:R.allTests())||[])if(M.has(F.id)){F._clearResults();const ae=F._createTestResult("pending");ae[X]="scheduled"}p({...h})}const D=" ["+new Date().toLocaleTimeString()+"]";A.write("\x1B[2m—".repeat(Math.max(0,be.cols-D.length))+D+"\x1B[22m"),x({total:0,passed:0,failed:0,skipped:0}),P({testIds:M}),await O("run",{testIds:[...M],projects:[...o].filter(([F,ae])=>ae).map(([F])=>F)});for(const F of((L=h.rootSuite)==null?void 0:L.allTests())||[])((Z=F.results[0])==null?void 0:Z.duration)===-1&&F._clearResults();p({...h}),P(void 0)}))},[o,_,h]),V=!!_,oe=f.useRef(null),je=f.useCallback(j=>{var C;j.preventDefault(),j.stopPropagation(),(C=oe.current)==null||C.showModal()},[]),re=f.useCallback(j=>{var C;j.preventDefault(),j.stopPropagation(),(C=oe.current)==null||C.close()},[]),Ee=f.useCallback(j=>{re(j),s(!0),O("installBrowsers").then(async()=>{s(!1);const{hasBrowsers:C}=await O("checkBrowsers");de(C)})},[re]);return a.jsxs("div",{className:"vbox ui-mode",children:[!Q&&a.jsxs("dialog",{ref:oe,children:[a.jsxs("div",{className:"title",children:[a.jsx("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),a.jsxs("div",{className:"body",children:["Playwright did not find installed browsers.",a.jsx("br",{}),"Would you like to run `playwright install`?",a.jsx("br",{}),a.jsx("button",{className:"button",onClick:Ee,children:"Install"}),a.jsx("button",{className:"button secondary",onClick:re,children:"Dismiss"})]})]}),k&&a.jsxs("div",{className:"disconnected",children:[a.jsx("div",{className:"title",children:"UI Mode disconnected"}),a.jsxs("div",{children:[a.jsx("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),a.jsxs(De,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",children:[a.jsxs("div",{className:"vbox",children:[a.jsxs("div",{className:"vbox"+(t?"":" hidden"),children:[a.jsxs(ee,{children:[a.jsx("div",{className:"section-title",style:{flex:"none"},children:"Output"}),a.jsx(y,{icon:"circle-slash",title:"Clear output",onClick:()=>A.clear()}),a.jsx("div",{className:"spacer"}),a.jsx(y,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),a.jsx(qe,{source:A})]}),a.jsx("div",{className:"vbox"+(t?" hidden":""),children:a.jsx(st,{item:g,rootDir:(he=h.config)==null?void 0:he.rootDir})})]}),a.jsxs("div",{className:"vbox ui-mode-sidebar",children:[a.jsxs(ee,{noShadow:!0,noMinHeight:!0,children:[a.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),a.jsx("div",{className:"section-title",children:"Playwright"}),a.jsx(y,{icon:"color-mode",title:"Toggle color mode",onClick:()=>Le()}),a.jsx(y,{icon:"refresh",title:"Reload",onClick:()=>ie(),disabled:V||T}),a.jsx(y,{icon:"terminal",title:"Toggle output",toggled:t,onClick:()=>{s(!t)}}),!Q&&a.jsx(y,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:je})]}),a.jsx(Ge,{filterText:n,setFilterText:e,statusFilters:i,setStatusFilters:r,projectFilters:o,setProjectFilters:c,testModel:h,runTests:()=>ne("bounce-if-busy",m)}),a.jsxs(ee,{noMinHeight:!0,children:[!V&&!d&&a.jsx("div",{className:"section-title",children:"Tests"}),!V&&d&&a.jsx("div",{"data-testid":"status-line",className:"status-line",children:a.jsxs("div",{children:[d.passed,"/",d.total," passed (",d.passed/d.total*100|0,"%)"]})}),V&&d&&a.jsx("div",{"data-testid":"status-line",className:"status-line",children:a.jsxs("div",{children:["Running ",d.passed,"/",_.testIds.size," passed (",d.passed/_.testIds.size*100|0,"%)"]})}),a.jsx(y,{icon:"play",title:"Run all",onClick:()=>ne("bounce-if-busy",m),disabled:V||T}),a.jsx(y,{icon:"debug-stop",title:"Stop",onClick:()=>q("stop"),disabled:!V||T}),a.jsx(y,{icon:"eye",title:"Watch all",toggled:N,onClick:()=>{z({value:new Set}),J(!N)}}),a.jsx(y,{icon:"collapse-all",title:"Collapse all",onClick:()=>{b(v+1)}})]}),a.jsx(tt,{statusFilters:i,projectFilters:o,filterText:n,testModel:h,runningState:_,runTests:ne,onItemSelected:l,setVisibleTestIds:w,watchAll:N,watchedTreeIds:se,setWatchedTreeIds:z,isLoading:T,requestedCollapseAllCount:v})]})]})]})},Ge=({filterText:n,setFilterText:e,statusFilters:t,setStatusFilters:s,projectFilters:i,setProjectFilters:r,testModel:o,runTests:c})=>{const[h,p]=f.useState(!1),d=f.useRef(null);f.useEffect(()=>{var l;(l=d.current)==null||l.focus()},[]);const x=[...t.entries()].filter(([l,m])=>m).map(([l])=>l).join(" ")||"all",g=[...i.entries()].filter(([l,m])=>m).map(([l])=>l).join(" ")||"all";return a.jsxs("div",{className:"filters",children:[a.jsx(Je,{expanded:h,setExpanded:p,title:a.jsx("input",{ref:d,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:n,onChange:l=>{e(l.target.value)},onKeyDown:l=>{l.key==="Enter"&&c()}})}),a.jsxs("div",{className:"filter-summary",title:"Status: "+x+`
2
- Projects: `+g,onClick:()=>p(!h),children:[a.jsx("span",{className:"filter-label",children:"Status:"})," ",x,a.jsx("span",{className:"filter-label",children:"Projects:"})," ",g]}),h&&a.jsxs("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[a.jsx("div",{className:"filter-list",children:[...t.entries()].map(([l,m])=>a.jsx("div",{className:"filter-entry",children:a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:m,onClick:()=>{const w=new Map(t);w.set(l,!w.get(l)),s(w)}}),a.jsx("div",{children:l})]})}))}),a.jsx("div",{className:"filter-list",children:[...i.entries()].map(([l,m])=>a.jsx("div",{className:"filter-entry",children:a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:m,onClick:()=>{var B;const w=new Map(i);w.set(l,!w.get(l)),r(w);const T=(B=o==null?void 0:o.config)==null?void 0:B.configFile;T&&we.setObject(T+":projects",[...w.entries()].filter(([_,P])=>P).map(([_])=>_))}}),a.jsx("div",{children:l||"untitled"})]})}))})]})]})},et=Ae,tt=({statusFilters:n,projectFilters:e,filterText:t,testModel:s,runTests:i,runningState:r,watchAll:o,watchedTreeIds:c,setWatchedTreeIds:h,isLoading:p,onItemSelected:d,setVisibleTestIds:x,requestedCollapseAllCount:g})=>{const[l,m]=f.useState({expandedItems:new Map}),[w,T]=f.useState(),[B,_]=f.useState(g),{rootItem:P,treeItemMap:N,fileNames:J}=f.useMemo(()=>{let u=rt(s.rootSuite,s.loadErrors,e);at(u,t,n,r==null?void 0:r.testIds),Te(u),u=lt(u),ct(u);const S=new Map,v=new Set,b=new Set,k=E=>{E.kind==="group"&&E.location.file&&b.add(E.location.file),E.kind==="case"&&E.tests.forEach(Q=>v.add(Q.id)),E.children.forEach(k),S.set(E.id,E)};return k(u),x(v),{rootItem:u,treeItemMap:S,fileNames:b}},[t,s,n,e,x,r]);f.useEffect(()=>{if(B!==g){l.expandedItems.clear();for(const v of N.keys())l.expandedItems.set(v,!1);_(g),T(void 0),m({...l});return}if(!r||r.itemSelectedByUser)return;let u;const S=v=>{var b;v.children.forEach(S),!u&&v.status==="failed"&&(v.kind==="test"&&r.testIds.has(v.test.id)||v.kind==="case"&&r.testIds.has((b=v.tests[0])==null?void 0:b.id))&&(u=v)};S(P),u&&T(u.id)},[r,T,P,B,_,g,l,m,N]);const{selectedTreeItem:se}=f.useMemo(()=>{const u=w?N.get(w):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 v;return(u==null?void 0:u.kind)==="test"?v=u.test:(u==null?void 0:u.kind)==="case"&&u.tests.length===1&&(v=u.tests[0]),d({treeItem:u,testCase:v,testFile:S}),{selectedTreeItem:u}},[d,w,s,N]);f.useEffect(()=>{if(!p)if(o)q("watch",{fileNames:[...J]});else{const u=new Set;for(const S of c.value){const v=N.get(S),b=v==null?void 0:v.location.file;b&&u.add(b)}q("watch",{fileNames:[...u]})}},[p,P,J,o,c,N]);const z=u=>{T(u.id),i("bounce-if-busy",le(u))};return _e=u=>{const S=[],v=new Set(u);if(o){const b=k=>{const E=k.location.file;E&&v.has(E)&&S.push(...le(k)),k.kind==="group"&&k.subKind==="folder"&&k.children.forEach(b)};b(P)}else for(const b of c.value){const k=N.get(b),E=k==null?void 0:k.location.file;E&&v.has(E)&&S.push(...le(k))}i("queue-if-busy",new Set(S))},a.jsx(et,{name:"tests",treeState:l,setTreeState:m,rootItem:P,dataTestId:"test-tree",render:u=>a.jsxs("div",{className:"hbox ui-mode-list-item",children:[a.jsx("div",{className:"ui-mode-list-item-title",title:u.title,children:u.title}),!!u.duration&&u.status!=="skipped"&&a.jsx("div",{className:"ui-mode-list-item-time",children:Fe(u.duration)}),a.jsxs(ee,{noMinHeight:!0,noShadow:!0,children:[a.jsx(y,{icon:"play",title:"Run",onClick:()=>z(u),disabled:!!r}),a.jsx(y,{icon:"go-to-file",title:"Open in VS Code",onClick:()=>q("open",{location:ot(u)}),style:u.kind==="group"&&u.subKind==="folder"?{visibility:"hidden"}:{}}),!o&&a.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=>Ie(u.status),selectedItem:se,onAccepted:z,onSelected:u=>{r&&(r.itemSelectedByUser=!0),T(u.id)},isError:u=>u.kind==="group"?u.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:c}=f.useMemo(()=>({outputDir:n.testCase?nt(n.testCase):void 0}),[n]),[h,p]=f.useState(),d=f.useCallback(l=>p(fe(l)),[p]),x=h?t==null?void 0:t.model.actions.find(l=>fe(l)===h):void 0;return f.useEffect(()=>{var T,B;o.current&&clearTimeout(o.current);const l=(T=n.testCase)==null?void 0:T.results[0];if(!l){s(void 0);return}const m=l&&l.duration>=0&&l.attachments.find(_=>_.name==="trace");if(m&&m.path){ve(m.path).then(_=>s({model:_,isLive:!1}));return}if(!c){s(void 0);return}const w=`${c}/${Qe(l.workerIndex)}/traces/${(B=n.testCase)==null?void 0:B.id}.json`;return o.current=setTimeout(async()=>{try{const _=await ve(w);s({model:_,isLive:!0})}catch{s(void 0)}finally{r(i+1)}},500),()=>{o.current&&clearTimeout(o.current)}},[c,n,s,i,r]),a.jsx(Oe,{model:t==null?void 0:t.model,hideStackFrames:!0,showSourcesFirst:!0,rootDir:e,initialSelection:x,onSelectionChanged:d,fallbackLocation:n.testFile,isLive:t==null?void 0:t.isLive,status:(g=n.treeItem)==null?void 0:g.status},"workbench")};let I,$,ge,te,H;const me=()=>{clearTimeout(te),te=void 0,ce(H.config,H.rootSuite,H.loadErrors,H.progress)},U=(n,e,t,s,i=!1)=>{H={config:n,rootSuite:e,loadErrors:t,progress:s},i?me():te||(te=setTimeout(me,250))},Se=n=>{if(!n)return O("list",{});let e;const t=[],s={total:0,passed:0,failed:0,skipped:0};let i;return I=new pe({version:()=>"v2",onConfigure:r=>{i=r,$=new pe({onBegin:o=>{ge=o.allTests().length,$=void 0}},{mergeProjects:!0,mergeTestCases:!1,resolvePath:(o,c)=>o+Y+c})},onBegin:r=>{e||(e=r),s.total=ge,s.passed=0,s.failed=0,s.skipped=0,U(i,e,t,s,!0)},onEnd:()=>{U(i,e,t,s,!0)},onTestBegin:(r,o)=>{o[X]="running",U(i,e,t,s)},onTestEnd:(r,o)=>{r.outcome()==="skipped"?++s.skipped:r.outcome()==="unexpected"?++s.failed:++s.passed,o[X]=o.status,U(i,e,t,s)},onError:r=>{A.write((r.stack||r.value||"")+`
3
- `),t.push(r),U(i,e??new W("","root"),t,s)},printsToStdio:()=>!1,onStdOut:()=>{},onStdErr:()=>{},onExit:()=>{},onStepBegin:()=>{},onStepEnd:()=>{}},{mergeProjects:!0,mergeTestCases:!0,resolvePath:(r,o)=>r+Y+o}),I._setClearPreviousResultsWhenTestBegins(),O("list",{})},q=(n,e)=>{if(window._overrideProtocolForTest){window._overrideProtocolForTest({method:n,params:e}).catch(()=>{});return}O(n,e).catch(t=>{console.error(t)})},it=(n,e)=>{var t,s,i;if(n==="listChanged"){Se(!1).catch(()=>{});return}if(n==="testFilesChanged"){_e(e.testFileNames);return}if(n==="stdio"){if(e.buffer){const r=atob(e.buffer);A.write(r)}else A.write(e.text);return}n==="listReport"&&((t=I==null?void 0:I.dispatch("list",e))==null||t.catch(()=>{})),n==="testReport"&&((s=$==null?void 0:$.dispatch("test",e))==null||s.catch(()=>{}),(i=I==null?void 0:I.dispatch("test",e))==null||i.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},le=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 ue(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=ue(n,e.slice(0,e.length-1),!1,s),c={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(c),s.set(i,c),c}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=(c,h,p)=>{for(const d of h.suites){const x=d.title||"<anonymous>";let g=p.children.find(l=>l.kind==="group"&&l.title===x);g||(g={kind:"group",subKind:"describe",id:"suite:"+h.titlePath().join("")+""+x,title:x,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 x=d.title;let g=p.children.find(w=>w.kind!=="group"&&w.title===x);g||(g={kind:"case",id:"test:"+d.titlePath().join(""),title:x,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[X])==="scheduled"?m="scheduled":(l==null?void 0:l[X])==="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((w,T)=>w+T.duration,0)}},o=new Map;for(const c of(n==null?void 0:n.suites)||[])if(!(s&&!t.get(c.title)))for(const h of c.suites){const p=ue(i,h.location.file.split(Y),!0,o);r(c.title,h,p)}for(const c of e){if(!c.location)continue;const h=ue(i,c.location.file.split(Y),!0,o);h.hasLoadErrors=!0}return i}function at(n,e,t,s){const i=e.trim().toLowerCase().split(" "),r=[...t.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))||t.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 Te(n){for(const o of n.children)Te(o);n.kind==="group"&&n.children.sort((o,c)=>o.location.file.localeCompare(c.location.file)||o.location.line-c.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 lt(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 ve(n){const e=new URLSearchParams;e.set("trace",n);const s=await(await fetch(`contexts?${e.toString()}`)).json();return new We(s)}const Y=navigator.userAgent.toLowerCase().includes("windows")?"\\":"/",X=Symbol("statusEx");(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(a.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
- }