@testver/testver 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/bin/testver.js +8 -1
  2. package/dist/index.js +1414 -793
  3. package/dist/py-agent/__pycache__/testver_appium.cpython-313.pyc +0 -0
  4. package/package.json +7 -6
  5. package/src/ui/static/assets/AIPanel-D09Ni3a4.js +32 -0
  6. package/src/ui/static/assets/AIRecordPanel-DZtUZnRe.js +40 -0
  7. package/src/ui/static/assets/AIStreamUI-BsxKziYG.js +9 -0
  8. package/src/ui/static/assets/AITestGenPage-Cg21-P1W.js +5 -0
  9. package/src/ui/static/assets/APITestingPage-Cdc8EZz2.js +19 -0
  10. package/src/ui/static/assets/AboutPage-yJLCr2_q.js +1 -0
  11. package/src/ui/static/assets/AdvancedPage-DB-6sJ6s.js +3 -0
  12. package/src/ui/static/assets/AnalyticsPage-gTPFsiLZ.js +1 -0
  13. package/src/ui/static/assets/AuditLogPage-DE45E_PV.js +1 -0
  14. package/src/ui/static/assets/ChangesSummary-C-7oi_sx.js +2 -0
  15. package/src/ui/static/assets/CodeMapPage-DgU6ZYBO.js +3 -0
  16. package/src/ui/static/assets/ConfirmDialog-DNU3qoAP.js +1 -0
  17. package/src/ui/static/assets/CoveragePage-BpTjgcdV.js +2 -0
  18. package/src/ui/static/assets/CronBuilder-DsnX-vRr.js +1 -0
  19. package/src/ui/static/assets/Dashboard-DRWbVyTb.js +1 -0
  20. package/src/ui/static/assets/DefectsPage-BtMNbq6Z.js +72 -0
  21. package/src/ui/static/assets/DiffViewer-DPglzjPH.js +2 -0
  22. package/src/ui/static/assets/EmptyState-BH_aDO0P.js +1 -0
  23. package/src/ui/static/assets/ExportButton-Ce_MxnM1.js +1 -0
  24. package/src/ui/static/assets/FileViewer-iYL0lxyY.js +18 -0
  25. package/src/ui/static/assets/GitPage-CQqV8JBC.js +12 -0
  26. package/src/ui/static/assets/ImportExportPage-DXk7Koaq.js +36 -0
  27. package/src/ui/static/assets/JiraPushDialog-CqftoLh8.js +1 -0
  28. package/src/ui/static/assets/LiveExecutionView-BD0wE8sz.js +1 -0
  29. package/src/ui/static/assets/ManagePage-B8iG6Q0B.js +1 -0
  30. package/src/ui/static/assets/MediaModal-DiSINwmh.js +1 -0
  31. package/src/ui/static/assets/MobileRunPicker-BNs2lZFf.js +1 -0
  32. package/src/ui/static/assets/MobileRunTarget-D2Nqcj10.js +6 -0
  33. package/src/ui/static/assets/ModuleExplorer-BmkoQrHb.js +1 -0
  34. package/src/ui/static/assets/OutputPage-Dcsr7cmr.js +1 -0
  35. package/src/ui/static/assets/PipelinesPanel-CMMXCSda.js +1 -0
  36. package/src/ui/static/assets/ProfilePage-ByshrcwC.js +1 -0
  37. package/src/ui/static/assets/ProjectExplorer-B9B___ij.js +1 -0
  38. package/src/ui/static/assets/RemoteFileStrip-DbPnaZ-v.js +1 -0
  39. package/src/ui/static/assets/ReportCard-BbNfk85h.js +2 -0
  40. package/src/ui/static/assets/ReportFullView-Cg1rggho.js +1 -0
  41. package/src/ui/static/assets/ReportsPage-CFv3OAhe.js +48 -0
  42. package/src/ui/static/assets/ResultsPage-B4LwZH-R.js +115 -0
  43. package/src/ui/static/assets/RunTargets-C7Vqd4TU.js +1 -0
  44. package/src/ui/static/assets/ScriptMappingPage-BrANeHv0.js +1 -0
  45. package/src/ui/static/assets/SearchableDevicePicker-CFJ_DUAA.js +1 -0
  46. package/src/ui/static/assets/SettingsPage-BwOiebKG.js +83 -0
  47. package/src/ui/static/assets/SharedReportView-BAbW1WOs.js +1 -0
  48. package/src/ui/static/assets/SourcesPage-C_QVQwiA.js +14 -0
  49. package/src/ui/static/assets/TestExplorerPage-BRRWtwde.js +7 -0
  50. package/src/ui/static/assets/TestManagementPage-Ch4PthuU.js +10 -0
  51. package/src/ui/static/assets/TestPlansPage-Bno2vpGd.js +5 -0
  52. package/src/ui/static/assets/TestverCreditsDetail-cSW0SpNx.js +1 -0
  53. package/src/ui/static/assets/TestverCreditsRing-CUsMGEe3.js +1 -0
  54. package/src/ui/static/assets/UncommittedDiffViewer-B5HSURk8.js +2 -0
  55. package/src/ui/static/assets/UserManagementPage-BjY3ftxf.js +10 -0
  56. package/src/ui/static/assets/WorkflowsPage-BUu-LjZ8.js +83 -0
  57. package/src/ui/static/assets/aiHandoff-vhtR29Fh.js +1 -0
  58. package/src/ui/static/assets/ansiToHtml-DYRzYQV1.js +1 -0
  59. package/src/ui/static/assets/dark-logo-DCPcGDyT.svg +1 -0
  60. package/src/ui/static/assets/excel-BrxuVus5.js +1 -0
  61. package/src/ui/static/assets/formatDate-T65-Y6Mi.js +1 -0
  62. package/src/ui/static/assets/formatTestName-BKd2Uqhs.js +1 -0
  63. package/src/ui/static/assets/hiddenLlmProviders-setxgY_B.js +1 -0
  64. package/src/ui/static/assets/index-B0klHYbO.css +1 -0
  65. package/src/ui/static/assets/index-DpQhqcHv.js +11 -0
  66. package/src/ui/static/assets/index-DtBWNlVD.js +47 -0
  67. package/src/ui/static/assets/logo-C7ltqfpq.svg +1 -0
  68. package/src/ui/static/assets/runSelected-WlgnZcSF.js +1 -0
  69. package/src/ui/static/assets/sandboxStorage-BrzaG3ny.js +1 -0
  70. package/src/ui/static/assets/simpleMarkdown-kWs-10D8.js +5 -0
  71. package/src/ui/static/assets/useChartTheme-BFz2QcND.js +1 -0
  72. package/src/ui/static/assets/useDebouncedValue-BsHptIvX.js +1 -0
  73. package/src/ui/static/assets/useFeatureFlags-DqhngqgG.js +1 -0
  74. package/src/ui/static/assets/useJiraConnector-TM1Rfj1s.js +1 -0
  75. package/src/ui/static/assets/useOwnership-eW6Egd7X.js +1 -0
  76. package/src/ui/static/assets/useSuites-CvtMGakZ.js +1 -0
  77. package/src/ui/static/assets/useTabParam-ChbOedP1.js +1 -0
  78. package/src/ui/static/assets/useTestExplorer-HqvURJAc.js +1 -0
  79. package/src/ui/static/assets/useTestLifecycle-CL7-zz0Q.js +1 -0
  80. package/src/ui/static/assets/useTestManagement-ZTA1_VUm.js +2 -0
  81. package/src/ui/static/assets/useTestResults-Bm-JyMhB.js +1 -0
  82. package/src/ui/static/assets/vendor-charts-DWFQlmCz.js +73 -0
  83. package/src/ui/static/assets/vendor-excel-BFHGVHVC.js +24 -0
  84. package/src/ui/static/assets/vendor-flow-BnuhLJ6X.css +1 -0
  85. package/src/ui/static/assets/vendor-flow-YGpC9U9I.js +23 -0
  86. package/src/ui/static/assets/vendor-icons-B0wLOBoh.js +1421 -0
  87. package/src/ui/static/assets/vendor-query-BrzmPFT3.js +1 -0
  88. package/src/ui/static/assets/vendor-quill-CTpA5PSA.css +7 -0
  89. package/src/ui/static/assets/{index-xlbWNOlh.js → vendor-quill-W-RoQfb6.js} +1 -1
  90. package/src/ui/static/assets/vendor-react-CTbHBddL.js +61 -0
  91. package/src/ui/static/assets/visibleInterval-BKsLfJZ3.js +1 -0
  92. package/src/ui/static/dark-logo.svg +1 -1
  93. package/src/ui/static/index.html +5 -2
  94. package/src/ui/static/logo.svg +1 -1
  95. package/src/ui/static/assets/dark-logo-BddlJH8z.svg +0 -1
  96. package/src/ui/static/assets/index-8gWK1fNb.js +0 -2250
  97. package/src/ui/static/assets/index-DMd4ynKJ.css +0 -7
  98. package/src/ui/static/assets/logo-DwQCjTm_.svg +0 -1
