supplier_central_frontend/playwright-report/trace/uiMode.Dzuouizj.js

5 lines
37 KiB
JavaScript
Raw Normal View History

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/xtermModule-BuZfJS5v.js","./assets/defaultSettingsView-B-dXF5JN.js","./assets/urlMatch-L3liM589.js","./defaultSettingsView.BLFoOugd.css","./xtermModule.kHJ-D0s7.css"])))=>i.map(i=>d[i]);
import{C as e,D as t,E as n,S as r,T as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,i as p,k as m,l as h,m as g,n as _,p as v,r as y,t as b,u as x,v as S,w as C,x as w,y as T}from"./assets/defaultSettingsView-B-dXF5JN.js";import"./assets/urlMatch-L3liM589.js";var E=m(t()),D=m(S(),1),O=class{constructor(e,t={}){this.isListing=!1,this._tests=new Map,this._rootSuite=new k(``,`root`),this._options=t,this._reporter=e}reset(){this._rootSuite._entries=[],this._tests.clear()}dispatch(e){let{method:t,params:n}=e;if(t===`onConfigure`){this._onConfigure(n.config);return}if(t===`onProject`){this._onProject(n.project);return}if(t===`onBegin`){this._onBegin();return}if(t===`onTestBegin`){this._onTestBegin(n.testId,n.result);return}if(t===`onTestPaused`){this._onTestPaused(n.testId,n.resultId,n.errors);return}if(t===`onTestEnd`){this._onTestEnd(n.test,n.result);return}if(t===`onStepBegin`){this._onStepBegin(n.testId,n.resultId,n.step);return}if(t===`onAttach`){this._onAttach(n.testId,n.resultId,n.attachments);return}if(t===`onStepEnd`){this._onStepEnd(n.testId,n.resultId,n.step);return}if(t===`onError`){this._onError(n.error,n.workerInfo);return}if(t===`onStdIO`){this._onStdIO(n.type,n.testId,n.resultId,n.data,n.isBase64);return}if(t===`onEnd`)return this._onEnd(n.result);if(t===`onExit`)return this._onExit()}_onConfigure(e){this._rootDir=e.rootDir,this._config=this._parseConfig(e),this._reporter.onConfigure?.(this._config)}_onProject(e){let t=this._options.mergeProjects?this._rootSuite.suites.find(t=>t.project().name===e.name):void 0;t||(t=new k(e.name,`project`),this._rootSuite._addSuite(t));let n=this._parseProject(e);t._project=n;let r=-1;this._options.mergeProjects&&(r=this._config.projects.findIndex(t=>t.name===e.name)),r===-1?this._config.projects.push(n):this._config.projects[r]=n;for(let n of e.suites)this._mergeSuiteInto(n,t)}_onBegin(){this._reporter.onBegin?.(this._rootSuite)}_onTestBegin(e,t){let n=this._tests.get(e);this._options.clearPreviousResultsWhenTestBegins&&(n.results=[]);let r=n._createTestResult(t.id);r.retry=t.retry,r.workerIndex=t.workerIndex,r.parallelIndex=t.parallelIndex,r.setStartTimeNumber(t.startTime),this._reporter.onTestBegin?.(n,r)}_onTestPaused(e,t,n){let r=this._tests.get(e),i=r.results.find(e=>e._id===t);i.errors.push(...n),i.error=i.errors[0],this._reporter.onTestPaused?.(r,i)}_onTestEnd(e,t){let n=this._tests.get(e.testId);n.timeout=e.timeout,n.expectedStatus=e.expectedStatus;let r=n.results.find(e=>e._id===t.id);r.duration=t.duration,r.status=t.status,r.errors.push(...t.errors??[]),r.error=r.errors[0],t.attachments&&(r.attachments=this._parseAttachments(t.attachments)),t.annotations&&(this._absoluteAnnotationLocationsInplace(t.annotations),r.annotations=t.annotations,n.annotations=t.annotations),this._reporter.onTestEnd?.(n,r),r._stepMap=new Map}_onStepBegin(e,t,n){let r=this._tests.get(e),i=r.results.find(e=>e._id===t),a=n.parentStepId?i._stepMap.get(n.parentStepId):void 0,o=new ee(n,a,this._absoluteLocation(n.location),i);a?a.steps.push(o):i.steps.push(o),i._stepMap.set(n.id,o),this._reporter.onStepBegin?.(r,i,o)}_onStepEnd(e,t,n){let r=this._tests.get(e),i=r.results.find(e=>e._id===t),a=i._stepMap.get(n.id);a._endPayload=n,a.duration=n.duration,a.error=n.error,this._reporter.onStepEnd?.(r,i,a)}_onAttach(e,t,n){this._tests.get(e).results.find(e=>e._id===t).attachments.push(...n.map(e=>({name:e.name,contentType:e.contentType,path:e.path,body:e.base64&&globalThis.Buffer?Buffer.from(e.base64,`base64`):void 0})))}_onError(e,t){let n;if(t){let e=this._config.projects.find(e=>e.name===t.projectName);e&&(n={workerIndex:t.workerIndex,parallelIndex:t.parallelIndex,config:this._config,project:e})}this._reporter.onError?.(e,n)}_onStdIO(e,t,n,r,i){let a=i?globalThis.Buffer?Buffer.from(r,`base64`):atob(r):r,o=t?this._tests.get(t):void 0,s=o&&n?o.results.find(e=>e._id===n):void 0;e===`stdout`?(s?.stdout.push(a),this._reporter.onStdOut?.(a,o,s)):(s?.stderr.push(a),this._reporter.onStdErr?.(a,o,s))}async _onEnd(e){await this._reporter.onEnd?.(F(e))}_onExit(){return this._reporter.onExit?.()}_parseCo
Projects: `+m+(o?`
Only changed`:``),onClick:()=>d(!u),children:[(0,B.jsx)(`span`,{className:`filter-label`,children:`Status:`}),` `,p,(0,B.jsx)(`span`,{className:`filter-label`,children:`Projects:`}),` `,m,o&&(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(`span`,{className:`filter-label`,children:`Only changed`})})]}),u&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`hbox`,style:{marginLeft:14,maxHeight:200,overflowY:`auto`},children:[(0,B.jsx)(`div`,{className:`filter-list`,role:`list`,"data-testid":`status-filters`,children:[...n.entries()].map(([e,t])=>(0,B.jsx)(`div`,{className:`filter-entry`,role:`listitem`,children:(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:t,onChange:()=>{let t=new Map(n);t.set(e,!t.get(e)),r(t)}}),(0,B.jsx)(`div`,{children:e})]})},e))}),(0,B.jsx)(`div`,{className:`filter-list`,role:`list`,"data-testid":`project-filters`,children:[...i.entries()].map(([e,t])=>(0,B.jsx)(`div`,{className:`filter-entry`,role:`listitem`,children:(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:t,onChange:()=>{let t=new Map(i);t.set(e,!t.get(e)),a(t);let n=c?.config?.configFile;n&&C.setObject(n+`:projects`,[...t.entries()].filter(([e,t])=>t).map(([e])=>e))}}),(0,B.jsx)(`div`,{children:e||`untitled`})]})},e))})]}),(0,B.jsx)(`div`,{className:`filter-entry`,style:{marginLeft:24},children:(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:o,onChange:()=>s(!o)}),(0,B.jsx)(`div`,{children:`Show only changed files`})]})})]})]})},ce=({tag:t,style:n,onClick:r})=>(0,B.jsx)(`span`,{className:e(`tag`,`tag-color-${le(t)}`),onClick:r,style:{margin:`6px 0 0 6px`,...n},title:`Click to filter by tag: ${t}`,children:t});function le(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<8)-t);return Math.abs(t%6)}var ue=v,de=({filterText:e,testModel:t,testServerConnection:n,testTree:r,runTests:i,runningState:a,watchAll:o,watchedTreeIds:s,setWatchedTreeIds:d,isLoading:f,onItemSelected:p,requestedCollapseAllCount:m,requestedExpandAllCount:h,setFilterText:_,onRevealSource:v})=>{let[y,b]=E.useState({expandedItems:new Map}),[x,S]=E.useState(),[C,w]=E.useState(m),[T,D]=E.useState(h);E.useEffect(()=>{if(C!==m){y.expandedItems.clear();for(let e of r.flatTreeItems())y.expandedItems.set(e.id,!1);w(m),S(void 0),b({...y});return}if(T!==h){y.expandedItems.clear();for(let e of r.flatTreeItems())y.expandedItems.set(e.id,!0);D(h),S(void 0),b({...y});return}if(!a||a.itemSelectedByUser)return;let e,t=n=>{n.children.forEach(t),!e&&n.status===`failed`&&(n.kind===`test`&&a.testIds.has(n.test.id)||n.kind===`case`&&a.testIds.has(n.tests[0]?.id))&&(e=n)};t(r.rootItem),e&&S(e.id)},[a,S,r,C,w,m,T,D,h,y,b]);let O=E.useMemo(()=>{if(x)return r.treeItemById(x)},[x,r]);E.useEffect(()=>{if(!t)return;let e=fe(O,t),n;O?.kind===`test`?n=O.test:O?.kind===`case`&&O.tests.length===1&&(n=O.tests[0]),p({treeItem:O,testCase:n,testFile:e})},[t,O,p]),E.useEffect(()=>{if(!f)if(o)n?.watchNoReply({fileNames:r.fileNames()});else{let e=new Set;for(let t of s.value){let n=r.treeItemById(t)?.location.file;n&&e.add(n)}n?.watchNoReply({fileNames:[...e]})}},[f,r,o,s,n]);let k=e=>{S(e.id),i(`bounce-if-busy`,r.collectTestIds(e))},A=(t,n)=>{if(t.preventDefault(),t.stopPropagation(),t.metaKey||t.ctrlKey){let t=e.split(` `);t.includes(n)?_(t.filter(e=>e!==n).join(` `).trim()):_((e+` `+n).trim())}else _((e.split(` `).filter(e=>!e.startsWith(`@`)).join(` `)+` `+n).trim())};return(0,B.jsx)(ue,{name:`tests`,treeState:y,setTreeState:b,rootItem:r.rootItem,dataTestId:`test-tree`,render:e=>{let t=e.id.replace(/[^\w\d-_]/g,`-`),n=t+`-label`,r=t+`-time`;return(0,B.jsxs)(`div`,{className:`hbox ui-mode-tree-item`,"aria-labelledby":`${n} ${r}`,children:[(0,B.jsxs)(`div`,{id:n,className:`ui-mode-tree-item-title`,children:[(0,B.jsx)(`span`,{children:e.title}),e.kind===`case`?e.tags.map(e=>(0,B.jsx)(ce,{tag:e.slice(1),onClick:t=>A(t,e)},e)):null]}),!!e.duration&&e.status!==`skipped`&&(0,B.jsx)(`div`,{id:r,className:`ui-mode-tree-item-time`,children:g(e.duration)}),(0,B.jsxs)(c,{noMinHeight:!0,noShadow:!0,children:[(0,B.jsx)(u,{icon:`play
`),l(!0)},pathSeparator:K.pathSeparator});return W(t),v(void 0),O(!0),F({value:new Set}),(async()=>{try{await V.initialize({interceptStdio:!0,watchTestDirs:!0});let{status:e,report:n}=await V.runGlobalSetup({});if(t.processGlobalReport(n),e!==`passed`)return;let r=await V.listTests({projects:K.projects,locations:K.args,grep:K.grep,grepInvert:K.grepInvert,onlyChanged:J});t.processListReport(r.report),V.onReport(e=>{t.processTestReportEvent(e)});let{hasBrowsers:i}=await V.checkBrowsers({});fe(i)}finally{O(!1)}})(),()=>{clearTimeout(e)}},[J,V]),E.useEffect(()=>{if(!g)return;let{config:e,rootSuite:t}=g,n=e.configFile?C.getObject(e.configFile+`:projects`,void 0):void 0,r=new Map(m);for(let e of r.keys())t.suites.find(t=>t.title===e)||r.delete(e);for(let e of t.suites)r.has(e.title)||r.set(e.title,!!n?.includes(e.title));!n&&r.size&&![...r.values()].includes(!0)&&r.set(r.entries().next().value[0],!0),(m.size!==r.size||[...m].some(([e,t])=>r.get(e)!==t))&&h(r)},[m,g]),E.useEffect(()=>{j&&g?.progress?S(g.progress):g||S(void 0)},[g,j]);let{testTree:Z}=E.useMemo(()=>{if(!g)return{testTree:new L(``,new k(``,`root`),[],m,K.pathSeparator,Y)};let e=new L(``,g.rootSuite,g.loadErrors,m,K.pathSeparator,Y);return e.filterTree(t,d,j?A?.testIds:void 0),e.sortAndPropagateStatus(),e.shortenRoot(),e.flattenForSingleProject(),{testTree:e}},[t,g,d,m,A,j,Y]),Q=E.useCallback((e,t)=>{if(!(!V||!g)&&!(e===`bounce-if-busy`&&j)){for(let e of t.testIds)R.current.testIds.add(e);for(let e of t.locations)R.current.locations.add(e);I.current=I.current.then(async()=>{let{testIds:e,locations:t}=R.current;if(R.current={testIds:new Set,locations:new Set},!e.size)return;for(let t of g.rootSuite?.allTests()||[])if(e.has(t.id)){t.results=[];let e=t._createTestResult(`pending`);e[z]=`scheduled`}v({...g});let n=` [`+new Date().toLocaleTimeString()+`]`;U.write(`\x1B[2m`.repeat(Math.max(0,he.cols-n.length))+n+`\x1B[22m`),S({total:0,passed:0,failed:0,skipped:0}),ee({testIds:e}),await V.runTests({locations:[...t].map(ve),grep:K.grep,grepInvert:K.grepInvert,testIds:[...e],projects:[...m].filter(([e,t])=>t).map(([e])=>e),updateSnapshots:De,reporters:K.reporters,workers:Te?1:void 0,maxFailures:Ae?1:void 0,trace:`on`});for(let e of g.rootSuite?.allTests()||[])e.results[0]?.duration===-1&&(e.results=[]);v({...g}),ee(e=>e?{...e,completed:!0}:void 0)})}},[m,j,g,V,De,Te,Ae]),$=E.useCallback(()=>Q(`bounce-if-busy`,Z.collectTestIds(Z.rootItem)),[Q,Z]);E.useEffect(()=>{if(!V||!H)return;let e=V.onTestFilesChanged(async e=>{if(I.current=I.current.then(async()=>{O(!0);try{let e=await V.listTests({projects:K.projects,locations:K.args,grep:K.grep,grepInvert:K.grepInvert,onlyChanged:J});H.processListReport(e.report)}catch(e){console.log(e)}finally{O(!1)}}),await I.current,e.testFiles.length===0)return;let t=H.asModel(),n=new L(``,t.rootSuite,t.loadErrors,m,K.pathSeparator,Y),r=[],i=[],a=new Set(e.testFiles);if(M){let e=t=>{let o=t.location.file;if(o&&a.has(o)){let e=n.collectTestIds(t);r.push(...e.locations),i.push(...e.testIds)}t.kind===`group`&&t.subKind===`folder`&&t.children.forEach(e)};e(n.rootItem)}else for(let e of P.value){let t=n.treeItemById(e);if(!t)continue;let o=t;for(;!(o.kind===`group`&&(o.subKind===`file`||o.subKind===`folder`))&&o.parent;)o=o.parent;let s=o?.location.file;if(s&&a.has(s)){let e=n.collectTestIds(t);r.push(...e.locations),i.push(...e.testIds)}}Q(`queue-if-busy`,{locations:r,testIds:i})});return()=>e.dispose()},[Q,V,M,P,H,m,Y,J]),E.useEffect(()=>{if(!V)return;let e=e=>{e.code===`Backquote`&&e.ctrlKey?(e.preventDefault(),a(!i)):e.code===`F5`&&e.shiftKey?(e.preventDefault(),V?.stopTestsNoReply({})):e.code===`F5`&&(e.preventDefault(),$())};return addEventListener(`keydown`,e),()=>{removeEventListener(`keydown`,e)}},[$,X,V,i]);let Ne=E.useRef(null),Pe=E.useCallback(e=>{e.preventDefault(),e.stopPropagation(),Ne.current?.showModal()},[]),Fe=E.useCallback(e=>{e.preventDefault(),e.stopPropagation(),Ne.current?.close()},[]),Ie=E.useCallback(e=>{Fe(e),a(!0),V?.installBrowsers({}).then(async()=>{a(!1);let{hasBrowsers:e}=await V?.checkBrowsers({});fe(e)})},[Fe,V])