playwright-core 1.57.0-alpha-2025-11-06 → 1.57.0-alpha-2025-11-08
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browsers.json +4 -4
- package/lib/server/bidi/bidiBrowser.js +17 -4
- package/lib/server/bidi/bidiPage.js +12 -0
- package/lib/server/chromium/crBrowser.js +8 -0
- package/lib/server/chromium/crPage.js +4 -0
- package/lib/server/chromium/crServiceWorker.js +4 -0
- package/lib/server/deviceDescriptorsSource.json +54 -54
- package/lib/server/firefox/ffPage.js +1 -0
- package/lib/server/page.js +9 -4
- package/lib/server/registry/index.js +11 -9
- package/lib/server/webkit/wkWorkers.js +1 -0
- package/lib/vite/traceViewer/assets/{codeMirrorModule-MjrFUZ7R.js → codeMirrorModule-BiZVRa_4.js} +1 -1
- package/lib/vite/traceViewer/assets/{defaultSettingsView-DJrBVYdp.js → defaultSettingsView-C4fBnzjx.js} +45 -45
- package/lib/vite/traceViewer/{index.ChvzYTYS.js → index.C5i8AF5O.js} +1 -1
- package/lib/vite/traceViewer/index.html +2 -2
- package/lib/vite/traceViewer/{uiMode.CGTqxLRk.js → uiMode.4_zRp-hG.js} +1 -1
- package/lib/vite/traceViewer/uiMode.html +2 -2
- package/package.json +1 -1
- package/types/protocol.d.ts +38 -87
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as m,r as s,T as M,W as C,j as e,D as F,a as I,b as k,c as z,d as O,e as V}from"./assets/defaultSettingsView-
|
|
1
|
+
import{M as m,r as s,T as M,W as C,j as e,D as F,a as I,b as k,c as z,d as O,e as V}from"./assets/defaultSettingsView-C4fBnzjx.js";const $=()=>{const[o,i]=s.useState(!1),[c,l]=s.useState(),[h,u]=s.useState(),[g,L]=s.useState(N),[p,x]=s.useState({done:0,total:0}),[b,v]=s.useState(!1),[j,S]=s.useState(null),[y,P]=s.useState(null),[R,E]=s.useState(!1),w=s.useCallback(t=>{const r=new URL(window.location.href);if(!t.length)return;const n=t.item(0),a=URL.createObjectURL(n);r.searchParams.append("trace",a);const d=r.toString();window.history.pushState({},"",d),l(a),u(n.name),v(!1),S(null)},[]);s.useEffect(()=>{const t=async r=>{var n;if((n=r.clipboardData)!=null&&n.files.length){for(const a of r.clipboardData.files)if(a.type!=="application/zip")return;r.preventDefault(),w(r.clipboardData.files)}};return document.addEventListener("paste",t),()=>document.removeEventListener("paste",t)}),s.useEffect(()=>{const t=r=>{const{method:n,params:a}=r.data;if(n!=="load"||!((a==null?void 0:a.trace)instanceof Blob))return;const d=new File([a.trace],"trace.zip",{type:"application/zip"}),f=new DataTransfer;f.items.add(d),w(f.files)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const U=s.useCallback(t=>{t.preventDefault(),w(t.dataTransfer.files)},[w]),W=s.useCallback(t=>{t.preventDefault(),t.target.files&&w(t.target.files)},[w]);s.useEffect(()=>{const t=new URL(window.location.href).searchParams,r=t.get("trace");if(i(t.has("isServer")),r!=null&&r.startsWith("file:")){P(r||null);return}if(t.has("isServer")){const n=new URLSearchParams(window.location.search).get("ws"),a=new URL(`../${n}`,window.location.toString());a.protocol=window.location.protocol==="https:"?"wss:":"ws:";const d=new M(new C(a));d.onLoadTraceRequested(async f=>{l(f.traceUrl),v(!1),S(null)}),d.initialize({}).catch(()=>{})}else r&&!r.startsWith("blob:")&&l(r)},[]),s.useEffect(()=>{(async()=>{if(!c){L(N);return}const t=r=>{r.data.method==="progress"&&x(r.data.params)};try{navigator.serviceWorker.addEventListener("message",t),x({done:0,total:1});const r=new URLSearchParams;r.set("trace",c);const n=await fetch(`contexts?${r.toString()}`);if(!n.ok){o||l(void 0),S((await n.json()).error);return}const a=await n.json(),d=new m(c,a);x({done:0,total:0}),L(d)}finally{navigator.serviceWorker.removeEventListener("message",t)}})()},[o,c,h]);const D=p.done!==p.total&&p.total!==0&&!j;s.useEffect(()=>{if(D){const t=setTimeout(()=>{E(!0)},200);return()=>clearTimeout(t)}else E(!1)},[D]);const T=!!(!o&&!b&&!y&&(!c||j));return e.jsxs("div",{className:"vbox workbench-loader",onDragOver:t=>{t.preventDefault(),v(!0)},children:[e.jsxs("div",{className:"hbox header",...T?{inert:!0}:{},children:[e.jsx("div",{className:"logo",children:e.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"})}),e.jsx("div",{className:"product",children:"Playwright"}),g.title&&e.jsx("div",{className:"title",children:g.title}),e.jsx("div",{className:"spacer"}),e.jsx(F,{icon:"settings-gear",title:"Settings",dialogDataTestId:"settings-toolbar-dialog",children:e.jsx(I,{location:"trace-viewer"})})]}),e.jsx(k,{model:g,inert:T}),y&&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:y,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"})]})]}),e.jsx(z,{open:R,isModal:!0,className:"progress-dialog",children:e.jsxs("div",{className:"progress-content",children:[e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Loading Playwright Trace..."}),e.jsx("div",{className:"progress-wrapper",children:e.jsx("div",{className:"inner-progress",style:{width:p.total?100*p.done/p.total+"%":0}})})]})}),T&&e.jsxs("div",{className:"drop-target",children:[e.jsx("div",{className:"processing-error",role:"alert",children:j}),e.jsx("div",{className:"title",role:"heading","aria-level":1,children:"Drop Playwright Trace to load"}),e.jsx("div",{children:"or"}),e.jsx("button",{onClick:()=>{const t=document.createElement("input");t.type="file",t.click(),t.addEventListener("change",r=>W(r))},type:"button",children:"Select file"}),e.jsx("div",{className:"info",children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."}),e.jsxs("div",{className:"version",children:["Playwright v","1.57.0-next"]})]}),o&&!c&&e.jsx("div",{className:"drop-target",children:e.jsx("div",{className:"title",children:"Select test to see the trace"})}),b&&e.jsx("div",{className:"drop-target",onDragLeave:()=>{v(!1)},onDrop:t=>U(t),children:e.jsx("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},N=new m("",[]),q=({traceJson:o})=>{const[i,c]=s.useState(void 0),[l,h]=s.useState(0),u=s.useRef(null);return s.useEffect(()=>(u.current&&clearTimeout(u.current),u.current=setTimeout(async()=>{try{const g=await A(o);c(g)}catch{const g=new m("",[]);c(g)}finally{h(l+1)}},500),()=>{u.current&&clearTimeout(u.current)}),[o,l]),e.jsx(k,{isLive:!0,model:i})};async function A(o){const i=new URLSearchParams;i.set("trace",o);const l=await(await fetch(`contexts?${i.toString()}`)).json();return new m(o,l)}(async()=>{const o=new URLSearchParams(window.location.search);if(O(),window.location.protocol!=="file:"){if(o.get("isUnderTest")==="true"&&await new Promise(h=>setTimeout(h,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
|
|
2
2
|
Make sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(h=>{navigator.serviceWorker.oncontrollerchange=()=>h()}),setInterval(function(){fetch("ping")},1e4)}const i=o.get("trace"),l=(i==null?void 0:i.endsWith(".json"))?e.jsx(q,{traceJson:i}):e.jsx($,{});V.createRoot(document.querySelector("#root")).render(l)})();
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<link rel="icon" href="./playwright-logo.svg" type="image/svg+xml">
|
|
8
8
|
<link rel="manifest" href="./manifest.webmanifest">
|
|
9
9
|
<title>Playwright Trace Viewer</title>
|
|
10
|
-
<script type="module" crossorigin src="./index.
|
|
11
|
-
<link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-
|
|
10
|
+
<script type="module" crossorigin src="./index.C5i8AF5O.js"></script>
|
|
11
|
+
<link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-C4fBnzjx.js">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="./defaultSettingsView.BEjzWGz-.css">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="./index.C4Y3Aw8n.css">
|
|
14
14
|
</head>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/xtermModule-CsJ4vdCR.js","./xtermModule.DYP7pi_n.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{u as At,r as K,f as Ut,_ as Wt,g as zt,h as Vt,j as r,R as u,E as Kt,s as xt,i as ht,k as Ht,t as $t,m as qt,l as H,n as O,M as St,b as Yt,o as ot,T as Qt,W as Xt,S as Jt,p as Zt,a as Gt,d as te,e as ee}from"./assets/defaultSettingsView-DJrBVYdp.js";var se={};class dt{constructor(t,e={}){this.isListing=!1,this._tests=new Map,this._rootSuite=new X("","root"),this._options=e,this._reporter=t}reset(){this._rootSuite._entries=[],this._tests.clear()}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==="onAttach"){this._onAttach(s.testId,s.resultId,s.attachments);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()}_onConfigure(t){var e,s;this._rootDir=t.rootDir,this._config=this._parseConfig(t),(s=(e=this._reporter).onConfigure)==null||s.call(e,this._config)}_onProject(t){let e=this._options.mergeProjects?this._rootSuite.suites.find(s=>s.project().name===t.name):void 0;e||(e=new X(t.name,"project"),this._rootSuite._addSuite(e)),e._project=this._parseProject(t);for(const s of t.suites)this._mergeSuiteInto(s,e)}_onBegin(){var t,e;(e=(t=this._reporter).onBegin)==null||e.call(t,this._rootSuite)}_onTestBegin(t,e){var d,n;const s=this._tests.get(t);this._options.clearPreviousResultsWhenTestBegins&&(s.results=[]);const i=s._createTestResult(e.id);i.retry=e.retry,i.workerIndex=e.workerIndex,i.parallelIndex=e.parallelIndex,i.setStartTimeNumber(e.startTime),(n=(d=this._reporter).onTestBegin)==null||n.call(d,s,i)}_onTestEnd(t,e){var d,n,m;const s=this._tests.get(t.testId);s.timeout=t.timeout,s.expectedStatus=t.expectedStatus;const i=s.results.find(c=>c._id===e.id);i.duration=e.duration,i.status=e.status,i.errors=e.errors,i.error=(d=i.errors)==null?void 0:d[0],e.attachments&&(i.attachments=this._parseAttachments(e.attachments)),e.annotations&&(this._absoluteAnnotationLocationsInplace(e.annotations),i.annotations=e.annotations,s.annotations=e.annotations),(m=(n=this._reporter).onTestEnd)==null||m.call(n,s,i),i._stepMap=new Map}_onStepBegin(t,e,s){var f,a;const i=this._tests.get(t),d=i.results.find(w=>w._id===e),n=s.parentStepId?d._stepMap.get(s.parentStepId):void 0,m=this._absoluteLocation(s.location),c=new oe(s,n,m,d);n?n.steps.push(c):d.steps.push(c),d._stepMap.set(s.id,c),(a=(f=this._reporter).onStepBegin)==null||a.call(f,i,d,c)}_onStepEnd(t,e,s){var m,c;const i=this._tests.get(t),d=i.results.find(f=>f._id===e),n=d._stepMap.get(s.id);n._endPayload=s,n.duration=s.duration,n.error=s.error,(c=(m=this._reporter).onStepEnd)==null||c.call(m,i,d,n)}_onAttach(t,e,s){this._tests.get(t).results.find(n=>n._id===e).attachments.push(...s.map(n=>({name:n.name,contentType:n.contentType,path:n.path,body:n.base64&&globalThis.Buffer?Buffer.from(n.base64,"base64"):void 0})))}_onError(t){var e,s;(s=(e=this._reporter).onError)==null||s.call(e,t)}_onStdIO(t,e,s,i,d){var f,a,w,x;const n=d?globalThis.Buffer?Buffer.from(i,"base64"):atob(i):i,m=e?this._tests.get(e):void 0,c=m&&s?m.results.find(l=>l._id===s):void 0;t==="stdout"?(c==null||c.stdout.push(n),(a=(f=this._reporter).onStdOut)==null||a.call(f,n,m,c)):(c==null||c.stderr.push(n),(x=(w=this._reporter).onStdErr)==null||x.call(w,n,m,c))}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(e=(t=this._reporter).onExit)==null?void 0:e.call(t)}_parseConfig(t){const e={...ne,...t};return this._options.configOverrides&&(e.configFile=this._options.configOverrides.configFile,e.reportSlowTests=this._options.configOverrides.reportSlowTests,e.quiet=this._options.configOverrides.quiet,e.reporter=[...this._options.configOverrides.reporter]),e}_parseProject(t){return{metadata:t.metadata,name:t.name,outputDir:this._absolutePath(t.outputDir),repeatEach:t.repeatEach,retries:t.retries,testDir:this._absolutePath(t.testDir),testIgnore:rt(t.testIgnore),testMatch:rt(t.testMatch),timeout:t.timeout,grep:rt(t.grep),grepInvert:rt(t.grepInvert),dependencies:t.dependencies,teardown:t.teardown,snapshotDir:this._absolutePath(t.snapshotDir),use:t.use}}_parseAttachments(t){return t.map(e=>({...e,body:e.base64&&globalThis.Buffer?Buffer.from(e.base64,"base64"):void 0}))}_mergeSuiteInto(t,e){let s=e.suites.find(i=>i.title===t.title);s||(s=new X(t.title,e.type==="project"?"file":"describe"),e._addSuite(s)),s.location=this._absoluteLocation(t.location),t.entries.forEach(i=>{"testId"in i?this._mergeTestInto(i,s):this._mergeSuiteInto(i,s)})}_mergeTestInto(t,e){let s=this._options.mergeTestCases?e.tests.find(i=>i.title===t.title&&i.repeatEachIndex===t.repeatEachIndex):void 0;s||(s=new ie(t.testId,t.title,this._absoluteLocation(t.location),t.repeatEachIndex),e._addTest(s),this._tests.set(s.id,s)),this._updateTest(t,s)}_updateTest(t,e){return e.id=t.testId,e.location=this._absoluteLocation(t.location),e.retries=t.retries,e.tags=t.tags??[],e.annotations=t.annotations??[],this._absoluteAnnotationLocationsInplace(e.annotations),e}_absoluteAnnotationLocationsInplace(t){for(const e of t)e.location&&(e.location=this._absoluteLocation(e.location))}_absoluteLocation(t){return t&&{...t,file:this._absolutePath(t.file)}}_absolutePath(t){if(t!==void 0)return this._options.resolvePath?this._options.resolvePath(this._rootDir,t):this._rootDir+"/"+t}}class X{constructor(t,e){this._entries=[],this._requireFile="",this._parallelMode="none",this.title=t,this._type=e}get type(){return this._type}get suites(){return this._entries.filter(t=>t.type!=="test")}get tests(){return this._entries.filter(t=>t.type==="test")}entries(){return this._entries}allTests(){const t=[],e=s=>{for(const i of s.entries())i.type==="test"?t.push(i):e(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())}_addTest(t){t.parent=this,this._entries.push(t)}_addSuite(t){t.parent=this,this._entries.push(t)}}class ie{constructor(t,e,s,i){this.fn=()=>{},this.results=[],this.type="test",this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.tags=[],this.repeatEachIndex=0,this.id=t,this.title=e,this.location=s,this.repeatEachIndex=i}titlePath(){const t=this.parent?this.parent.titlePath():[];return t.push(this.title),t}outcome(){return ae(this)}ok(){const t=this.outcome();return t==="expected"||t==="flaky"||t==="skipped"}_createTestResult(t){const e=new re(this.results.length,t);return this.results.push(e),e}}class oe{constructor(t,e,s,i){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,this._result=i}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}get attachments(){var t,e;return((e=(t=this._endPayload)==null?void 0:t.attachments)==null?void 0:e.map(s=>this._result.attachments[s]))??[]}get annotations(){var t;return((t=this._endPayload)==null?void 0:t.annotations)??[]}}class re{constructor(t,e){this.parallelIndex=-1,this.workerIndex=-1,this.duration=-1,this.stdout=[],this.stderr=[],this.attachments=[],this.annotations=[],this.status="skipped",this.steps=[],this.errors=[],this._stepMap=new Map,this._startTime=0,this.retry=t,this._id=e}setStartTimeNumber(t){this._startTime=t}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}const ne={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[se.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:3e5},configFile:"",rootDir:"",quiet:!1,shard:null,tags:[],updateSnapshots:"missing",updateSourceMethod:"patch",version:"",workers:0,webServer:null};function rt(o){return o.map(t=>t.s!==void 0?t.s:new RegExp(t.r.source,t.r.flags))}function ae(o){let t=0,e=0,s=0;for(const i of o.results)i.status==="interrupted"||(i.status==="skipped"&&o.expectedStatus==="skipped"?++t:i.status==="skipped"||(i.status===o.expectedStatus?++e:++s));return e===0&&s===0?"skipped":s===0?"expected":e===0&&t===0?"unexpected":"flaky"}class ut{constructor(t,e,s,i,d,n){this._treeItemById=new Map,this._treeItemByTestId=new Map;const m=i&&[...i.values()].some(Boolean);this.pathSeparator=d,this.rootItem={kind:"group",subKind:"folder",id:t,title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},this._treeItemById.set(t,this.rootItem);const c=(f,a,w,x)=>{for(const l of x==="tests"?[]:a.suites){if(!l.title){c(f,l,w,"all");continue}let T=w.children.find(_=>_.kind==="group"&&_.title===l.title);T||(T={kind:"group",subKind:"describe",id:"suite:"+a.titlePath().join("")+""+l.title,title:l.title,location:l.location,duration:0,parent:w,children:[],status:"none",hasLoadErrors:!1},this._addChild(w,T)),c(f,l,T,"all")}for(const l of x==="suites"?[]:a.tests){const T=l.title;let _=w.children.find(N=>N.kind!=="group"&&N.title===T);_||(_={kind:"case",id:"test:"+l.titlePath().join(""),title:T,parent:w,children:[],tests:[],location:l.location,duration:0,status:"none",project:void 0,test:void 0,tags:l.tags},this._addChild(w,_));const b=l.results[0];let R="none";(b==null?void 0:b[J])==="scheduled"?R="scheduled":(b==null?void 0:b[J])==="running"?R="running":(b==null?void 0:b.status)==="skipped"?R="skipped":(b==null?void 0:b.status)==="interrupted"?R="none":b&&l.outcome()!=="expected"?R="failed":b&&l.outcome()==="expected"&&(R="passed"),_.tests.push(l);const k={kind:"test",id:l.id,title:f.name,location:l.location,test:l,parent:_,children:[],status:R,duration:l.results.length?Math.max(0,l.results[0].duration):0,project:f};this._addChild(_,k),this._treeItemByTestId.set(l.id,k),_.duration=_.children.reduce((N,D)=>N+D.duration,0)}};for(const f of(e==null?void 0:e.suites)||[])if(!(m&&!i.get(f.title)))for(const a of f.suites)if(n){if(c(f.project(),a,this.rootItem,"suites"),a.tests.length){const w=this._defaultDescribeItem();c(f.project(),a,w,"tests")}}else{const w=this._fileItem(a.location.file.split(d),!0);c(f.project(),a,w,"all")}for(const f of s){if(!f.location)continue;const a=this._fileItem(f.location.file.split(d),!0);a.hasLoadErrors=!0}}_addChild(t,e){t.children.push(e),e.parent=t,this._treeItemById.set(e.id,e)}filterTree(t,e,s){const i=t.trim().toLowerCase().split(" "),d=[...e.values()].some(Boolean),n=c=>{const f=[...c.tests[0].titlePath(),...c.tests[0].tags].join(" ").toLowerCase();return!i.every(a=>f.includes(a))&&!c.tests.some(a=>s==null?void 0:s.has(a.id))?!1:(c.children=c.children.filter(a=>!d||(s==null?void 0:s.has(a.test.id))||e.get(a.status)),c.tests=c.children.map(a=>a.test),!!c.children.length)},m=c=>{const f=[];for(const a of c.children)a.kind==="case"?n(a)&&f.push(a):(m(a),(a.children.length||a.hasLoadErrors)&&f.push(a));c.children=f};m(this.rootItem)}_fileItem(t,e){if(t.length===0)return this.rootItem;const s=t.join(this.pathSeparator),i=this._treeItemById.get(s);if(i)return i;const d=this._fileItem(t.slice(0,t.length-1),!1),n={kind:"group",subKind:e?"file":"folder",id:s,title:t[t.length-1],location:{file:s,line:0,column:0},duration:0,parent:d,children:[],status:"none",hasLoadErrors:!1};return this._addChild(d,n),n}_defaultDescribeItem(){let t=this._treeItemById.get("<anonymous>");return t||(t={kind:"group",subKind:"describe",id:"<anonymous>",title:"<anonymous>",location:{file:"",line:0,column:0},duration:0,parent:this.rootItem,children:[],status:"none",hasLoadErrors:!1},this._addChild(this.rootItem,t)),t}sortAndPropagateStatus(){Tt(this.rootItem)}flattenForSingleProject(){const t=e=>{e.kind==="case"&&e.children.length===1?(e.project=e.children[0].project,e.test=e.children[0].test,e.children=[],this._treeItemByTestId.set(e.test.id,e)):e.children.forEach(t)};t(this.rootItem)}shortenRoot(){let t=this.rootItem;for(;t.children.length===1&&t.children[0].kind==="group"&&t.children[0].subKind==="folder";)t=t.children[0];t.location=this.rootItem.location,this.rootItem=t}testIds(){const t=new Set,e=s=>{s.kind==="case"&&s.tests.forEach(i=>t.add(i.id)),s.children.forEach(e)};return e(this.rootItem),t}fileNames(){const t=new Set,e=s=>{s.kind==="group"&&s.subKind==="file"?t.add(s.id):s.children.forEach(e)};return e(this.rootItem),[...t]}flatTreeItems(){const t=[],e=s=>{t.push(s),s.children.forEach(e)};return e(this.rootItem),t}treeItemById(t){return this._treeItemById.get(t)}collectTestIds(t){return t?le(t):new Set}}function Tt(o){for(const n of o.children)Tt(n);o.kind==="group"&&o.children.sort((n,m)=>n.location.file.localeCompare(m.location.file)||n.location.line-m.location.line);let t=o.children.length>0,e=o.children.length>0,s=!1,i=!1,d=!1;for(const n of o.children)e=e&&n.status==="skipped",t=t&&(n.status==="passed"||n.status==="skipped"),s=s||n.status==="failed",i=i||n.status==="running",d=d||n.status==="scheduled";i?o.status="running":d?o.status="scheduled":s?o.status="failed":e?o.status="skipped":t&&(o.status="passed")}function le(o){const t=new Set,e=s=>{var i;s.kind==="case"?s.tests.map(d=>d.id).forEach(d=>t.add(d)):s.kind==="test"?t.add(s.id):(i=s.children)==null||i.forEach(e)};return e(o),t}const J=Symbol("statusEx");class ce{constructor(t){this.loadErrors=[],this.progress={total:0,passed:0,failed:0,skipped:0},this._lastRunTestCount=0,this._receiver=new dt(this._createReporter(),{mergeProjects:!0,mergeTestCases:!0,resolvePath:(e,s)=>e+t.pathSeparator+s,clearPreviousResultsWhenTestBegins:!0}),this._options=t}_createReporter(){return{version:()=>"v2",onConfigure:t=>{this.config=t,this._lastRunReceiver=new dt({version:()=>"v2",onBegin:e=>{this._lastRunTestCount=e.allTests().length,this._lastRunReceiver=void 0}},{mergeProjects:!0,mergeTestCases:!1,resolvePath:(e,s)=>e+this._options.pathSeparator+s})},onBegin:t=>{var e;if(this.rootSuite||(this.rootSuite=t),this._testResultsSnapshot){for(const s of this.rootSuite.allTests())s.results=((e=this._testResultsSnapshot)==null?void 0:e.get(s.id))||s.results;this._testResultsSnapshot=void 0}this.progress.total=this._lastRunTestCount,this.progress.passed=0,this.progress.failed=0,this.progress.skipped=0,this._options.onUpdate(!0)},onEnd:()=>{this._options.onUpdate(!0)},onTestBegin:(t,e)=>{e[J]="running",this._options.onUpdate()},onTestEnd:(t,e)=>{t.outcome()==="skipped"?++this.progress.skipped:t.outcome()==="unexpected"?++this.progress.failed:++this.progress.passed,e[J]=e.status,this._options.onUpdate()},onError:t=>this._handleOnError(t),printsToStdio:()=>!1}}processGlobalReport(t){const e=new dt({version:()=>"v2",onConfigure:s=>{this.config=s},onError:s=>this._handleOnError(s)});for(const s of t)e.dispatch(s)}processListReport(t){var s;const e=((s=this.rootSuite)==null?void 0:s.allTests())||[];this._testResultsSnapshot=new Map(e.map(i=>[i.id,i.results])),this._receiver.reset();for(const i of t)this._receiver.dispatch(i)}processTestReportEvent(t){var e,s,i;(s=(e=this._lastRunReceiver)==null?void 0:e.dispatch(t))==null||s.catch(()=>{}),(i=this._receiver.dispatch(t))==null||i.catch(()=>{})}_handleOnError(t){var e,s;this.loadErrors.push(t),(s=(e=this._options).onError)==null||s.call(e,t),this._options.onUpdate()}asModel(){return{rootSuite:this.rootSuite||new X("","root"),config:this.config,loadErrors:this.loadErrors,progress:this.progress}}}const de=({source:o})=>{const[t,e]=At(),[s,i]=K.useState(Ut()),[d]=K.useState(Wt(()=>import("./assets/xtermModule-CsJ4vdCR.js"),__vite__mapDeps([0,1]),import.meta.url).then(m=>m.default)),n=K.useRef(null);return K.useEffect(()=>(zt(i),()=>Vt(i)),[]),K.useEffect(()=>{const m=o.write,c=o.clear;return(async()=>{const{Terminal:f,FitAddon:a}=await d,w=e.current;if(!w)return;const x=s==="dark-mode"?he:ue;if(n.current&&n.current.terminal.options.theme===x)return;n.current&&(w.textContent="");const l=new f({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"monospace",theme:x}),T=new a;l.loadAddon(T);for(const _ of o.pending)l.write(_);o.write=(_=>{o.pending.push(_),l.write(_)}),o.clear=()=>{o.pending=[],l.clear()},l.open(w),T.fit(),n.current={terminal:l,fitAddon:T}})(),()=>{o.clear=c,o.write=m}},[d,n,e,o,s]),K.useEffect(()=>{setTimeout(()=>{n.current&&(n.current.fitAddon.fit(),o.resize(n.current.terminal.cols,n.current.terminal.rows))},250)},[t,o]),r.jsx("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:e})},ue={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"},he={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"},fe=({filterText:o,setFilterText:t,statusFilters:e,setStatusFilters:s,projectFilters:i,setProjectFilters:d,testModel:n,runTests:m})=>{const[c,f]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>{var l;(l=a.current)==null||l.focus()},[]);const w=[...e.entries()].filter(([l,T])=>T).map(([l])=>l).join(" ")||"all",x=[...i.entries()].filter(([l,T])=>T).map(([l])=>l).join(" ")||"all";return r.jsxs("div",{className:"filters",children:[r.jsx(Kt,{expanded:c,setExpanded:f,title:r.jsx("input",{ref:a,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:o,onChange:l=>{t(l.target.value)},onKeyDown:l=>{l.key==="Enter"&&m()}})}),r.jsxs("div",{className:"filter-summary",title:"Status: "+w+`
|
|
2
|
+
import{u as At,r as K,f as Ut,_ as Wt,g as zt,h as Vt,j as r,R as u,E as Kt,s as xt,i as ht,k as Ht,t as $t,m as qt,l as H,n as O,M as St,b as Yt,o as ot,T as Qt,W as Xt,S as Jt,p as Zt,a as Gt,d as te,e as ee}from"./assets/defaultSettingsView-C4fBnzjx.js";var se={};class dt{constructor(t,e={}){this.isListing=!1,this._tests=new Map,this._rootSuite=new X("","root"),this._options=e,this._reporter=t}reset(){this._rootSuite._entries=[],this._tests.clear()}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==="onAttach"){this._onAttach(s.testId,s.resultId,s.attachments);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()}_onConfigure(t){var e,s;this._rootDir=t.rootDir,this._config=this._parseConfig(t),(s=(e=this._reporter).onConfigure)==null||s.call(e,this._config)}_onProject(t){let e=this._options.mergeProjects?this._rootSuite.suites.find(s=>s.project().name===t.name):void 0;e||(e=new X(t.name,"project"),this._rootSuite._addSuite(e)),e._project=this._parseProject(t);for(const s of t.suites)this._mergeSuiteInto(s,e)}_onBegin(){var t,e;(e=(t=this._reporter).onBegin)==null||e.call(t,this._rootSuite)}_onTestBegin(t,e){var d,n;const s=this._tests.get(t);this._options.clearPreviousResultsWhenTestBegins&&(s.results=[]);const i=s._createTestResult(e.id);i.retry=e.retry,i.workerIndex=e.workerIndex,i.parallelIndex=e.parallelIndex,i.setStartTimeNumber(e.startTime),(n=(d=this._reporter).onTestBegin)==null||n.call(d,s,i)}_onTestEnd(t,e){var d,n,m;const s=this._tests.get(t.testId);s.timeout=t.timeout,s.expectedStatus=t.expectedStatus;const i=s.results.find(c=>c._id===e.id);i.duration=e.duration,i.status=e.status,i.errors=e.errors,i.error=(d=i.errors)==null?void 0:d[0],e.attachments&&(i.attachments=this._parseAttachments(e.attachments)),e.annotations&&(this._absoluteAnnotationLocationsInplace(e.annotations),i.annotations=e.annotations,s.annotations=e.annotations),(m=(n=this._reporter).onTestEnd)==null||m.call(n,s,i),i._stepMap=new Map}_onStepBegin(t,e,s){var f,a;const i=this._tests.get(t),d=i.results.find(w=>w._id===e),n=s.parentStepId?d._stepMap.get(s.parentStepId):void 0,m=this._absoluteLocation(s.location),c=new oe(s,n,m,d);n?n.steps.push(c):d.steps.push(c),d._stepMap.set(s.id,c),(a=(f=this._reporter).onStepBegin)==null||a.call(f,i,d,c)}_onStepEnd(t,e,s){var m,c;const i=this._tests.get(t),d=i.results.find(f=>f._id===e),n=d._stepMap.get(s.id);n._endPayload=s,n.duration=s.duration,n.error=s.error,(c=(m=this._reporter).onStepEnd)==null||c.call(m,i,d,n)}_onAttach(t,e,s){this._tests.get(t).results.find(n=>n._id===e).attachments.push(...s.map(n=>({name:n.name,contentType:n.contentType,path:n.path,body:n.base64&&globalThis.Buffer?Buffer.from(n.base64,"base64"):void 0})))}_onError(t){var e,s;(s=(e=this._reporter).onError)==null||s.call(e,t)}_onStdIO(t,e,s,i,d){var f,a,w,x;const n=d?globalThis.Buffer?Buffer.from(i,"base64"):atob(i):i,m=e?this._tests.get(e):void 0,c=m&&s?m.results.find(l=>l._id===s):void 0;t==="stdout"?(c==null||c.stdout.push(n),(a=(f=this._reporter).onStdOut)==null||a.call(f,n,m,c)):(c==null||c.stderr.push(n),(x=(w=this._reporter).onStdErr)==null||x.call(w,n,m,c))}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(e=(t=this._reporter).onExit)==null?void 0:e.call(t)}_parseConfig(t){const e={...ne,...t};return this._options.configOverrides&&(e.configFile=this._options.configOverrides.configFile,e.reportSlowTests=this._options.configOverrides.reportSlowTests,e.quiet=this._options.configOverrides.quiet,e.reporter=[...this._options.configOverrides.reporter]),e}_parseProject(t){return{metadata:t.metadata,name:t.name,outputDir:this._absolutePath(t.outputDir),repeatEach:t.repeatEach,retries:t.retries,testDir:this._absolutePath(t.testDir),testIgnore:rt(t.testIgnore),testMatch:rt(t.testMatch),timeout:t.timeout,grep:rt(t.grep),grepInvert:rt(t.grepInvert),dependencies:t.dependencies,teardown:t.teardown,snapshotDir:this._absolutePath(t.snapshotDir),use:t.use}}_parseAttachments(t){return t.map(e=>({...e,body:e.base64&&globalThis.Buffer?Buffer.from(e.base64,"base64"):void 0}))}_mergeSuiteInto(t,e){let s=e.suites.find(i=>i.title===t.title);s||(s=new X(t.title,e.type==="project"?"file":"describe"),e._addSuite(s)),s.location=this._absoluteLocation(t.location),t.entries.forEach(i=>{"testId"in i?this._mergeTestInto(i,s):this._mergeSuiteInto(i,s)})}_mergeTestInto(t,e){let s=this._options.mergeTestCases?e.tests.find(i=>i.title===t.title&&i.repeatEachIndex===t.repeatEachIndex):void 0;s||(s=new ie(t.testId,t.title,this._absoluteLocation(t.location),t.repeatEachIndex),e._addTest(s),this._tests.set(s.id,s)),this._updateTest(t,s)}_updateTest(t,e){return e.id=t.testId,e.location=this._absoluteLocation(t.location),e.retries=t.retries,e.tags=t.tags??[],e.annotations=t.annotations??[],this._absoluteAnnotationLocationsInplace(e.annotations),e}_absoluteAnnotationLocationsInplace(t){for(const e of t)e.location&&(e.location=this._absoluteLocation(e.location))}_absoluteLocation(t){return t&&{...t,file:this._absolutePath(t.file)}}_absolutePath(t){if(t!==void 0)return this._options.resolvePath?this._options.resolvePath(this._rootDir,t):this._rootDir+"/"+t}}class X{constructor(t,e){this._entries=[],this._requireFile="",this._parallelMode="none",this.title=t,this._type=e}get type(){return this._type}get suites(){return this._entries.filter(t=>t.type!=="test")}get tests(){return this._entries.filter(t=>t.type==="test")}entries(){return this._entries}allTests(){const t=[],e=s=>{for(const i of s.entries())i.type==="test"?t.push(i):e(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())}_addTest(t){t.parent=this,this._entries.push(t)}_addSuite(t){t.parent=this,this._entries.push(t)}}class ie{constructor(t,e,s,i){this.fn=()=>{},this.results=[],this.type="test",this.expectedStatus="passed",this.timeout=0,this.annotations=[],this.retries=0,this.tags=[],this.repeatEachIndex=0,this.id=t,this.title=e,this.location=s,this.repeatEachIndex=i}titlePath(){const t=this.parent?this.parent.titlePath():[];return t.push(this.title),t}outcome(){return ae(this)}ok(){const t=this.outcome();return t==="expected"||t==="flaky"||t==="skipped"}_createTestResult(t){const e=new re(this.results.length,t);return this.results.push(e),e}}class oe{constructor(t,e,s,i){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,this._result=i}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}get attachments(){var t,e;return((e=(t=this._endPayload)==null?void 0:t.attachments)==null?void 0:e.map(s=>this._result.attachments[s]))??[]}get annotations(){var t;return((t=this._endPayload)==null?void 0:t.annotations)??[]}}class re{constructor(t,e){this.parallelIndex=-1,this.workerIndex=-1,this.duration=-1,this.stdout=[],this.stderr=[],this.attachments=[],this.annotations=[],this.status="skipped",this.steps=[],this.errors=[],this._stepMap=new Map,this._startTime=0,this.retry=t,this._id=e}setStartTimeNumber(t){this._startTime=t}get startTime(){return new Date(this._startTime)}set startTime(t){this._startTime=+t}}const ne={forbidOnly:!1,fullyParallel:!1,globalSetup:null,globalTeardown:null,globalTimeout:0,grep:/.*/,grepInvert:null,maxFailures:0,metadata:{},preserveOutput:"always",projects:[],reporter:[[se.CI?"dot":"list"]],reportSlowTests:{max:5,threshold:3e5},configFile:"",rootDir:"",quiet:!1,shard:null,tags:[],updateSnapshots:"missing",updateSourceMethod:"patch",version:"",workers:0,webServer:null};function rt(o){return o.map(t=>t.s!==void 0?t.s:new RegExp(t.r.source,t.r.flags))}function ae(o){let t=0,e=0,s=0;for(const i of o.results)i.status==="interrupted"||(i.status==="skipped"&&o.expectedStatus==="skipped"?++t:i.status==="skipped"||(i.status===o.expectedStatus?++e:++s));return e===0&&s===0?"skipped":s===0?"expected":e===0&&t===0?"unexpected":"flaky"}class ut{constructor(t,e,s,i,d,n){this._treeItemById=new Map,this._treeItemByTestId=new Map;const m=i&&[...i.values()].some(Boolean);this.pathSeparator=d,this.rootItem={kind:"group",subKind:"folder",id:t,title:"",location:{file:"",line:0,column:0},duration:0,parent:void 0,children:[],status:"none",hasLoadErrors:!1},this._treeItemById.set(t,this.rootItem);const c=(f,a,w,x)=>{for(const l of x==="tests"?[]:a.suites){if(!l.title){c(f,l,w,"all");continue}let T=w.children.find(_=>_.kind==="group"&&_.title===l.title);T||(T={kind:"group",subKind:"describe",id:"suite:"+a.titlePath().join("")+""+l.title,title:l.title,location:l.location,duration:0,parent:w,children:[],status:"none",hasLoadErrors:!1},this._addChild(w,T)),c(f,l,T,"all")}for(const l of x==="suites"?[]:a.tests){const T=l.title;let _=w.children.find(N=>N.kind!=="group"&&N.title===T);_||(_={kind:"case",id:"test:"+l.titlePath().join(""),title:T,parent:w,children:[],tests:[],location:l.location,duration:0,status:"none",project:void 0,test:void 0,tags:l.tags},this._addChild(w,_));const b=l.results[0];let R="none";(b==null?void 0:b[J])==="scheduled"?R="scheduled":(b==null?void 0:b[J])==="running"?R="running":(b==null?void 0:b.status)==="skipped"?R="skipped":(b==null?void 0:b.status)==="interrupted"?R="none":b&&l.outcome()!=="expected"?R="failed":b&&l.outcome()==="expected"&&(R="passed"),_.tests.push(l);const k={kind:"test",id:l.id,title:f.name,location:l.location,test:l,parent:_,children:[],status:R,duration:l.results.length?Math.max(0,l.results[0].duration):0,project:f};this._addChild(_,k),this._treeItemByTestId.set(l.id,k),_.duration=_.children.reduce((N,D)=>N+D.duration,0)}};for(const f of(e==null?void 0:e.suites)||[])if(!(m&&!i.get(f.title)))for(const a of f.suites)if(n){if(c(f.project(),a,this.rootItem,"suites"),a.tests.length){const w=this._defaultDescribeItem();c(f.project(),a,w,"tests")}}else{const w=this._fileItem(a.location.file.split(d),!0);c(f.project(),a,w,"all")}for(const f of s){if(!f.location)continue;const a=this._fileItem(f.location.file.split(d),!0);a.hasLoadErrors=!0}}_addChild(t,e){t.children.push(e),e.parent=t,this._treeItemById.set(e.id,e)}filterTree(t,e,s){const i=t.trim().toLowerCase().split(" "),d=[...e.values()].some(Boolean),n=c=>{const f=[...c.tests[0].titlePath(),...c.tests[0].tags].join(" ").toLowerCase();return!i.every(a=>f.includes(a))&&!c.tests.some(a=>s==null?void 0:s.has(a.id))?!1:(c.children=c.children.filter(a=>!d||(s==null?void 0:s.has(a.test.id))||e.get(a.status)),c.tests=c.children.map(a=>a.test),!!c.children.length)},m=c=>{const f=[];for(const a of c.children)a.kind==="case"?n(a)&&f.push(a):(m(a),(a.children.length||a.hasLoadErrors)&&f.push(a));c.children=f};m(this.rootItem)}_fileItem(t,e){if(t.length===0)return this.rootItem;const s=t.join(this.pathSeparator),i=this._treeItemById.get(s);if(i)return i;const d=this._fileItem(t.slice(0,t.length-1),!1),n={kind:"group",subKind:e?"file":"folder",id:s,title:t[t.length-1],location:{file:s,line:0,column:0},duration:0,parent:d,children:[],status:"none",hasLoadErrors:!1};return this._addChild(d,n),n}_defaultDescribeItem(){let t=this._treeItemById.get("<anonymous>");return t||(t={kind:"group",subKind:"describe",id:"<anonymous>",title:"<anonymous>",location:{file:"",line:0,column:0},duration:0,parent:this.rootItem,children:[],status:"none",hasLoadErrors:!1},this._addChild(this.rootItem,t)),t}sortAndPropagateStatus(){Tt(this.rootItem)}flattenForSingleProject(){const t=e=>{e.kind==="case"&&e.children.length===1?(e.project=e.children[0].project,e.test=e.children[0].test,e.children=[],this._treeItemByTestId.set(e.test.id,e)):e.children.forEach(t)};t(this.rootItem)}shortenRoot(){let t=this.rootItem;for(;t.children.length===1&&t.children[0].kind==="group"&&t.children[0].subKind==="folder";)t=t.children[0];t.location=this.rootItem.location,this.rootItem=t}testIds(){const t=new Set,e=s=>{s.kind==="case"&&s.tests.forEach(i=>t.add(i.id)),s.children.forEach(e)};return e(this.rootItem),t}fileNames(){const t=new Set,e=s=>{s.kind==="group"&&s.subKind==="file"?t.add(s.id):s.children.forEach(e)};return e(this.rootItem),[...t]}flatTreeItems(){const t=[],e=s=>{t.push(s),s.children.forEach(e)};return e(this.rootItem),t}treeItemById(t){return this._treeItemById.get(t)}collectTestIds(t){return t?le(t):new Set}}function Tt(o){for(const n of o.children)Tt(n);o.kind==="group"&&o.children.sort((n,m)=>n.location.file.localeCompare(m.location.file)||n.location.line-m.location.line);let t=o.children.length>0,e=o.children.length>0,s=!1,i=!1,d=!1;for(const n of o.children)e=e&&n.status==="skipped",t=t&&(n.status==="passed"||n.status==="skipped"),s=s||n.status==="failed",i=i||n.status==="running",d=d||n.status==="scheduled";i?o.status="running":d?o.status="scheduled":s?o.status="failed":e?o.status="skipped":t&&(o.status="passed")}function le(o){const t=new Set,e=s=>{var i;s.kind==="case"?s.tests.map(d=>d.id).forEach(d=>t.add(d)):s.kind==="test"?t.add(s.id):(i=s.children)==null||i.forEach(e)};return e(o),t}const J=Symbol("statusEx");class ce{constructor(t){this.loadErrors=[],this.progress={total:0,passed:0,failed:0,skipped:0},this._lastRunTestCount=0,this._receiver=new dt(this._createReporter(),{mergeProjects:!0,mergeTestCases:!0,resolvePath:(e,s)=>e+t.pathSeparator+s,clearPreviousResultsWhenTestBegins:!0}),this._options=t}_createReporter(){return{version:()=>"v2",onConfigure:t=>{this.config=t,this._lastRunReceiver=new dt({version:()=>"v2",onBegin:e=>{this._lastRunTestCount=e.allTests().length,this._lastRunReceiver=void 0}},{mergeProjects:!0,mergeTestCases:!1,resolvePath:(e,s)=>e+this._options.pathSeparator+s})},onBegin:t=>{var e;if(this.rootSuite||(this.rootSuite=t),this._testResultsSnapshot){for(const s of this.rootSuite.allTests())s.results=((e=this._testResultsSnapshot)==null?void 0:e.get(s.id))||s.results;this._testResultsSnapshot=void 0}this.progress.total=this._lastRunTestCount,this.progress.passed=0,this.progress.failed=0,this.progress.skipped=0,this._options.onUpdate(!0)},onEnd:()=>{this._options.onUpdate(!0)},onTestBegin:(t,e)=>{e[J]="running",this._options.onUpdate()},onTestEnd:(t,e)=>{t.outcome()==="skipped"?++this.progress.skipped:t.outcome()==="unexpected"?++this.progress.failed:++this.progress.passed,e[J]=e.status,this._options.onUpdate()},onError:t=>this._handleOnError(t),printsToStdio:()=>!1}}processGlobalReport(t){const e=new dt({version:()=>"v2",onConfigure:s=>{this.config=s},onError:s=>this._handleOnError(s)});for(const s of t)e.dispatch(s)}processListReport(t){var s;const e=((s=this.rootSuite)==null?void 0:s.allTests())||[];this._testResultsSnapshot=new Map(e.map(i=>[i.id,i.results])),this._receiver.reset();for(const i of t)this._receiver.dispatch(i)}processTestReportEvent(t){var e,s,i;(s=(e=this._lastRunReceiver)==null?void 0:e.dispatch(t))==null||s.catch(()=>{}),(i=this._receiver.dispatch(t))==null||i.catch(()=>{})}_handleOnError(t){var e,s;this.loadErrors.push(t),(s=(e=this._options).onError)==null||s.call(e,t),this._options.onUpdate()}asModel(){return{rootSuite:this.rootSuite||new X("","root"),config:this.config,loadErrors:this.loadErrors,progress:this.progress}}}const de=({source:o})=>{const[t,e]=At(),[s,i]=K.useState(Ut()),[d]=K.useState(Wt(()=>import("./assets/xtermModule-CsJ4vdCR.js"),__vite__mapDeps([0,1]),import.meta.url).then(m=>m.default)),n=K.useRef(null);return K.useEffect(()=>(zt(i),()=>Vt(i)),[]),K.useEffect(()=>{const m=o.write,c=o.clear;return(async()=>{const{Terminal:f,FitAddon:a}=await d,w=e.current;if(!w)return;const x=s==="dark-mode"?he:ue;if(n.current&&n.current.terminal.options.theme===x)return;n.current&&(w.textContent="");const l=new f({convertEol:!0,fontSize:13,scrollback:1e4,fontFamily:"monospace",theme:x}),T=new a;l.loadAddon(T);for(const _ of o.pending)l.write(_);o.write=(_=>{o.pending.push(_),l.write(_)}),o.clear=()=>{o.pending=[],l.clear()},l.open(w),T.fit(),n.current={terminal:l,fitAddon:T}})(),()=>{o.clear=c,o.write=m}},[d,n,e,o,s]),K.useEffect(()=>{setTimeout(()=>{n.current&&(n.current.fitAddon.fit(),o.resize(n.current.terminal.cols,n.current.terminal.rows))},250)},[t,o]),r.jsx("div",{"data-testid":"output",className:"xterm-wrapper",style:{flex:"auto"},ref:e})},ue={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"},he={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"},fe=({filterText:o,setFilterText:t,statusFilters:e,setStatusFilters:s,projectFilters:i,setProjectFilters:d,testModel:n,runTests:m})=>{const[c,f]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>{var l;(l=a.current)==null||l.focus()},[]);const w=[...e.entries()].filter(([l,T])=>T).map(([l])=>l).join(" ")||"all",x=[...i.entries()].filter(([l,T])=>T).map(([l])=>l).join(" ")||"all";return r.jsxs("div",{className:"filters",children:[r.jsx(Kt,{expanded:c,setExpanded:f,title:r.jsx("input",{ref:a,type:"search",placeholder:"Filter (e.g. text, @tag)",spellCheck:!1,value:o,onChange:l=>{t(l.target.value)},onKeyDown:l=>{l.key==="Enter"&&m()}})}),r.jsxs("div",{className:"filter-summary",title:"Status: "+w+`
|
|
3
3
|
Projects: `+x,onClick:()=>f(!c),children:[r.jsx("span",{className:"filter-label",children:"Status:"})," ",w,r.jsx("span",{className:"filter-label",children:"Projects:"})," ",x]}),c&&r.jsxs("div",{className:"hbox",style:{marginLeft:14,maxHeight:200,overflowY:"auto"},children:[r.jsx("div",{className:"filter-list",role:"list","data-testid":"status-filters",children:[...e.entries()].map(([l,T])=>r.jsx("div",{className:"filter-entry",role:"listitem",children:r.jsxs("label",{children:[r.jsx("input",{type:"checkbox",checked:T,onChange:()=>{const _=new Map(e);_.set(l,!_.get(l)),s(_)}}),r.jsx("div",{children:l})]})},l))}),r.jsx("div",{className:"filter-list",role:"list","data-testid":"project-filters",children:[...i.entries()].map(([l,T])=>r.jsx("div",{className:"filter-entry",role:"listitem",children:r.jsxs("label",{children:[r.jsx("input",{type:"checkbox",checked:T,onChange:()=>{var R;const _=new Map(i);_.set(l,!_.get(l)),d(_);const b=(R=n==null?void 0:n.config)==null?void 0:R.configFile;b&&xt.setObject(b+":projects",[..._.entries()].filter(([k,N])=>N).map(([k])=>k))}}),r.jsx("div",{children:l||"untitled"})]})},l))})]})]})},pe=({tag:o,style:t,onClick:e})=>r.jsx("span",{className:ht("tag",`tag-color-${ge(o)}`),onClick:e,style:{margin:"6px 0 0 6px",...t},title:`Click to filter by tag: ${o}`,children:o});function ge(o){let t=0;for(let e=0;e<o.length;e++)t=o.charCodeAt(e)+((t<<8)-t);return Math.abs(t%6)}const me=Ht,_e=({filterText:o,testModel:t,testServerConnection:e,testTree:s,runTests:i,runningState:d,watchAll:n,watchedTreeIds:m,setWatchedTreeIds:c,isLoading:f,onItemSelected:a,requestedCollapseAllCount:w,requestedExpandAllCount:x,setFilterText:l,onRevealSource:T})=>{const[_,b]=u.useState({expandedItems:new Map}),[R,k]=u.useState(),[N,D]=u.useState(w),[$,L]=u.useState(x);u.useEffect(()=>{if(N!==w){_.expandedItems.clear();for(const S of s.flatTreeItems())_.expandedItems.set(S.id,!1);D(w),k(void 0),b({..._});return}if($!==x){_.expandedItems.clear();for(const S of s.flatTreeItems())_.expandedItems.set(S.id,!0);L(x),k(void 0),b({..._});return}if(!d||d.itemSelectedByUser)return;let h;const E=S=>{var M;S.children.forEach(E),!h&&S.status==="failed"&&(S.kind==="test"&&d.testIds.has(S.test.id)||S.kind==="case"&&d.testIds.has((M=S.tests[0])==null?void 0:M.id))&&(h=S)};E(s.rootItem),h&&k(h.id)},[d,k,s,N,D,w,$,L,x,_,b]);const C=u.useMemo(()=>{if(R)return s.treeItemById(R)},[R,s]);u.useEffect(()=>{if(!t)return;const h=ve(C,t);let E;(C==null?void 0:C.kind)==="test"?E=C.test:(C==null?void 0:C.kind)==="case"&&C.tests.length===1&&(E=C.tests[0]),a({treeItem:C,testCase:E,testFile:h})},[t,C,a]),u.useEffect(()=>{if(!f)if(n)e==null||e.watchNoReply({fileNames:s.fileNames()});else{const h=new Set;for(const E of m.value){const S=s.treeItemById(E),M=S==null?void 0:S.location.file;M&&h.add(M)}e==null||e.watchNoReply({fileNames:[...h]})}},[f,s,n,m,e]);const Z=h=>{k(h.id),i("bounce-if-busy",s.collectTestIds(h))},q=(h,E)=>{if(h.preventDefault(),h.stopPropagation(),h.metaKey||h.ctrlKey){const S=o.split(" ");S.includes(E)?l(S.filter(M=>M!==E).join(" ").trim()):l((o+" "+E).trim())}else l((o.split(" ").filter(S=>!S.startsWith("@")).join(" ")+" "+E).trim())};return r.jsx(me,{name:"tests",treeState:_,setTreeState:b,rootItem:s.rootItem,dataTestId:"test-tree",render:h=>{const E=h.id.replace(/[^\w\d-_]/g,"-"),S=E+"-label",M=E+"-time";return r.jsxs("div",{className:"hbox ui-mode-tree-item","aria-labelledby":`${S} ${M}`,children:[r.jsxs("div",{id:S,className:"ui-mode-tree-item-title",children:[r.jsx("span",{children:h.title}),h.kind==="case"?h.tags.map(Y=>r.jsx(pe,{tag:Y.slice(1),onClick:G=>q(G,Y)},Y)):null]}),!!h.duration&&h.status!=="skipped"&&r.jsx("div",{id:M,className:"ui-mode-tree-item-time",children:qt(h.duration)}),r.jsxs(H,{noMinHeight:!0,noShadow:!0,children:[r.jsx(O,{icon:"play",title:"Run",onClick:()=>Z(h),disabled:!!d&&!d.completed}),r.jsx(O,{icon:"go-to-file",title:"Show source",onClick:T,style:h.kind==="group"&&h.subKind==="folder"?{visibility:"hidden"}:{}}),!n&&r.jsx(O,{icon:"eye",title:"Watch",onClick:()=>{m.value.has(h.id)?m.value.delete(h.id):m.value.add(h.id),c({...m})},toggled:m.value.has(h.id)})]})]})},icon:h=>$t(h.status),title:h=>h.title,selectedItem:C,onAccepted:Z,onSelected:h=>{d&&(d.itemSelectedByUser=!0),k(h.id)},isError:h=>h.kind==="group"?h.hasLoadErrors:!1,autoExpandDepth:o?5:1,noItemsMessage:f?"Loading…":"No tests"})};function ve(o,t){if(!(!o||!t))return{file:o.location.file,line:o.location.line,column:o.location.column,source:{errors:t.loadErrors.filter(e=>{var s;return((s=e.location)==null?void 0:s.file)===o.location.file}).map(e=>({line:e.location.line,message:e.message})),content:void 0}}}function we(o){return`.playwright-artifacts-${o}`}const be=({item:o,rootDir:t,onOpenExternally:e,revealSource:s,pathSeparator:i})=>{var w,x;const[d,n]=u.useState(void 0),[m,c]=u.useState(0),f=u.useRef(null),{outputDir:a}=u.useMemo(()=>({outputDir:o.testCase?xe(o.testCase):void 0}),[o]);return u.useEffect(()=>{var b,R;f.current&&clearTimeout(f.current);const l=(b=o.testCase)==null?void 0:b.results[0];if(!l){n(void 0);return}const T=l&&l.duration>=0&&l.attachments.find(k=>k.name==="trace");if(T&&T.path){vt(T.path).then(k=>n({model:k,isLive:!1}));return}if(!a){n(void 0);return}const _=[a,we(l.workerIndex),"traces",`${(R=o.testCase)==null?void 0:R.id}.json`].join(i);return f.current=setTimeout(async()=>{try{const k=await vt(_);n({model:k,isLive:!0})}catch{const k=new St("",[]);k.errorDescriptors.push(...l.errors.flatMap(N=>N.message?[{message:N.message}]:[])),n({model:k,isLive:!1})}finally{c(m+1)}},500),()=>{f.current&&clearTimeout(f.current)}},[a,o,n,m,c,i]),r.jsx(Yt,{model:d==null?void 0:d.model,showSourcesFirst:!0,rootDir:t,fallbackLocation:o.testFile,isLive:d==null?void 0:d.isLive,status:(w=o.treeItem)==null?void 0:w.status,annotations:((x=o.testCase)==null?void 0:x.annotations)??[],onOpenExternally:e,revealSource:s},"workbench")},xe=o=>{var t;for(let e=o.parent;e;e=e.parent)if(e.project())return(t=e.project())==null?void 0:t.outputDir};async function vt(o){const t=new URLSearchParams;t.set("trace",o);const s=await(await fetch(`contexts?${t.toString()}`)).json();return new St(o,s)}let wt={cols:80};const z={pending:[],clear:()=>{},write:o=>z.pending.push(o),resize:()=>{}},A=new URLSearchParams(window.location.search),Se=new URL(A.get("server")??"../",window.location.href),ft=new URL(A.get("ws"),Se);ft.protocol=ft.protocol==="https:"?"wss:":"ws:";const B={args:A.getAll("arg"),grep:A.get("grep")||void 0,grepInvert:A.get("grepInvert")||void 0,projects:A.getAll("project"),workers:A.get("workers")||void 0,headed:A.has("headed"),updateSnapshots:A.get("updateSnapshots")||void 0,reporters:A.has("reporter")?A.getAll("reporter"):void 0,pathSeparator:A.get("pathSeparator")||"/"};B.updateSnapshots&&!["all","changed","none","missing"].includes(B.updateSnapshots)&&(B.updateSnapshots=void 0);const bt=navigator.platform==="MacIntel",Te=({})=>{var _t;const[o,t]=u.useState(""),[e,s]=u.useState(!1),[i,d]=u.useState(!1),[n,m]=u.useState(new Map([["passed",!1],["failed",!1],["skipped",!1]])),[c,f]=u.useState(new Map),[a,w]=u.useState(),[x,l]=u.useState(),[T,_]=u.useState({}),[b,R]=u.useState(new Set),[k,N]=u.useState(!1),[D,$]=u.useState(),L=D&&!D.completed,[C,Z]=ot("watch-all",!1),[q,h]=u.useState({value:new Set}),E=u.useRef(Promise.resolve()),S=u.useRef(new Set),[M,Y]=u.useState(0),[G,kt]=u.useState(0),[jt,yt]=u.useState(!1),[pt,gt]=u.useState(!0),[v,Et]=u.useState(),[tt,It]=u.useState(),[et,Rt]=u.useState(!1),[st,Bt]=u.useState(!1),[Ct,mt]=u.useState(!1),Nt=u.useCallback(()=>mt(!0),[mt]),[nt,Pt]=ot("single-worker",!1),[at,Lt]=ot("updateSnapshots","missing"),[Q]=ot("mergeFiles",!1),Dt=u.useRef(null),it=u.useCallback(()=>{Et(p=>(p==null||p.close(),new Qt(new Xt(ft))))},[]);u.useEffect(()=>{var p;(p=Dt.current)==null||p.focus(),N(!0),it()},[it]),u.useEffect(()=>{if(!v)return;const p=[v.onStdio(g=>{if(g.buffer){const j=atob(g.buffer);z.write(j)}else z.write(g.text);g.type==="stderr"&&d(!0)}),v.onClose(()=>yt(!0))];return z.resize=(g,j)=>{wt={cols:g,rows:j},v.resizeTerminalNoReply({cols:g,rows:j})},()=>{for(const g of p)g.dispose()}},[v]),u.useEffect(()=>{if(!v)return;let p;const g=new ce({onUpdate:j=>{clearTimeout(p),p=void 0,j?w(g.asModel()):p||(p=setTimeout(()=>{w(g.asModel())},250))},onError:j=>{z.write((j.stack||j.value||"")+`
|
|
4
4
|
`),d(!0)},pathSeparator:B.pathSeparator});return It(g),w(void 0),N(!0),h({value:new Set}),(async()=>{try{await v.initialize({interceptStdio:!0,watchTestDirs:!0});const{status:j,report:I}=await v.runGlobalSetup({});if(g.processGlobalReport(I),j!=="passed")return;const P=await v.listTests({projects:B.projects,locations:B.args,grep:B.grep,grepInvert:B.grepInvert});g.processListReport(P.report),v.onReport(F=>{g.processTestReportEvent(F)});const{hasBrowsers:U}=await v.checkBrowsers({});gt(U)}finally{N(!1)}})(),()=>{clearTimeout(p)}},[v]),u.useEffect(()=>{if(!a)return;const{config:p,rootSuite:g}=a,j=p.configFile?xt.getObject(p.configFile+":projects",void 0):void 0,I=new Map(c);for(const P of I.keys())g.suites.find(U=>U.title===P)||I.delete(P);for(const P of g.suites)I.has(P.title)||I.set(P.title,!!(j!=null&&j.includes(P.title)));!j&&I.size&&![...I.values()].includes(!0)&&I.set(I.entries().next().value[0],!0),(c.size!==I.size||[...c].some(([P,U])=>I.get(P)!==U))&&f(I)},[c,a]),u.useEffect(()=>{L&&(a!=null&&a.progress)?l(a.progress):a||l(void 0)},[a,L]);const{testTree:Mt}=u.useMemo(()=>{if(!a)return{testTree:new ut("",new X("","root"),[],c,B.pathSeparator,Q)};const p=new ut("",a.rootSuite,a.loadErrors,c,B.pathSeparator,Q);return p.filterTree(o,n,L?D==null?void 0:D.testIds:void 0),p.sortAndPropagateStatus(),p.shortenRoot(),p.flattenForSingleProject(),R(p.testIds()),{testTree:p}},[o,a,n,c,R,D,L,Q]),V=u.useCallback((p,g)=>{!v||!a||p==="bounce-if-busy"&&L||(S.current=new Set([...S.current,...g]),E.current=E.current.then(async()=>{var P,U,F;const j=S.current;if(S.current=new Set,!j.size)return;{for(const y of((P=a.rootSuite)==null?void 0:P.allTests())||[])if(j.has(y.id)){y.results=[];const W=y._createTestResult("pending");W[J]="scheduled"}w({...a})}const I=" ["+new Date().toLocaleTimeString()+"]";z.write("\x1B[2m—".repeat(Math.max(0,wt.cols-I.length))+I+"\x1B[22m"),l({total:0,passed:0,failed:0,skipped:0}),$({testIds:j}),await v.runTests({locations:B.args,grep:B.grep,grepInvert:B.grepInvert,testIds:[...j],projects:[...c].filter(([y,W])=>W).map(([y])=>y),updateSnapshots:at,reporters:B.reporters,workers:nt?1:void 0,trace:"on"});for(const y of((U=a.rootSuite)==null?void 0:U.allTests())||[])((F=y.results[0])==null?void 0:F.duration)===-1&&(y.results=[]);w({...a}),$(y=>y?{...y,completed:!0}:void 0)}))},[c,L,a,v,at,nt]);u.useEffect(()=>{if(!v||!tt)return;const p=v.onTestFilesChanged(async g=>{if(E.current=E.current.then(async()=>{N(!0);try{const F=await v.listTests({projects:B.projects,locations:B.args,grep:B.grep,grepInvert:B.grepInvert});tt.processListReport(F.report)}catch(F){console.log(F)}finally{N(!1)}}),await E.current,g.testFiles.length===0)return;const j=tt.asModel(),I=new ut("",j.rootSuite,j.loadErrors,c,B.pathSeparator,Q),P=[],U=new Set(g.testFiles);if(C){const F=y=>{const W=y.location.file;W&&U.has(W)&&P.push(...I.collectTestIds(y)),y.kind==="group"&&y.subKind==="folder"&&y.children.forEach(F)};F(I.rootItem)}else for(const F of q.value){const y=I.treeItemById(F),W=y==null?void 0:y.location.file;W&&U.has(W)&&P.push(...I.collectTestIds(y))}V("queue-if-busy",new Set(P))});return()=>p.dispose()},[V,v,C,q,tt,c,Q]),u.useEffect(()=>{if(!v)return;const p=g=>{g.code==="Backquote"&&g.ctrlKey?(g.preventDefault(),s(!e)):g.code==="F5"&&g.shiftKey?(g.preventDefault(),v==null||v.stopTestsNoReply({})):g.code==="F5"&&(g.preventDefault(),V("bounce-if-busy",b))};return addEventListener("keydown",p),()=>{removeEventListener("keydown",p)}},[V,it,v,b,e]);const lt=u.useRef(null),Ft=u.useCallback(p=>{var g;p.preventDefault(),p.stopPropagation(),(g=lt.current)==null||g.showModal()},[]),ct=u.useCallback(p=>{var g;p.preventDefault(),p.stopPropagation(),(g=lt.current)==null||g.close()},[]),Ot=u.useCallback(p=>{ct(p),s(!0),v==null||v.installBrowsers({}).then(async()=>{s(!1);const{hasBrowsers:g}=await(v==null?void 0:v.checkBrowsers({}));gt(g)})},[ct,v]);return r.jsxs("div",{className:"vbox ui-mode",children:[!pt&&r.jsxs("dialog",{ref:lt,children:[r.jsxs("div",{className:"title",children:[r.jsx("span",{className:"codicon codicon-lightbulb"}),"Install browsers"]}),r.jsxs("div",{className:"body",children:["Playwright did not find installed browsers.",r.jsx("br",{}),"Would you like to run `playwright install`?",r.jsx("br",{}),r.jsx("button",{className:"button",onClick:Ot,children:"Install"}),r.jsx("button",{className:"button secondary",onClick:ct,children:"Dismiss"})]})]}),jt&&r.jsxs("div",{className:"disconnected",children:[r.jsx("div",{className:"title",children:"UI Mode disconnected"}),r.jsxs("div",{children:[r.jsx("a",{href:"#",onClick:()=>window.location.href="/",children:"Reload the page"})," to reconnect"]})]}),r.jsx(Jt,{sidebarSize:250,minSidebarSize:150,orientation:"horizontal",sidebarIsFirst:!0,settingName:"testListSidebar",main:r.jsxs("div",{className:"vbox",children:[r.jsxs("div",{className:ht("vbox",!e&&"hidden"),children:[r.jsxs(H,{children:[r.jsx("div",{className:"section-title",style:{flex:"none"},children:"Output"}),r.jsx(O,{icon:"circle-slash",title:"Clear output",onClick:()=>{z.clear(),d(!1)}}),r.jsx("div",{className:"spacer"}),r.jsx(O,{icon:"close",title:"Close",onClick:()=>s(!1)})]}),r.jsx(de,{source:z})]}),r.jsx("div",{className:ht("vbox",e&&"hidden"),children:r.jsx(be,{pathSeparator:B.pathSeparator,item:T,rootDir:(_t=a==null?void 0:a.config)==null?void 0:_t.rootDir,revealSource:Ct,onOpenExternally:p=>v==null?void 0:v.openNoReply({location:{file:p.file,line:p.line,column:p.column}})})})]}),sidebar:r.jsxs("div",{className:"vbox ui-mode-sidebar",children:[r.jsxs(H,{noShadow:!0,noMinHeight:!0,children:[r.jsx("img",{src:"playwright-logo.svg",alt:"Playwright logo"}),r.jsx("div",{className:"section-title",children:"Playwright"}),r.jsx(O,{icon:"refresh",title:"Reload",onClick:()=>it(),disabled:L||k}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(O,{icon:"terminal",title:"Toggle output — "+(bt?"⌃`":"Ctrl + `"),toggled:e,onClick:()=>{s(!e)}}),i&&r.jsx("div",{title:"Output contains error",style:{position:"absolute",top:2,right:2,width:7,height:7,borderRadius:"50%",backgroundColor:"var(--vscode-notificationsErrorIcon-foreground)"}})]}),!pt&&r.jsx(O,{icon:"lightbulb-autofix",style:{color:"var(--vscode-list-warningForeground)"},title:"Playwright browsers are missing",onClick:Ft})]}),r.jsx(fe,{filterText:o,setFilterText:t,statusFilters:n,setStatusFilters:m,projectFilters:c,setProjectFilters:f,testModel:a,runTests:()=>V("bounce-if-busy",b)}),r.jsxs(H,{className:"section-toolbar",noMinHeight:!0,children:[!L&&!x&&r.jsx("div",{className:"section-title",children:"Tests"}),!L&&x&&r.jsx("div",{"data-testid":"status-line",className:"status-line",children:r.jsxs("div",{children:[x.passed,"/",x.total," passed (",x.passed/x.total*100|0,"%)"]})}),L&&x&&r.jsx("div",{"data-testid":"status-line",className:"status-line",children:r.jsxs("div",{children:["Running ",x.passed,"/",D.testIds.size," passed (",x.passed/D.testIds.size*100|0,"%)"]})}),r.jsx(O,{icon:"play",title:"Run all — F5",onClick:()=>V("bounce-if-busy",b),disabled:L||k}),r.jsx(O,{icon:"debug-stop",title:"Stop — "+(bt?"⇧F5":"Shift + F5"),onClick:()=>v==null?void 0:v.stopTests({}),disabled:!L||k}),r.jsx(O,{icon:"eye",title:"Watch all",toggled:C,onClick:()=>{h({value:new Set}),Z(!C)}}),r.jsx(O,{icon:"collapse-all",title:"Collapse all",onClick:()=>{Y(M+1)}}),r.jsx(O,{icon:"expand-all",title:"Expand all",onClick:()=>{kt(G+1)}})]}),r.jsx(_e,{filterText:o,testModel:a,testTree:Mt,testServerConnection:v,runningState:D,runTests:V,onItemSelected:_,watchAll:C,watchedTreeIds:q,setWatchedTreeIds:h,isLoading:k,requestedCollapseAllCount:M,requestedExpandAllCount:G,setFilterText:t,onRevealSource:Nt}),r.jsxs(H,{noShadow:!0,noMinHeight:!0,className:"settings-toolbar",onClick:()=>Bt(!st),children:[r.jsx("span",{className:`codicon codicon-${st?"chevron-down":"chevron-right"}`,style:{marginLeft:5},title:st?"Hide Testing Options":"Show Testing Options"}),r.jsx("div",{className:"section-title",children:"Testing Options"})]}),st&&r.jsx(Zt,{settings:[{type:"check",value:nt,set:Pt,name:"Single worker"},{type:"select",options:[{label:"All",value:"all"},{label:"Changed",value:"changed"},{label:"Missing",value:"missing"},{label:"None",value:"none"}],value:at,set:Lt,name:"Update snapshots"}]}),r.jsxs(H,{noShadow:!0,noMinHeight:!0,className:"settings-toolbar",onClick:()=>Rt(!et),children:[r.jsx("span",{className:`codicon codicon-${et?"chevron-down":"chevron-right"}`,style:{marginLeft:5},title:et?"Hide Settings":"Show Settings"}),r.jsx("div",{className:"section-title",children:"Settings"})]}),et&&r.jsx(Gt,{location:"ui-mode"})]})})]})};(async()=>{if(te(),window.location.protocol!=="file:"){if(window.location.href.includes("isUnderTest=true")&&await new Promise(o=>setTimeout(o,1e3)),!navigator.serviceWorker)throw new Error(`Service workers are not supported.
|
|
5
5
|
Make sure to serve the website (${window.location}) via HTTPS or localhost.`);navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(o=>{navigator.serviceWorker.oncontrollerchange=()=>o()}),setInterval(function(){fetch("ping")},1e4)}ee.createRoot(document.querySelector("#root")).render(r.jsx(Te,{}))})();
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<link rel="icon" href="./playwright-logo.svg" type="image/svg+xml">
|
|
8
8
|
<title>Playwright Test</title>
|
|
9
|
-
<script type="module" crossorigin src="./uiMode.
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-
|
|
9
|
+
<script type="module" crossorigin src="./uiMode.4_zRp-hG.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/defaultSettingsView-C4fBnzjx.js">
|
|
11
11
|
<link rel="stylesheet" crossorigin href="./defaultSettingsView.BEjzWGz-.css">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="./uiMode.Btcz36p_.css">
|
|
13
13
|
</head>
|
package/package.json
CHANGED
package/types/protocol.d.ts
CHANGED
|
@@ -1920,7 +1920,7 @@ is guaranteed to exist.
|
|
|
1920
1920
|
}
|
|
1921
1921
|
|
|
1922
1922
|
/**
|
|
1923
|
-
* Set permission settings for given
|
|
1923
|
+
* Set permission settings for given embedding and embedded origins.
|
|
1924
1924
|
*/
|
|
1925
1925
|
export type setPermissionParameters = {
|
|
1926
1926
|
/**
|
|
@@ -1932,15 +1932,15 @@ is guaranteed to exist.
|
|
|
1932
1932
|
*/
|
|
1933
1933
|
setting: PermissionSetting;
|
|
1934
1934
|
/**
|
|
1935
|
-
*
|
|
1935
|
+
* Embedding origin the permission applies to, all origins if not specified.
|
|
1936
1936
|
*/
|
|
1937
1937
|
origin?: string;
|
|
1938
1938
|
/**
|
|
1939
|
-
*
|
|
1940
|
-
present and valid. If the
|
|
1941
|
-
|
|
1939
|
+
* Embedded origin the permission applies to. It is ignored unless the embedding origin is
|
|
1940
|
+
present and valid. If the embedding origin is provided but the embedded origin isn't, the
|
|
1941
|
+
embedding origin is used as the embedded origin.
|
|
1942
1942
|
*/
|
|
1943
|
-
|
|
1943
|
+
embeddedOrigin?: string;
|
|
1944
1944
|
/**
|
|
1945
1945
|
* Context to override. When omitted, default browser context is used.
|
|
1946
1946
|
*/
|
|
@@ -1949,7 +1949,8 @@ requesting origin is used as the embedding origin.
|
|
|
1949
1949
|
export type setPermissionReturnValue = {
|
|
1950
1950
|
}
|
|
1951
1951
|
/**
|
|
1952
|
-
* Grant specific permissions to the given origin and reject all others.
|
|
1952
|
+
* Grant specific permissions to the given origin and reject all others. Deprecated. Use
|
|
1953
|
+
setPermission instead.
|
|
1953
1954
|
*/
|
|
1954
1955
|
export type grantPermissionsParameters = {
|
|
1955
1956
|
permissions: PermissionType[];
|
|
@@ -9126,6 +9127,10 @@ for the preferred input type).
|
|
|
9126
9127
|
* Fired when debugging target has reloaded after crash
|
|
9127
9128
|
*/
|
|
9128
9129
|
export type targetReloadedAfterCrashPayload = void;
|
|
9130
|
+
/**
|
|
9131
|
+
* Fired on worker targets when main worker script and any imported scripts have been evaluated.
|
|
9132
|
+
*/
|
|
9133
|
+
export type workerScriptLoadedPayload = void;
|
|
9129
9134
|
|
|
9130
9135
|
/**
|
|
9131
9136
|
* Disables inspector domain notifications.
|
|
@@ -10465,7 +10470,7 @@ If the opcode isn't 1, then payloadData is a base64 encoded string representing
|
|
|
10465
10470
|
/**
|
|
10466
10471
|
* Type of this initiator.
|
|
10467
10472
|
*/
|
|
10468
|
-
type: "parser"|"script"|"preload"|"SignedExchange"|"preflight"|"other";
|
|
10473
|
+
type: "parser"|"script"|"preload"|"SignedExchange"|"preflight"|"FedCM"|"other";
|
|
10469
10474
|
/**
|
|
10470
10475
|
* Initiator JavaScript stack trace, set for Script only.
|
|
10471
10476
|
Requires the Debugger domain to be enabled.
|
|
@@ -10899,8 +10904,8 @@ extra headers.
|
|
|
10899
10904
|
export interface NetworkConditions {
|
|
10900
10905
|
/**
|
|
10901
10906
|
* Only matching requests will be affected by these conditions. Patterns use the URLPattern constructor string
|
|
10902
|
-
syntax (https://urlpattern.spec.whatwg.org/). If the pattern is empty, all requests are
|
|
10903
|
-
connections).
|
|
10907
|
+
syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. If the pattern is empty, all requests are
|
|
10908
|
+
matched (including p2p connections).
|
|
10904
10909
|
*/
|
|
10905
10910
|
urlPattern: string;
|
|
10906
10911
|
/**
|
|
@@ -10932,6 +10937,18 @@ connections).
|
|
|
10932
10937
|
*/
|
|
10933
10938
|
packetReordering?: boolean;
|
|
10934
10939
|
}
|
|
10940
|
+
export interface BlockPattern {
|
|
10941
|
+
/**
|
|
10942
|
+
* URL pattern to match. Patterns use the URLPattern constructor string syntax
|
|
10943
|
+
(https://urlpattern.spec.whatwg.org/) and must be absolute. Example: `<example>`.
|
|
10944
|
+
*/
|
|
10945
|
+
urlPattern: string;
|
|
10946
|
+
/**
|
|
10947
|
+
* Whether or not to block the pattern. If false, a matching request will not be blocked even if it matches a later
|
|
10948
|
+
`BlockPattern`.
|
|
10949
|
+
*/
|
|
10950
|
+
block: boolean;
|
|
10951
|
+
}
|
|
10935
10952
|
export type DirectSocketDnsQueryType = "ipv4"|"ipv6";
|
|
10936
10953
|
export interface DirectTCPSocketOptions {
|
|
10937
10954
|
/**
|
|
@@ -11817,76 +11834,6 @@ preemptively (e.g. a cache hit).
|
|
|
11817
11834
|
* Fired once security policy has been updated.
|
|
11818
11835
|
*/
|
|
11819
11836
|
export type policyUpdatedPayload = void;
|
|
11820
|
-
/**
|
|
11821
|
-
* Fired once when parsing the .wbn file has succeeded.
|
|
11822
|
-
The event contains the information about the web bundle contents.
|
|
11823
|
-
*/
|
|
11824
|
-
export type subresourceWebBundleMetadataReceivedPayload = {
|
|
11825
|
-
/**
|
|
11826
|
-
* Request identifier. Used to match this information to another event.
|
|
11827
|
-
*/
|
|
11828
|
-
requestId: RequestId;
|
|
11829
|
-
/**
|
|
11830
|
-
* A list of URLs of resources in the subresource Web Bundle.
|
|
11831
|
-
*/
|
|
11832
|
-
urls: string[];
|
|
11833
|
-
}
|
|
11834
|
-
/**
|
|
11835
|
-
* Fired once when parsing the .wbn file has failed.
|
|
11836
|
-
*/
|
|
11837
|
-
export type subresourceWebBundleMetadataErrorPayload = {
|
|
11838
|
-
/**
|
|
11839
|
-
* Request identifier. Used to match this information to another event.
|
|
11840
|
-
*/
|
|
11841
|
-
requestId: RequestId;
|
|
11842
|
-
/**
|
|
11843
|
-
* Error message
|
|
11844
|
-
*/
|
|
11845
|
-
errorMessage: string;
|
|
11846
|
-
}
|
|
11847
|
-
/**
|
|
11848
|
-
* Fired when handling requests for resources within a .wbn file.
|
|
11849
|
-
Note: this will only be fired for resources that are requested by the webpage.
|
|
11850
|
-
*/
|
|
11851
|
-
export type subresourceWebBundleInnerResponseParsedPayload = {
|
|
11852
|
-
/**
|
|
11853
|
-
* Request identifier of the subresource request
|
|
11854
|
-
*/
|
|
11855
|
-
innerRequestId: RequestId;
|
|
11856
|
-
/**
|
|
11857
|
-
* URL of the subresource resource.
|
|
11858
|
-
*/
|
|
11859
|
-
innerRequestURL: string;
|
|
11860
|
-
/**
|
|
11861
|
-
* Bundle request identifier. Used to match this information to another event.
|
|
11862
|
-
This made be absent in case when the instrumentation was enabled only
|
|
11863
|
-
after webbundle was parsed.
|
|
11864
|
-
*/
|
|
11865
|
-
bundleRequestId?: RequestId;
|
|
11866
|
-
}
|
|
11867
|
-
/**
|
|
11868
|
-
* Fired when request for resources within a .wbn file failed.
|
|
11869
|
-
*/
|
|
11870
|
-
export type subresourceWebBundleInnerResponseErrorPayload = {
|
|
11871
|
-
/**
|
|
11872
|
-
* Request identifier of the subresource request
|
|
11873
|
-
*/
|
|
11874
|
-
innerRequestId: RequestId;
|
|
11875
|
-
/**
|
|
11876
|
-
* URL of the subresource resource.
|
|
11877
|
-
*/
|
|
11878
|
-
innerRequestURL: string;
|
|
11879
|
-
/**
|
|
11880
|
-
* Error message
|
|
11881
|
-
*/
|
|
11882
|
-
errorMessage: string;
|
|
11883
|
-
/**
|
|
11884
|
-
* Bundle request identifier. Used to match this information to another event.
|
|
11885
|
-
This made be absent in case when the instrumentation was enabled only
|
|
11886
|
-
after webbundle was parsed.
|
|
11887
|
-
*/
|
|
11888
|
-
bundleRequestId?: RequestId;
|
|
11889
|
-
}
|
|
11890
11837
|
/**
|
|
11891
11838
|
* Is sent whenever a new report is added.
|
|
11892
11839
|
And after 'enableReportingApi' for all existing reports.
|
|
@@ -12116,7 +12063,9 @@ and overrideNetworkState commands, which can be used together to the same effect
|
|
|
12116
12063
|
export type emulateNetworkConditionsReturnValue = {
|
|
12117
12064
|
}
|
|
12118
12065
|
/**
|
|
12119
|
-
* Activates emulation of network conditions for individual requests using URL match patterns.
|
|
12066
|
+
* Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated
|
|
12067
|
+
Network.emulateNetworkConditions this method does not affect `navigator` state. Use Network.overrideNetworkState to
|
|
12068
|
+
explicitly modify `navigator` behavior.
|
|
12120
12069
|
*/
|
|
12121
12070
|
export type emulateNetworkConditionsByRuleParameters = {
|
|
12122
12071
|
/**
|
|
@@ -12345,10 +12294,15 @@ attribute, user, password.
|
|
|
12345
12294
|
* Blocks URLs from loading.
|
|
12346
12295
|
*/
|
|
12347
12296
|
export type setBlockedURLsParameters = {
|
|
12297
|
+
/**
|
|
12298
|
+
* Patterns to match in the order in which they are given. These patterns
|
|
12299
|
+
also take precedence over any wildcard patterns defined in `urls`.
|
|
12300
|
+
*/
|
|
12301
|
+
urlPatterns?: BlockPattern[];
|
|
12348
12302
|
/**
|
|
12349
12303
|
* URL patterns to block. Wildcards ('*') are allowed.
|
|
12350
12304
|
*/
|
|
12351
|
-
urls
|
|
12305
|
+
urls?: string[];
|
|
12352
12306
|
}
|
|
12353
12307
|
export type setBlockedURLsReturnValue = {
|
|
12354
12308
|
}
|
|
@@ -15924,7 +15878,7 @@ https://github.com/WICG/nav-speculation/blob/main/speculation-rules-tags.md
|
|
|
15924
15878
|
mojom::SpeculationAction (although PrefetchWithSubresources is omitted as it
|
|
15925
15879
|
isn't being used by clients).
|
|
15926
15880
|
*/
|
|
15927
|
-
export type SpeculationAction = "Prefetch"|"Prerender";
|
|
15881
|
+
export type SpeculationAction = "Prefetch"|"Prerender"|"PrerenderUntilScript";
|
|
15928
15882
|
/**
|
|
15929
15883
|
* Corresponds to mojom::SpeculationTargetHint.
|
|
15930
15884
|
See https://github.com/WICG/nav-speculation/blob/main/triggers.md#window-name-targeting-hints
|
|
@@ -21835,6 +21789,7 @@ Error was thrown.
|
|
|
21835
21789
|
"Inspector.detached": Inspector.detachedPayload;
|
|
21836
21790
|
"Inspector.targetCrashed": Inspector.targetCrashedPayload;
|
|
21837
21791
|
"Inspector.targetReloadedAfterCrash": Inspector.targetReloadedAfterCrashPayload;
|
|
21792
|
+
"Inspector.workerScriptLoaded": Inspector.workerScriptLoadedPayload;
|
|
21838
21793
|
"LayerTree.layerPainted": LayerTree.layerPaintedPayload;
|
|
21839
21794
|
"LayerTree.layerTreeDidChange": LayerTree.layerTreeDidChangePayload;
|
|
21840
21795
|
"Log.entryAdded": Log.entryAddedPayload;
|
|
@@ -21880,10 +21835,6 @@ Error was thrown.
|
|
|
21880
21835
|
"Network.responseReceivedEarlyHints": Network.responseReceivedEarlyHintsPayload;
|
|
21881
21836
|
"Network.trustTokenOperationDone": Network.trustTokenOperationDonePayload;
|
|
21882
21837
|
"Network.policyUpdated": Network.policyUpdatedPayload;
|
|
21883
|
-
"Network.subresourceWebBundleMetadataReceived": Network.subresourceWebBundleMetadataReceivedPayload;
|
|
21884
|
-
"Network.subresourceWebBundleMetadataError": Network.subresourceWebBundleMetadataErrorPayload;
|
|
21885
|
-
"Network.subresourceWebBundleInnerResponseParsed": Network.subresourceWebBundleInnerResponseParsedPayload;
|
|
21886
|
-
"Network.subresourceWebBundleInnerResponseError": Network.subresourceWebBundleInnerResponseErrorPayload;
|
|
21887
21838
|
"Network.reportingApiReportAdded": Network.reportingApiReportAddedPayload;
|
|
21888
21839
|
"Network.reportingApiReportUpdated": Network.reportingApiReportUpdatedPayload;
|
|
21889
21840
|
"Network.reportingApiEndpointsChangedForOrigin": Network.reportingApiEndpointsChangedForOriginPayload;
|