@@ -0,0 +1,48 @@
1
+ import{r as i,j as e,u as F}from"./vendor-react-CTbHBddL.js";import{a as E,f as I}from"./formatDate-T65-Y6Mi.js";import{s as G}from"./visibleInterval-BKsLfJZ3.js";import{b as L,a8 as _,ip as q,bN as W,iq as Y,ir as B,is as X,gK as J,gJ as Z,gI as ee,it as te,iu as ae,iv as M,iw as se,ix as re}from"./index-DtBWNlVD.js";import{C as O}from"./ConfirmDialog-DNU3qoAP.js";import{C as ne}from"./CronBuilder-DsnX-vRr.js";import{h as ie}from"./aiHandoff-vhtR29Fh.js";import{g as U,a1 as V,S as Q,dq as A,a3 as C,R as K,bq as P,bp as le,b9 as H,a9 as $,ae as oe,_ as de,b6 as ce,ak as z,X as xe,a7 as he,y as me,bD as pe}from"./vendor-icons-B0wLOBoh.js";import"./vendor-query-BrzmPFT3.js";function Ce(){const[o,r]=i.useState("my"),n=[{id:"my",label:"My Reports",Icon:U},{id:"scheduled",label:"Scheduled",Icon:V},{id:"templates",label:"Templates",Icon:Q},{id:"shared",label:"Shared",Icon:A}];return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Reports"}),e.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1 leading-relaxed",children:["Dashboards generated through the ",e.jsx("em",{className:"italic text-gray-700 dark:text-gray-300",children:"AI Assistant in Reporting mode"})," live here."," ",e.jsx("em",{className:"italic text-gray-700 dark:text-gray-300",children:"My Reports"})," opens, pins, shares, or regenerates any saved dashboard with current data."," ",e.jsx("em",{className:"italic text-gray-700 dark:text-gray-300",children:"Scheduled"})," emails the latest version of a saved report on a recurring cadence."," ",e.jsx("em",{className:"italic text-gray-700 dark:text-gray-300",children:"Templates"})," kicks off a new report from a quick-start prompt, and"," ",e.jsx("em",{className:"italic text-gray-700 dark:text-gray-300",children:"Shared"})," lists every report shared in this workspace via a public link — anyone signed in can open and download them."]})]}),e.jsx("div",{className:"flex items-center gap-1 border-b border-gray-200 dark:border-white/10 mb-5",children:n.map(h=>{const d=h.Icon,u=o===h.id;return e.jsxs("button",{onClick:()=>r(h.id),className:`flex items-center gap-1.5 px-3 py-2 text-sm font-medium border-b-2 transition-colors -mb-px ${u?"border-brand-500 text-brand-600 dark:text-brand-400":"border-transparent text-gray-500 hover:text-gray-700 dark:hover:text-gray-300"}`,children:[e.jsx(d,{size:14}),h.label]},h.id)})}),o==="my"&&e.jsx(D,{shared:!1}),o==="shared"&&e.jsx(D,{shared:!0}),o==="scheduled"&&e.jsx(ue,{}),o==="templates"&&e.jsx(ye,{})]})}function D({shared:o}){const r=F(),n=L(),h=_().hasRole("tester"),[d,u]=i.useState(null),[S,w]=i.useState([]),[j,g]=i.useState(!0),[N,b]=i.useState(!1),[c,y]=i.useState(null),[x,m]=i.useState(0),f=async t=>{t!=null&&t.initial?g(!0):b(!0);try{const s=o?await Y():await B();w(s.reports)}catch(s){n.toast("error",`Load failed: ${s instanceof Error?s.message:String(s)}`)}finally{g(!1),b(!1)}};i.useEffect(()=>{f({initial:!0})},[]),i.useEffect(()=>{if(!c){m(0);return}(async()=>{try{const{schedules:t}=await q();m(t.filter(s=>s.sourceReportId===c.id).length)}catch{m(0)}})()},[c]);const v=o?S.filter(t=>!!t.shareToken):S,p=t=>h&&t.mine!==!1,T=async t=>{try{await X(t.id,{pinned:!t.pinned}),await f()}catch(s){n.toast("error",`Pin failed: ${s instanceof Error?s.message:String(s)}`)}},R=async()=>{if(c)try{await te(c.id),y(null),n.toast("success","Report deleted"),await f()}catch(t){n.toast("error",`Delete failed: ${t instanceof Error?t.message:String(t)}`)}},l=async(t,s)=>{u(`${t.id}:${s}`);try{await ee(s,{reportId:t.id})}catch(k){n.toast("error",`Download failed: ${k instanceof Error?k.message:String(k)}`)}finally{u(null)}},a=async t=>{try{if(t.shareToken)await J(t.id),n.toast("success","Share link revoked");else{const{shareUrl:s}=await Z(t.id),k=`${window.location.origin}${s}`;try{await navigator.clipboard.writeText(k)}catch{}n.toast("success",`Share link copied: ${k}`)}await f()}catch(s){n.toast("error",`Share failed: ${s instanceof Error?s.message:String(s)}`)}};return j?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400 py-10 justify-center",children:[e.jsx(C,{size:14,className:"animate-spin"})," Loading reports…"]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:[v.length," report",v.length===1?"":"s"]}),e.jsxs("button",{onClick:()=>f(),disabled:N,className:"flex items-center gap-1.5 px-2 py-1 rounded-md text-xs text-gray-600 dark:text-gray-400 hover:bg-white/5 transition-colors disabled:opacity-60",children:[e.jsx(K,{size:12,className:N?"animate-spin":""}),N?"Refreshing…":"Refresh"]})]}),v.length===0&&e.jsxs("div",{className:"text-center py-16 text-gray-500 dark:text-gray-400",children:[e.jsx(U,{size:32,className:"mx-auto mb-3 opacity-40"}),e.jsx("div",{className:"text-sm",children:o?"No shared reports yet.":"No saved reports yet."}),e.jsx("div",{className:"text-xs mt-2",children:o?h?"Reports shared by anyone in this workspace appear here. To share one of yours, click the Share icon on it in My Reports.":"Reports shared by anyone in this workspace appear here.":"Build a dashboard in Reporting mode and click the bookmark icon to save it here."})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:v.map(t=>e.jsxs("div",{className:"group rounded-xl border border-gray-200 dark:border-white/10 bg-white dark:bg-white/[0.03] p-4 flex flex-col",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[t.pinned&&e.jsx(P,{size:12,className:"text-amber-500 mt-1 flex-shrink-0"}),e.jsx("div",{className:"font-semibold text-sm text-gray-900 dark:text-gray-100 truncate",children:t.title})]}),p(t)&&e.jsxs("div",{className:"flex gap-1 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100 focus-within:opacity-100",children:[e.jsx("button",{onClick:()=>T(t),className:"p-1 rounded text-gray-400 hover:text-amber-500 hover:bg-white/5",title:t.pinned?"Unpin":"Pin",children:t.pinned?e.jsx(le,{size:12}):e.jsx(P,{size:12})}),e.jsx("button",{onClick:()=>a(t),className:`p-1 rounded hover:bg-white/5 ${t.shareToken?"text-emerald-500 hover:text-emerald-600":"text-gray-400 hover:text-brand-500"}`,title:t.shareToken?"Revoke share link":"Create a public share link (copied to clipboard)",children:e.jsx(A,{size:12})}),e.jsx("button",{onClick:()=>y(t),className:"p-1 rounded text-gray-400 hover:text-rose-500 hover:bg-white/5",title:"Delete",children:e.jsx(H,{size:12})})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-gray-500 dark:text-gray-400 mb-3 flex-wrap",children:[t.templateId&&e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-600 dark:text-brand-400 font-medium",children:t.templateId}),t.shareToken&&t.mine!==!1&&e.jsxs("span",{className:"flex items-center gap-1",title:`Opened ${t.shareViews??0} time${t.shareViews===1?"":"s"}${t.shareLastViewedAt?`, last ${I(t.shareLastViewedAt)}`:""}`,children:[e.jsx(A,{size:10})," Shared · ",t.shareViews??0," view",t.shareViews===1?"":"s",t.shareExpiresAt&&e.jsxs(e.Fragment,{children:[" · expires ",E(t.shareExpiresAt)]})]}),t.shareToken&&t.mine===!1&&e.jsxs("span",{className:"flex items-center gap-1","data-testid":"report-shared-by",children:[e.jsx(A,{size:10})," Shared",t.sharedByName?` by ${t.sharedByName}`:"",t.shareExpiresAt&&e.jsxs(e.Fragment,{children:[" · expires ",E(t.shareExpiresAt)]})]}),e.jsx("span",{children:E(t.updatedAt)})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-wrap mb-3",children:[e.jsxs("a",{href:W(`/api/reports/${encodeURIComponent(t.id)}/render.html`),target:"_blank",rel:"noopener noreferrer",onClick:s=>s.stopPropagation(),className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide bg-gray-100 dark:bg-white/[0.06] text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/[0.10] transition-colors",title:"Open the HTML report",children:[e.jsx($,{size:9})," html"]}),["pdf","docx","xlsx"].map(s=>e.jsxs("button",{onClick:k=>{k.stopPropagation(),l(t,s)},disabled:d===`${t.id}:${s}`,className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide bg-gray-100 dark:bg-white/[0.06] text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-white/[0.10] transition-colors disabled:opacity-60",title:`Download ${s.toUpperCase()}`,children:[d===`${t.id}:${s}`?e.jsx(C,{size:9,className:"animate-spin"}):e.jsx($,{size:9})," ",s]},s))]}),e.jsxs("div",{className:"flex items-center gap-2 mt-auto",children:[e.jsxs("button",{onClick:()=>r(`/reports/view/${t.id}`),className:"flex-1 flex items-center justify-center gap-1 px-3 py-1.5 rounded-md text-xs font-medium bg-brand-500/10 hover:bg-brand-500/20 text-brand-600 dark:text-brand-400 transition-colors",children:[e.jsx(oe,{size:12})," Open"]}),t.shareToken&&e.jsx("a",{href:`/reports/share/${t.shareToken}`,target:"_blank",rel:"noopener noreferrer",onClick:s=>s.stopPropagation(),className:"flex items-center justify-center px-3 py-1.5 rounded-md text-xs font-medium bg-gray-100 dark:bg-white/5 hover:bg-gray-200 dark:hover:bg-white/10 text-gray-700 dark:text-gray-300 transition-colors",title:"Open public share link",children:e.jsx(de,{size:12})})]})]},t.id))}),e.jsx(O,{open:!!c,title:"Delete report?",description:`"${c==null?void 0:c.title}" will be permanently deleted. Any active share link will stop working.`+(x>0?` ${x} scheduled dispatch${x===1?"":"es"} pointing to this report will ALSO be removed.`:""),confirmLabel:"Delete",onConfirm:R,onCancel:()=>y(null)})]})}function ue(){const o=L(),r=_().hasRole("tester"),[n,h]=i.useState([]),[d,u]=i.useState([]),[S,w]=i.useState(!0),[j,g]=i.useState(!1),[N,b]=i.useState(null),[c,y]=i.useState(!1),[x,m]=i.useState(null),[f,v]=i.useState(null),p=async a=>{a!=null&&a.initial?w(!0):a!=null&&a.silent||g(!0);try{const[t,s]=await Promise.all([q(),B()]);h(t.schedules),u(s.reports)}catch(t){a!=null&&a.silent||o.toast("error",`Load failed: ${t instanceof Error?t.message:String(t)}`)}finally{w(!1),g(!1)}};i.useEffect(()=>{p({initial:!0})},[]),i.useEffect(()=>{if(!(c||x))return G(()=>{p({silent:!0})},2e4)},[c,x]);const T=async a=>{try{await M(a.id,{enabled:!a.enabled}),await p()}catch(t){o.toast("error",`Update failed: ${t instanceof Error?t.message:String(t)}`)}},R=async a=>{v(a.id);try{const t=await ae(a.id);t.success?o.toast("success","Dispatch succeeded"):o.toast("error",`Dispatch failed: ${t.error||"unknown"}`),await p()}catch(t){o.toast("error",`Run failed: ${t instanceof Error?t.message:String(t)}`)}finally{v(null)}},l=async()=>{if(x)try{await se(x.id),o.toast("success","Schedule deleted"),m(null),await p()}catch(a){o.toast("error",`Delete failed: ${a instanceof Error?a.message:String(a)}`)}};return S?e.jsxs("div",{className:"py-10 text-center text-sm text-gray-500",children:[e.jsx(C,{size:14,className:"inline animate-spin mr-2"})," Loading…"]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:[n.length," schedule",n.length===1?"":"s"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>p(),disabled:j,className:"flex items-center gap-1.5 px-2 py-1 rounded-md text-xs text-gray-600 dark:text-gray-400 hover:bg-white/5 transition-colors disabled:opacity-60",title:"Refresh schedule list",children:[e.jsx(K,{size:12,className:j?"animate-spin":""}),j?"Refreshing…":"Refresh"]}),r&&e.jsxs("button",{onClick:()=>{b(null),y(!0)},disabled:d.length===0,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium bg-brand-500/10 hover:bg-brand-500/20 text-brand-600 dark:text-brand-400 transition-colors disabled:opacity-50",title:d.length===0?"Save a report first in Reporting mode, then you can schedule it":"Create a new schedule",children:[e.jsx(ce,{size:12})," New schedule"]})]})]}),n.length===0?e.jsxs("div",{className:"text-center py-14 text-sm text-gray-500 dark:text-gray-400",children:[e.jsx(V,{size:28,className:"mx-auto mb-3 opacity-40"}),"No schedules yet. Click ",e.jsx("strong",{children:"New schedule"})," to dispatch a saved report on a recurring basis."]}):e.jsx("div",{className:"rounded-xl border border-gray-200 dark:border-white/10 overflow-hidden bg-white dark:bg-white/[0.03]",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50 dark:bg-white/[0.04]",children:e.jsxs("tr",{className:"text-left text-[10px] text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:[e.jsx("th",{className:"px-3 py-2 font-semibold",children:"Title"}),e.jsx("th",{className:"px-3 py-2 font-semibold",children:"Source"}),e.jsx("th",{className:"px-3 py-2 font-semibold",children:"Schedule"}),e.jsx("th",{className:"px-3 py-2 font-semibold",children:"Format"}),e.jsx("th",{className:"px-3 py-2 font-semibold",children:"Recipients"}),e.jsx("th",{className:"px-3 py-2 font-semibold",children:"Last run"}),e.jsx("th",{className:"px-3 py-2 font-semibold",children:"Status"}),e.jsx("th",{className:"px-3 py-2"})]})}),e.jsx("tbody",{className:"bg-white dark:bg-white/[0.02]",children:n.map(a=>{const t=d.find(s=>s.id===a.sourceReportId);return e.jsxs("tr",{className:"border-t border-gray-100 dark:border-white/5 bg-white dark:bg-transparent hover:bg-gray-50 dark:hover:bg-white/[0.04] transition-colors",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:a.title})}),e.jsx("td",{className:"px-3 py-2 text-xs text-gray-600 dark:text-gray-400 truncate max-w-[160px]",children:t?t.title:e.jsx("span",{className:"text-rose-500",children:"Missing"})}),e.jsxs("td",{className:"px-3 py-2 text-xs text-gray-700 dark:text-gray-300",title:a.cron,children:[a.cronHuman&&a.cronHuman!==a.cron?a.cronHuman:e.jsx("span",{className:"font-mono",children:a.cron}),a.enabled&&a.nextRun&&e.jsxs("div",{className:"text-[10px] text-gray-500",children:["next ",I(a.nextRun)]})]}),e.jsx("td",{className:"px-3 py-2 text-xs uppercase text-gray-600 dark:text-gray-400",children:a.format}),e.jsx("td",{className:"px-3 py-2 text-xs text-gray-700 dark:text-gray-300 truncate max-w-[180px]",title:a.recipients.join(", "),children:a.recipients.length===1?a.recipients[0]:`${a.recipients.length} recipients`}),e.jsx("td",{className:"px-3 py-2 text-xs text-gray-500 dark:text-gray-400",children:a.lastRun?I(a.lastRun):"—"}),e.jsx("td",{className:"px-3 py-2 text-xs",children:a.enabled?a.lastStatus==="success"&&a.lastWarning?e.jsxs("span",{className:"inline-flex items-center gap-1 text-amber-600 dark:text-amber-400",title:a.lastWarning,children:[e.jsx(z,{size:10})," Sent · stale data"]}):a.lastStatus==="success"?e.jsxs("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400",children:[e.jsx(z,{size:10})," Success"]}):a.lastStatus==="error"?e.jsxs("span",{className:"inline-flex items-center gap-1 text-rose-600 dark:text-rose-400",title:a.lastError,children:[e.jsx(xe,{size:10})," Error"]}):e.jsx("span",{className:"text-gray-500",children:"—"}):e.jsx("span",{className:"text-gray-500",children:"paused"})}),e.jsx("td",{className:"px-3 py-2",children:r&&e.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[e.jsx("button",{onClick:()=>R(a),disabled:f===a.id,className:"p-1 rounded text-gray-500 hover:text-emerald-600 hover:bg-emerald-500/10 disabled:opacity-50",title:"Run now",children:f===a.id?e.jsx(C,{size:12,className:"animate-spin"}):e.jsx(he,{size:12})}),e.jsx("button",{onClick:()=>T(a),className:"p-1 rounded text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-white/5",title:a.enabled?"Pause — stop sending until resumed":"Resume — send on schedule again",children:a.enabled?e.jsx("span",{className:"text-[10px] font-semibold px-1",children:"PAUSE"}):e.jsx("span",{className:"text-[10px] font-semibold px-1 text-emerald-500",children:"RESUME"})}),e.jsx("button",{onClick:()=>{b(a),y(!0)},className:"p-1 rounded text-gray-500 hover:text-brand-500 hover:bg-brand-500/10",title:"Edit",children:e.jsx("span",{className:"text-[10px] font-semibold px-1",children:"EDIT"})}),e.jsx("button",{onClick:()=>m(a),className:"p-1 rounded text-gray-500 hover:text-rose-500 hover:bg-rose-500/10",title:"Delete",children:e.jsx(H,{size:12})})]})})]},a.id)})})]})}),c&&e.jsx(ge,{reports:d,editing:N,onClose:()=>{y(!1),b(null)},onSaved:async()=>{y(!1),b(null),await p()}}),e.jsx(O,{open:!!x,title:"Delete schedule?",description:`"${x==null?void 0:x.title}" will stop dispatching. This cannot be undone.`,confirmLabel:"Delete",onConfirm:l,onCancel:()=>m(null)})]})}function ge({reports:o,editing:r,onClose:n,onSaved:h}){var R;const d=L(),[u,S]=i.useState((r==null?void 0:r.title)||""),[w,j]=i.useState(r?"":((R=o[0])==null?void 0:R.id)||""),[g,N]=i.useState((r==null?void 0:r.cron)||"0 9 * * *"),[b,c]=i.useState((r==null?void 0:r.format)||"pdf"),[y,x]=i.useState((r==null?void 0:r.recipients.join(", "))||""),[m,f]=i.useState((r==null?void 0:r.enabled)!==!1),[v,p]=i.useState(!1),T=async()=>{if(!u.trim()||!g.trim()||!r&&!w){d.toast("error",r?"Title and cron are required":"Title, source report, and cron are required");return}const l=y.split(",").map(s=>s.trim()).filter(Boolean);if(l.length===0){d.toast("error","At least one recipient email is required");return}const a=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,t=l.find(s=>!a.test(s));if(t){d.toast("error",`Invalid recipient email: ${t}`);return}if(g.trim().split(/\s+/).length!==5){d.toast("error","Cron expression must have 5 fields (minute hour day-of-month month day-of-week)");return}p(!0);try{r?await M(r.id,{title:u,cron:g,format:b,recipients:l,enabled:m}):await re({title:u,sourceReportId:w,cron:g,format:b,recipients:l,enabled:m}),d.toast("success",r?"Schedule updated":"Schedule created"),await h()}catch(s){d.toast("error",`Save failed: ${s instanceof Error?s.message:String(s)}`)}finally{p(!1)}};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:n,children:e.jsxs("div",{className:"bg-white dark:bg-surface-1 rounded-2xl border border-gray-200 dark:border-white/10 w-[640px] max-w-[95vw] max-h-[90vh] overflow-y-auto p-5",onClick:l=>l.stopPropagation(),children:[e.jsx("div",{className:"text-lg font-semibold mb-4 text-gray-900 dark:text-gray-100",children:r?"Edit schedule":"New schedule"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] uppercase tracking-wider text-gray-500 dark:text-gray-400 font-semibold",children:"Title"}),e.jsx("input",{value:u,onChange:l=>S(l.target.value),placeholder:"e.g., Weekly QA Summary",className:"w-full mt-1 px-3 py-2 rounded-md bg-gray-50 dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 text-sm outline-none focus:border-brand-500/50"})]}),!r&&e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] uppercase tracking-wider text-gray-500 dark:text-gray-400 font-semibold",children:"Source report"}),e.jsx("select",{value:w,onChange:l=>j(l.target.value),className:"w-full mt-1 px-3 py-2 rounded-md bg-gray-50 dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 text-sm outline-none focus:border-brand-500/50",children:o.map(l=>e.jsx("option",{value:l.id,children:l.title},l.id))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] uppercase tracking-wider text-gray-500 dark:text-gray-400 font-semibold",children:"Schedule"}),e.jsx("div",{className:"mt-1",children:e.jsx(ne,{value:g,onChange:N})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] uppercase tracking-wider text-gray-500 dark:text-gray-400 font-semibold",children:"Format"}),e.jsxs("select",{value:b,onChange:l=>c(l.target.value),className:"w-full mt-1 px-3 py-2 rounded-md bg-gray-50 dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 text-sm outline-none focus:border-brand-500/50",children:[e.jsx("option",{value:"pdf",children:"PDF"}),e.jsx("option",{value:"xlsx",children:"Excel (.xlsx)"}),e.jsx("option",{value:"docx",children:"Word (.docx)"}),e.jsx("option",{value:"html",children:"HTML"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] uppercase tracking-wider text-gray-500 dark:text-gray-400 font-semibold",children:"Enabled"}),e.jsx("button",{onClick:()=>f(l=>!l),className:`w-full mt-1 px-3 py-2 rounded-md text-xs font-medium transition-colors ${m?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border border-emerald-500/30":"bg-gray-100 dark:bg-white/5 text-gray-500"}`,children:m?"Enabled":"Paused"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[11px] uppercase tracking-wider text-gray-500 dark:text-gray-400 font-semibold",children:"Recipients (comma-separated)"}),e.jsx("input",{value:y,onChange:l=>x(l.target.value),placeholder:"qa-lead@example.com, manager@example.com",className:"w-full mt-1 px-3 py-2 rounded-md bg-gray-50 dark:bg-white/[0.03] border border-gray-200 dark:border-white/10 text-sm outline-none focus:border-brand-500/50"}),e.jsxs("div",{className:"text-[10px] text-gray-500 mt-1 flex items-center gap-1",children:[e.jsx(pe,{size:9})," Requires an Email connector to be configured in Connectors."]}),e.jsx("div",{className:"text-[10px] text-gray-500 mt-1 leading-relaxed",children:"Each run refreshes the report with current data, saves it, and emails the result — the saved report (and its share link, if any) then shows those latest values. If the run fails you get an email."})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 mt-5",children:[e.jsx("button",{onClick:n,className:"px-3 py-1.5 rounded-md text-xs font-medium text-gray-600 dark:text-gray-400 hover:bg-white/5 transition-colors",children:"Cancel"}),e.jsxs("button",{onClick:T,disabled:v,className:"flex items-center gap-1 px-3 py-1.5 rounded-md text-xs font-medium bg-brand-500 hover:bg-brand-600 text-white disabled:opacity-70 transition-colors",children:[v&&e.jsx(C,{size:11,className:"animate-spin"}),r?"Save changes":"Create schedule"]})]})]})})}const be=[{id:"executive",label:"Executive Summary",description:"High-level KPIs + pass-rate trend + top failures — for managers.",prompt:`Build an EXECUTIVE QA dashboard for the current sprint using the \`generate_dashboard\` tool.
2
+
3
+ Layout (4 rows on a 12-column grid):
4
+ 1. Four KPI cards (span 3 each): Total Test Cases, Automation Coverage %, Latest Pass Rate %, Critical Failures (open).
5
+ 2. A doughnut chart (span 6) "Automation Status" — Automated vs Manual.
6
+ 3. A line chart (span 6) "Pass Rate Trend" over the last 7–10 runs.
7
+ 4. A table (span 12) "Top 5 Failing Tests" with columns: Test Name, Failure Count, Last Failure, Category.
8
+ 5. A markdown cell (span 12) with a 3–5 bullet executive summary covering sprint health, biggest risks, and recommended next steps.
9
+
10
+ Pull real numbers from Testver — query test cases, run history, coverage stats, and failure analysis. Title: "Executive QA Summary — <Sprint Name or Date>". Save the result (save_report with templateId "executive") so it appears under My Reports.`},{id:"qa_daily",label:"QA Daily Report",description:"Last 24h status, new failures, flaky tests — for QA standups.",prompt:`Build a QA DAILY dashboard for the last 24 hours using the \`generate_dashboard\` tool.
11
+
12
+ Layout:
13
+ 1. Four KPI cards (span 3 each): Runs in Last 24h, Tests Executed, Pass Rate %, New Failures (since yesterday).
14
+ 2. A stacked bar chart (span 6) "Pass / Fail / Skip per Run" for each run in the last 24h.
15
+ 3. A doughnut chart (span 6) "Failure Categories" from the latest run (bug / environment / flaky / test-issue / timeout).
16
+ 4. A table (span 12) "New Failures Today" with columns: Test Name, Error Signature, Run, First Seen.
17
+ 5. A markdown cell (span 12) summarizing what changed since yesterday in 2–4 bullets — newly broken tests, fixed regressions, anything notable.
18
+
19
+ Pull live data from Testver run history and failure analysis. Title: "QA Daily — <Today's Date>". Save the result (save_report with templateId "qa_daily").`},{id:"release",label:"Release Readiness",description:"Latest run vs baseline: regressions, new failures, duration delta.",prompt:`Build a RELEASE READINESS dashboard comparing the LATEST run to the configured BASELINE run using the \`generate_dashboard\` tool.
20
+
21
+ Layout:
22
+ 1. Four KPI cards (span 3 each): Total Tests in Latest Run, Pass Rate Δ vs Baseline (with up/down arrow), Duration Δ vs Baseline, Regressions Count.
23
+ 2. A stacked bar chart (span 6) "Pass / Fail / Skip by Priority" for the latest run.
24
+ 3. A horizontal bar chart (span 6) "Top 5 Regressions" — tests that passed in baseline but fail in latest, sorted by failure impact.
25
+ 4. A table (span 12) "New Failures vs Baseline" with columns: Test Name, Baseline Result, Latest Result, Error Signature.
26
+ 5. A markdown cell (span 12) with a Go / No-Go recommendation, 3–5 bullets summarizing release risk.
27
+
28
+ Use Testver baseline + comparison endpoints. Title: "Release Readiness — Run <latest run id> vs Baseline". Save the result (save_report with templateId "release").`},{id:"trend_analysis",label:"Trend Analysis",description:"Pass rate / coverage / flaky / anomalies deep-dive across the last 20 runs.",prompt:`Build a TREND ANALYSIS dashboard covering the last 20 runs using the \`generate_dashboard\` tool.
29
+
30
+ Layout:
31
+ 1. Four KPI cards (span 3 each): Avg Pass Rate % (20 runs), Flaky Tests Count, Avg Run Duration, Coverage % (requirement coverage).
32
+ 2. A line chart (span 6) "Pass Rate Trend — Last 20 Runs".
33
+ 3. A line chart (span 6) "Duration Trend — Last 20 Runs" (avg seconds per run).
34
+ 4. A horizontal bar chart (span 12) "Top 10 Flakiest Tests" — sorted by flip rate (pass↔fail toggles across the 20 runs).
35
+ 5. A table (span 12) "Slowest 10 Tests" with columns: Test Name, Avg Duration, Max Duration, Runs Counted.
36
+ 6. A markdown cell (span 12) calling out anomalies, regressions, and patterns — 4–6 bullets.
37
+
38
+ Pull from run history, flaky-test detection, and slowest-tests stats. Title: "Trend Analysis — Last 20 Runs". Save the result (save_report with templateId "trend_analysis").`},{id:"automation_inventory",label:"Automation Inventory",description:"Every automation script — passing, failing, never run, skipped — by folder, framework and owner.",prompt:`Build an AUTOMATION INVENTORY dashboard of the project's automation scripts using the \`generate_dashboard\` tool. Take the numbers from \`test_library\` action "summary" — it covers every script, including the ones that have never run.
39
+
40
+ Layout:
41
+ 1. Four KPI cards (span 3 each): Total Scripts, Passing on Last Run %, Never Run, Not Linked to a Test Case.
42
+ 2. A doughnut chart (span 6) "Scripts by Status" — passing / failing / never run / skipped in code.
43
+ 3. A horizontal bar chart (span 6) "Scripts by Folder" — the folders with the most scripts.
44
+ 4. A table (span 12) "Folders" with columns: Folder, Scripts, Failing, Never Run, Flaky.
45
+ 5. A bar chart (span 6) "Scripts by Framework", and a table (span 6) "Scripts by Owner" (Owner, Scripts, Failing) when owners are known — otherwise a bar chart "Scripts by Tag".
46
+ 6. A markdown cell (span 12) with 3–5 bullets: the biggest gaps (never-run and unlinked scripts), the folders with the most failures, and recommended next steps.
47
+
48
+ Title: "Automation Inventory — <Today's Date>". Save the result (save_report with templateId "automation_inventory").`},{id:"manual_vs_automated",label:"Manual vs Automated",description:"Quick breakdown of test cases by automation status.",prompt:'Generate a dashboard showing the breakdown of manual and automated test cases — totals, automation coverage percentage, and a list of currently-manual tests that could be prioritized for automation. Save the result (save_report with templateId "manual_vs_automated").'},{id:"coverage_by_requirement",label:"Coverage by Requirement",description:"Requirement coverage with orphan tests and uncovered requirements.",prompt:'Generate a dashboard showing requirement coverage — how many requirements have linked test cases, how many are uncovered, and which test cases are orphaned (no requirement linked). Save the result (save_report with templateId "coverage_by_requirement").'}];function ye(){const o=F(),r=n=>ie(o,{prompt:n,mode:"reporting"});return e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:"Click a template to open the AI Assistant in Reporting mode with the prompt pre-filled. You can edit the prompt before submitting."}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:be.map(n=>e.jsxs("div",{className:"rounded-xl border border-gray-200 dark:border-white/10 bg-white dark:bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[e.jsx(Q,{size:14,className:"text-brand-500 mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:n.label}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1 leading-relaxed",children:n.description})]})]}),e.jsxs("div",{className:"text-[11px] text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-white/[0.02] border border-gray-100 dark:border-white/5 rounded-md p-2 font-mono mb-3 italic",children:['"',n.prompt,'"']}),e.jsxs("button",{onClick:()=>r(n.prompt),className:"w-full flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium bg-brand-500/10 hover:bg-brand-500/20 text-brand-600 dark:text-brand-400 transition-colors",children:["Run template ",e.jsx(me,{size:11,className:"-rotate-90"})]})]},n.id))})]})}export{Ce as ReportsPage};