@capagents/forgeqe 3.1.6 → 3.1.8
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/dist/forgeqe.js +1753 -1752
- package/dist/web/assets/{3d-force-graph-DhjnuSZ7.js → 3d-force-graph-OeCdKJJ-.js} +1 -1
- package/dist/web/assets/{Agent-BvZNnkYO.js → Agent-DrdDwck4.js} +1 -1
- package/dist/web/assets/{AgentWork-CXqq9ihT.js → AgentWork-wNaA-i2T.js} +1 -1
- package/dist/web/assets/ApiTests-B3X6NIn8.js +10 -0
- package/dist/web/assets/{Browse-DU423cZs.js → Browse-Cd1DEgYR.js} +1 -1
- package/dist/web/assets/{Chat-D128NJm9.js → Chat-4GknHS5Z.js} +1 -1
- package/dist/web/assets/{CommandPalette-CqHeNMlz.js → CommandPalette-zRrrp6F_.js} +1 -1
- package/dist/web/assets/{Compare-Cfhl9eEb.js → Compare-DJVhkzqO.js} +1 -1
- package/dist/web/assets/{Cost-BZ34Hxth.js → Cost-CbKnuQuB.js} +1 -1
- package/dist/web/assets/{Data-BQx6Yjyt.js → Data-Bt5yqqvq.js} +1 -1
- package/dist/web/assets/{Desktop-XvNM9FOF.js → Desktop-CPDo3Ir-.js} +1 -1
- package/dist/web/assets/{DesktopReview-hvUm15-5.js → DesktopReview-CCaqTSu5.js} +1 -1
- package/dist/web/assets/{Evidence-Cfk59P10.js → Evidence-BAuIgj1h.js} +1 -1
- package/dist/web/assets/{Explore-BDyb5dKe.js → Explore-BqzEPdP7.js} +1 -1
- package/dist/web/assets/{Features-XIqYxKc1.js → Features-DFuPCW9x.js} +1 -1
- package/dist/web/assets/{Flags-CdHPrNp4.js → Flags-UBakvqIq.js} +1 -1
- package/dist/web/assets/{Flaky-DwDQRut-.js → Flaky-DUzdfQW4.js} +1 -1
- package/dist/web/assets/{Impact-t9iOQDtS.js → Impact-jLZqUzz9.js} +1 -1
- package/dist/web/assets/{Jobs-48PdEMgf.js → Jobs-De3NyY5s.js} +1 -1
- package/dist/web/assets/{KindPage-Dy0J7L-M.js → KindPage-DWznWcLB.js} +1 -1
- package/dist/web/assets/{Migration-0HYN_JZm.js → Migration-BdOq6RO6.js} +1 -1
- package/dist/web/assets/{PageAgent-DY8YEIdr.js → PageAgent-dVvZtNoB.js} +1 -1
- package/dist/web/assets/{Product-Ba9C8kLQ.js → Product-ByZ8Qr3i.js} +3 -3
- package/dist/web/assets/{Production-DzfDMnnj.js → Production-D8L2TchK.js} +1 -1
- package/dist/web/assets/{Quality-CnURaQom.js → Quality-CSZEuhZo.js} +1 -1
- package/dist/web/assets/{Readiness-DlwnwSJ8.js → Readiness-bBu_84mx.js} +1 -1
- package/dist/web/assets/{Record-CrJyzp8u.js → Record-DWJEDj2C.js} +1 -1
- package/dist/web/assets/{Regression-D-qjvr44.js → Regression-D2VkPIhZ.js} +1 -1
- package/dist/web/assets/{Reports-BspqEzVg.js → Reports-dF-O5HTI.js} +1 -1
- package/dist/web/assets/{Response-BxvDBStv.js → Response-D4JW3pwi.js} +1 -1
- package/dist/web/assets/{Responsive-C4chhZcc.js → Responsive-CLX9S27s.js} +1 -1
- package/dist/web/assets/{RunDiff-D8NBOHwI.js → RunDiff-BuL_-GwF.js} +1 -1
- package/dist/web/assets/{Runs-Bb2krvLN.js → Runs-DyyaAiyA.js} +1 -1
- package/dist/web/assets/{Settings-D2Byn_Va.js → Settings-DnG6_QQj.js} +3 -3
- package/dist/web/assets/{Steps-CymeLF90.js → Steps-C-0zwG7T.js} +1 -1
- package/dist/web/assets/{TestCases-DYTIR2LB.js → TestCases-DXk9qsEL.js} +1 -1
- package/dist/web/assets/{TestData-UNmAG8Wi.js → TestData-D4al7-3Z.js} +1 -1
- package/dist/web/assets/{TestDebt-CQOYiRaK.js → TestDebt-BzOVDuS8.js} +1 -1
- package/dist/web/assets/{TestManagement-DWNUDF7y.js → TestManagement-T-NIlhc9.js} +1 -1
- package/dist/web/assets/{Tosca-BJsofAG8.js → Tosca-D7tqMGK0.js} +1 -1
- package/dist/web/assets/{WhatsNew-Gs-_0But.js → WhatsNew-DBViE2Qt.js} +1 -1
- package/dist/web/assets/{dataParts-DV44YXP9.js → dataParts-D56_9p6T.js} +1 -1
- package/dist/web/assets/{fold-CdtPs-3w.js → fold-UP5ihvz-.js} +1 -1
- package/dist/web/assets/{head-EHQVlLa5.js → head-BpR3dGRT.js} +1 -1
- package/dist/web/assets/{highlight-DIktyogB.js → highlight--Ayfy7Gy.js} +1 -1
- package/dist/web/assets/{index-Cq2sihjc.js → index-CljX5dI4.js} +5 -5
- package/dist/web/assets/{logos-B1BhmXnA.js → logos-B4e5nBuL.js} +1 -1
- package/dist/web/assets/{paletteCommands-w1UNWBRa.js → paletteCommands-ar4wAGok.js} +1 -1
- package/dist/web/assets/{qualityParts-B8bouYKy.js → qualityParts-D_U5zhKC.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/prompts/test-plan.md +1 -1
- package/prompts/test-reviewer.md +1 -1
- package/prompts/test-rules.md +6 -1
- package/py/forgeqe_engine/brand.py +45 -27
- package/py/forgeqe_engine/browser.py +34 -1
- package/py/forgeqe_engine/browserlaunch.py +16 -3
- package/py/forgeqe_engine/orb_assets.py +30 -0
- package/py/forgeqe_engine/profilename.py +168 -0
- package/py/forgeqe_engine/pwlaunch.mjs +3 -2
- package/py/forgeqe_engine/service.py +7 -1
- package/py/forgeqe_engine/settings.py +17 -0
- package/skills/bdd-gherkin/SKILL.md +3 -0
- package/dist/web/assets/ApiTests-B26ezscO.js +0 -10
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Hr as t,lt as n,r}from"./route-Dg53WdFu.js";import{t as i}from"./jsx-runtime-LKYXHABd.js";import{A as a,Rt as o,a as s}from"./input-D7iHeNXz.js";import{a as c,f as l,i as u,n as d,o as f}from"./filters-Culzq1j1.js";import{E as p,M as m}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Hr as t,lt as n,r}from"./route-Dg53WdFu.js";import{t as i}from"./jsx-runtime-LKYXHABd.js";import{A as a,Rt as o,a as s}from"./input-D7iHeNXz.js";import{a as c,f as l,i as u,n as d,o as f}from"./filters-Culzq1j1.js";import{E as p,M as m}from"./index-CljX5dI4.js";import{C as h,b as g,f as _,g as v,l as y,x as b}from"./logos-B4e5nBuL.js";var x=e(t(),1),S=i(),C=(e,t)=>t?r(`tosca`,e,`compare`,encodeURIComponent(t)):r(`tosca`,e,`compare`),w=50,T={before:`Before`,after:`After`,block:`Reusable block`,folder:`Folder`};function E({nodes:e,status:t,pick:n,onPick:r,depth:i=0}){return(0,S.jsx)(`ul`,{className:a(`m-0 flex list-none flex-col p-0`,i>0&&`ml-4 border-l border-line-soft pl-4`),children:e.map((e,o)=>{if(e.kind===`group`)return(0,S.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,S.jsxs)(`span`,{className:`text-[13px] font-medium text-muted`,children:[T[e.role||`folder`]||`Folder`,`: `,(0,S.jsx)(`span`,{className:`text-ink-2`,children:e.name})]}),(0,S.jsx)(E,{nodes:e.body||[],status:t,pick:n,onPick:r,depth:i+1})]},`g${o}`);if(e.kind===`if`||e.kind===`loop`){let a=e.condition;return(0,S.jsxs)(`li`,{className:`flex flex-col gap-1 py-1`,children:[(0,S.jsxs)(`span`,{className:`text-[13px] font-medium text-muted`,children:[e.kind===`if`?`If`:`Loop`,` `,e.name,`: `,(0,S.jsx)(`code`,{className:`font-mono text-[13px] text-ink-2`,children:a?.tosca}),a?.constant!==void 0&&(0,S.jsxs)(`span`,{children:[` · always `,a.constant?`true`:`false`]})]}),[`then`,`else`,`loop`].map(a=>e[a]?.length?(0,S.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,S.jsx)(`span`,{className:`ml-4 text-[13px] text-muted`,children:a===`then`?`Then`:a===`else`?`Else`:`Each time`}),(0,S.jsx)(E,{nodes:e[a],status:t,pick:n,onPick:r,depth:i+1})]},a):null)]},`i${o}`)}let s=e.id?t.get(e.id):void 0,c=s?y[s]:void 0;return(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,"aria-pressed":n===e.id,onClick:()=>r(e),className:a(`flex w-full min-w-0 cursor-pointer items-start gap-2 rounded-[8px] border-0 px-2 py-2 text-left text-[13px]`,n===e.id?`bg-accent-soft`:`bg-transparent hover:bg-surface-muted`),children:[(0,S.jsx)(`span`,{role:`img`,"aria-label":c?.label||`Not converted yet`,"data-tip":c?.label||`Not converted yet`,className:a(`mt-2 size-2 flex-none rounded-full`,c?.dot||`bg-line`)}),(0,S.jsx)(`span`,{className:`w-9 flex-none font-mono text-[13px] text-muted`,children:e.id}),(0,S.jsxs)(`span`,{className:a(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e.kind===`unsupported`?`text-warn`:`text-ink`),children:[h(e),e.tosca?.step&&(0,S.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Tosca step "`,e.tosca.step,`"`]})]})]})},e.id||o)})})}function D(e,t){for(let n of e){if(n.id===t)return n;for(let e of[`body`,`then`,`else`,`loop`]){let r=n[e]&&D(n[e],t);if(r)return r}}}function O({view:e,pick:t,engine:n}){let r=e.target,i=r?.text||``,o=i.split(`
|
|
2
2
|
`),c=m(i||null,r?.lang||`plaintext`),l=(0,x.useMemo)(()=>{if(!t)return new Set;let e=RegExp(`tosca:[\\sn\\d,]*\\b${t}\\b`,`i`);return new Set(o.flatMap((t,n)=>e.test(t)?[n]:[]))},[t,i]),u=(0,x.useRef)(null);(0,x.useEffect)(()=>{u.current?.scrollIntoView({block:`center`,behavior:s()})},[t,l.size]);let d=Math.min(...l);return(0,S.jsxs)(`figure`,{className:`pane-swap m-0 flex min-h-0 min-w-0 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,S.jsxs)(`figcaption`,{className:`flex min-h-10 items-center gap-2 border-b border-line-soft pr-1 pl-4`,children:[(0,S.jsx)(`span`,{className:`text-[13px] font-semibold tracking-[0.04em] text-muted uppercase`,children:n?b({kind:`test`,engine:n}):`Converted test`}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[13px] text-ink-2`,"data-tip":r?.path,children:r?.path||``}),i&&(0,S.jsx)(p,{text:i,label:`Copy ${r?.path||`the test`}`})]}),i?(0,S.jsxs)(`div`,{className:`flex min-h-[260px] flex-1 overflow-auto font-mono text-[13px] leading-[1.6]`,children:[(0,S.jsx)(`pre`,{"aria-hidden":`true`,className:`m-0 min-h-full flex-none self-stretch border-r border-line-soft py-4 text-right text-muted select-none`,children:o.map((e,t)=>(0,S.jsx)(`span`,{ref:t===d?u:void 0,className:a(`block px-4`,l.has(t)&&`bg-accent-soft font-semibold text-accent-fg`),children:t+1},t))}),(0,S.jsx)(`pre`,{className:`m-0 min-w-0 flex-1 px-4 py-4`,children:(0,S.jsx)(`code`,{className:`hljs`,children:c})})]}):(0,S.jsx)(`p`,{className:`m-0 flex min-h-[260px] flex-1 items-center justify-center px-4 text-center text-sm text-muted`,children:r?`Not written yet.`:`This test case is left out of the plan.`}),t&&i&&(0,S.jsx)(`p`,{role:`status`,className:`m-0 border-t border-line-soft px-4 py-2 text-[13px] text-muted`,children:l.size?`${t} is done on line ${[...l].map(e=>e+1).join(`, `)}.`:`No line of the test is marked ${t}.`})]})}function k({view:e,node:t}){if(!t?.target)return null;let[n,r]=t.target.split(`.`),i=e.pages.find(e=>e.id===n),a=i?.elements.find(e=>e.id===r);return a?(0,S.jsxs)(`section`,{"aria-label":`Locators Tosca recorded`,className:`flex flex-col gap-2 rounded-[12px] card border px-4 py-4 text-[13px]`,children:[(0,S.jsxs)(`span`,{className:`font-medium`,children:[a.name,` `,(0,S.jsxs)(`span`,{className:`font-normal text-muted`,children:[`on `,i?.name,a.scope?.length?`, inside ${a.scope.join(` › `)}`:``,a.nth===void 0?``:`, number ${a.nth+1}`]})]}),a.locators.length?(0,S.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:a.locators.slice(0,6).map((e,t)=>(0,S.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(`span`,{className:`w-14 flex-none text-[13px] text-muted`,children:e.strategy}),(0,S.jsx)(`code`,{className:`min-w-0 flex-1 font-mono text-[13px] text-ink-2 [overflow-wrap:anywhere]`,children:e.strategy===`role`?`${e.role} "${e.name}"`:e.attr?`[${e.attr}="${e.value}"]`:e.value}),e.fragile&&(0,S.jsx)(c,{tone:`warn`,children:`Fragile`})]},t))}):(0,S.jsx)(`span`,{className:`text-muted`,children:`Tosca recorded no locator for it.`})]}):null}function A({id:e,plan:t,result:r,initial:i,full:s,onPick:c}){let p=t.cases.filter(e=>e.included),[m,h]=(0,x.useState)(``),[y,b]=(0,x.useState)(i||p[0]?.id||``),[T,A]=(0,x.useState)(null),[j,M]=(0,x.useState)(``),[N,P]=(0,x.useState)(``);(0,x.useEffect)(()=>{y&&(P(``),o.case(e,y).then(A,e=>P(e.message)))},[e,y,r?.units.length,r?.status]),(0,x.useEffect)(()=>{M(``),y&&c?.(y)},[y]);let F=new Map((T?.fidelity||[]).map(e=>[e.id,e.status])),I=p.filter(e=>!m||e.name.toLowerCase().includes(m.toLowerCase())),[L,R]=(0,x.useState)(0);(0,x.useEffect)(()=>R(0),[m]),(0,x.useEffect)(()=>{let e=I.findIndex(e=>e.id===y);e>=0&&Math.floor(e/w)!==L&&R(Math.floor(e/w))},[y]);let z=I.slice(L*w,L*w+w),B=e=>r?.units.find(t=>t.kind===`test`&&t.case===e);if(!p.length)return(0,S.jsx)(f,{center:!0,className:`py-6`,children:`No test case of this plan is converted.`});let V=(0,S.jsxs)(`div`,{className:a(`grid grid-cols-[minmax(0,1fr)] gap-4 @5xl:grid-cols-[220px_minmax(0,1fr)_minmax(0,1fr)]`,s?`@5xl:min-h-0 @5xl:flex-1`:`@5xl:h-[calc(var(--screen)-368px)] @5xl:min-h-[540px]`),children:[(0,S.jsxs)(`nav`,{"aria-label":`Test cases`,className:`flex max-h-[320px] min-h-0 min-w-0 flex-col gap-2 overflow-hidden rounded-[14px] card border p-4 @5xl:max-h-none`,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-1 px-1`,children:[(0,S.jsx)(`span`,{className:`text-sm font-semibold`,children:`Test cases`}),(0,S.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[p.filter(e=>B(e.id)?.status===`converted`).length,` converted · `,p.some(e=>B(e.id)?.status===`written`)?`${p.filter(e=>B(e.id)?.status===`written`).length} written · `:``,p.filter(e=>[`failed`,`blocked`].includes(B(e.id)?.status||``)).length,` failed · `,g(p.length,`test case`)]})]}),(0,S.jsx)(u,{id:`find-a-case`,label:`Find a test case`,value:m,onChange:h,className:`max-w-none flex-none`}),(0,S.jsxs)(`ul`,{className:`m-0 flex min-h-0 flex-1 list-none flex-col gap-1 overflow-y-auto p-0`,children:[z.map(e=>{let t=B(e.id);return(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,"aria-pressed":y===e.id,onClick:()=>b(e.id),className:a(`flex w-full cursor-pointer items-start gap-2 rounded-[8px] border-0 px-2 py-2 text-left text-[13px]`,y===e.id?`bg-accent-soft text-ink`:`bg-transparent text-ink-2 hover:bg-surface-muted`),children:[(0,S.jsx)(`span`,{role:`img`,"aria-label":t?v[t.status].label:`Waiting`,className:a(`mt-2 size-2 flex-none rounded-full`,t?.status===`converted`?`bg-pass`:t?.status===`failed`?`bg-fail`:t?.status===`blocked`?`bg-warn`:`bg-line`)}),(0,S.jsxs)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:[e.name,(0,S.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[g(e.steps,`step`),` · `,g(e.asserts,`check`),t?.fidelity?` · ${t.fidelity.matched}/${t.fidelity.required} in the test`:``]})]})]})},e.id)}),!z.length&&(0,S.jsx)(`li`,{className:`px-2 py-4 text-[13px] text-muted`,children:`No test case matches.`})]}),I.length>w&&(0,S.jsx)(d,{page:L,size:w,total:I.length,onPage:R,label:`Test case pages`})]}),(0,S.jsxs)(`section`,{"aria-label":`Tosca steps`,className:`flex min-h-[360px] min-w-0 flex-col gap-4 overflow-hidden`,children:[N&&(0,S.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:N}),(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-[12px] card border`,children:[(0,S.jsxs)(`header`,{className:`flex min-h-10 flex-wrap items-center gap-2 border-b border-line-soft px-4 py-2`,children:[(0,S.jsx)(`span`,{className:`text-[13px] font-semibold tracking-[0.04em] text-muted uppercase`,children:`Tosca steps`}),(0,S.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:T?.name}),T&&t.cases.find(e=>e.id===y)&&(0,S.jsx)(`span`,{className:`text-[13px] text-muted`,children:_[t.cases.find(e=>e.id===y).route]||``})]}),(0,S.jsx)(`div`,{className:`pane-swap min-h-0 flex-1 overflow-y-auto px-2 py-2`,children:T?(0,S.jsx)(E,{nodes:T.body,status:F,pick:j,onPick:e=>M(e.id||``)}):N?(0,S.jsx)(`p`,{className:`m-0 px-2 text-sm text-muted`,children:`Nothing to show.`}):(0,S.jsx)(`p`,{role:`status`,className:`m-0 px-2 text-sm text-muted`,children:`Loading…`})},T?.case||``),T&&(T.env.length>0||T.warnings.length>0)&&(0,S.jsxs)(`footer`,{className:`flex flex-col gap-1 border-t border-line-soft px-4 py-2 text-[13px] text-ink-2`,children:[T.env.length>0&&(0,S.jsxs)(`span`,{children:[`Environment variables: `,T.env.map(e=>`${e.name}${e.secret?` (secret)`:``}`).join(`, `),`.`]}),T.warnings.slice(0,3).map(e=>(0,S.jsx)(`span`,{className:`text-warn`,children:e},e))]})]}),T&&(0,S.jsx)(k,{view:T,node:D(T.body,j)})]}),T?(0,S.jsx)(O,{view:T,pick:j,engine:t.units.find(e=>e.kind===`test`&&e.case===T.case)?.engine},T.case):(0,S.jsx)(`p`,{className:`m-0 flex min-h-[260px] items-center justify-center rounded-[12px] card border px-4 text-center text-sm text-muted`,children:N?`Nothing to show.`:`Loading…`})]});return s?V:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`flex justify-end`,children:(0,S.jsxs)(`a`,{href:C(e,y),target:`_blank`,rel:`noopener noreferrer`,"data-tip":`Tosca steps beside the converted test, in a tab of their own`,className:l({variant:`ghost`,size:`sm`}),children:[(0,S.jsx)(n,{"aria-hidden":`true`}),`Open in a new tab`]})}),V]})}export{C as n,A as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Hr as t,Ht as n,O as r,Rr as i,U as a,lt as o,n as s,on as c,r as l,sn as u,u as d,ut as f,wr as p}from"./route-Dg53WdFu.js";import{t as m}from"./jsx-runtime-LKYXHABd.js";import{A as h,It as g,W as _,t as v}from"./input-D7iHeNXz.js";import{d as y,l as b,o as x,t as S}from"./filters-Culzq1j1.js";import{L as C}from"./palette-lUno7fso.js";import{Dn as w,Ft as T,H as E,K as D,Lt as O,Pt as k,U as A,g as j,j as M,u as N,zt as P}from"./index-Cq2sihjc.js";var F=e(t(),1),I=m(),L=[{id:`azure_devops`,label:`Azure DevOps`},{id:`jira`,label:`Jira`},{id:`testrail`,label:`TestRail`},{id:`zephyr`,label:`Zephyr Scale`},{id:`qtest`,label:`qTest`}],R=e=>L.some(t=>t.id===e),z=e=>e&&M(e)===`web`?e:void 0,B=(e,t)=>`${e} ${t}${e===1?``:`s`}`,V=e=>`${e.kind}:${e.id}`;function H(e){return e.found===`reuse`||e.kind===`link`?`Link`:e.found===`extends`||e.kind===`extend`?`Add ${B((e.insert??[]).reduce((e,t)=>e+t.steps.length,0),`step`)}`:`Update steps`}function U(e,t){let n=`Story ${t} asks for it: ${e.wrote}`,r=e.link?{link:!0}:{};return e.kind===`link`?{kind:`link`,id:e.id}:e.kind===`extend`?{kind:`extend`,id:e.id,insert:e.insert??[],reason:n,...r}:{kind:`update`,id:e.id,steps:e.steps??[],reason:n,...r}}function W(){let[e,t]=(0,F.useState)(L.map(e=>e.id)),[n,r]=(0,F.useState)(``);return(0,F.useEffect)(()=>{_.settings().then(e=>{let n=e.config.sources??{},r=L.map(e=>e.id).filter(e=>n[e]&&typeof n[e]==`object`);r.length&&t(r)},e=>r(`The settings could not be read, so every system is offered: ${e.message}`))},[]),{systems:L.filter(t=>e.includes(t.id)),error:n}}function G({id:e,icon:t,title:n,children:r}){return(0,I.jsxs)(`section`,{"aria-labelledby":e,className:`flex min-w-0 flex-col gap-4`,children:[(0,I.jsxs)(`h2`,{id:e,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,I.jsx)(b,{icon:t,size:18,className:`text-accent-fg`}),n]}),r]})}function K({view:e,onApplied:t,onError:s}){let[l,d]=(0,F.useState)([]),[m,_]=(0,F.useState)(null),[v,b]=(0,F.useState)(!1),[x,S]=(0,F.useState)(null),C=e.story.id,w=e.proposals.filter(e=>l.includes(V(e))),E=async()=>{let t=w.map(e=>U(e,C));b(!0);try{let n=await g.preview(e.system,C,t);_({lines:n.lines,changes:t}),s(``)}catch(e){s(e.message)}finally{b(!1)}},D=async()=>{if(m){b(!0);try{let n=await g.apply(e.system,C,m.changes);S({applied:n.applied,failed:n.failed}),_(null),d([]),s(``),t()}catch(e){s(e.message)}finally{b(!1)}}},A=z(e.story.url);return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,I.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-lg font-semibold [overflow-wrap:anywhere]`,children:[A?(0,I.jsxs)(`a`,{href:A,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[C,(0,I.jsx)(o,{size:14,"aria-hidden":`true`})]}):(0,I.jsx)(`span`,{children:C}),e.story.title&&(0,I.jsx)(`span`,{className:`font-normal text-ink-2`,children:e.story.title})]}),e.changed&&(0,I.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,"data-tip":new Date(e.changed.when).toLocaleString(),children:[`The story's `,e.changed.field,` changed `,j(e.changed.when),`.`]})]}),(0,I.jsx)(G,{id:`cases-h`,icon:c,title:`Linked cases`,children:(0,I.jsx)(k,{label:`Linked cases`,empty:`No test case is linked to this story.`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Case`}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Title`}),(0,I.jsx)(`th`,{scope:`col`,className:h(O,`text-right`),children:`Steps`}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`State`})]}),children:e.cases.map(e=>{let t=z(e.url);return(0,I.jsxs)(`tr`,{className:P,children:[(0,I.jsx)(`td`,{className:h(T,`whitespace-nowrap`),children:t?(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[e.id,(0,I.jsx)(o,{size:12,"aria-hidden":`true`})]}):e.id}),(0,I.jsx)(`td`,{className:h(T,`[overflow-wrap:anywhere]`),children:e.title}),(0,I.jsx)(`td`,{className:h(T,`text-right tabular-nums`),children:e.steps}),(0,I.jsx)(`td`,{className:h(T,e.stale?`text-warn`:`text-muted`),children:e.stale?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(p,{size:13,"aria-hidden":`true`,className:`flex-none`}),`older than the story's last change`]}):e.changed?(0,I.jsxs)(`span`,{"data-tip":new Date(e.changed).toLocaleString(),children:[`changed `,j(e.changed)]}):`–`})]},e.id)})})}),(0,I.jsx)(G,{id:`criteria-h`,icon:a,title:`Acceptance criteria`,children:(0,I.jsx)(k,{label:`Acceptance criteria`,empty:`No acceptance criteria were read for this story.`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Criterion`}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Cases`})]}),children:e.criteria.map((e,t)=>(0,I.jsxs)(`tr`,{className:P,children:[(0,I.jsx)(`td`,{className:h(T,`[overflow-wrap:anywhere]`),children:e.text}),(0,I.jsx)(`td`,{className:h(T,e.cases.length?`text-ink-2`:`text-warn`),children:e.cases.length?e.cases.join(`, `):`no case`})]},t))})}),(0,I.jsxs)(G,{id:`proposals-h`,icon:u,title:`Proposed changes`,children:[(0,I.jsx)(k,{label:`Proposed changes`,empty:`No change is waiting. save_test_cases in a chat proposes them.`,tools:(0,I.jsxs)(y,{size:`sm`,variant:`primary`,disabled:v||!w.length||!!m,"data-tip":`Review ${B(w.length,`change`)}`,onClick:()=>void E(),children:[(0,I.jsx)(f,{"aria-hidden":`true`}),`Review (`,w.length,`)`]}),head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`th`,{scope:`col`,className:h(O,`w-10`),children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Change`}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Existing case`}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`The agent wrote`})]}),children:e.proposals.map(e=>{let t=V(e);return(0,I.jsxs)(`tr`,{className:P,children:[(0,I.jsx)(`td`,{className:T,children:(0,I.jsx)(N,{"aria-label":`${H(e)}: ${e.id} ${e.title}`,checked:l.includes(t),disabled:v||!!m,onCheckedChange:e=>d(e?[...l,t]:l.filter(e=>e!==t))})}),(0,I.jsxs)(`td`,{className:h(T,`whitespace-nowrap font-medium`),children:[H(e),e.link&&e.kind!==`link`&&(0,I.jsx)(`span`,{className:`block text-[13px] font-normal text-muted`,children:`and link it`})]}),(0,I.jsxs)(`td`,{className:h(T,`[overflow-wrap:anywhere]`),children:[(0,I.jsx)(`span`,{className:`font-mono text-[13px] text-ink-2`,children:e.id}),` `,e.title]}),(0,I.jsx)(`td`,{className:h(T,`text-ink-2 [overflow-wrap:anywhere]`),children:e.wrote})]},t)})}),m&&(0,I.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Apply the changes`,className:`flex flex-col gap-2 rounded-[10px] border border-accent-line bg-accent-soft p-4 text-[13px]`,children:[(0,I.jsxs)(`span`,{className:`font-medium`,children:[`Apply `,B(m.changes.length,`change`),` to `,L.find(t=>t.id===e.system)?.label,`?`]}),(0,I.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-6 text-ink-2`,children:m.lines.map((e,t)=>(0,I.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsxs)(y,{size:`sm`,variant:`primary`,disabled:v,onClick:()=>void D(),children:[(0,I.jsx)(r,{"aria-hidden":`true`}),`Apply`]}),(0,I.jsxs)(y,{size:`sm`,disabled:v,onClick:()=>_(null),children:[(0,I.jsx)(i,{"aria-hidden":`true`}),`Cancel`]})]})]}),x&&x.applied.length>0&&(0,I.jsxs)(`p`,{role:`status`,className:`m-0 text-[13px] text-pass`,children:[`Applied: `,x.applied.join(`, `)]}),x&&x.failed.length>0&&(0,I.jsxs)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Not applied: `,x.failed.map(e=>`${e.id||`a change`}: ${e.error}`).join(`; `)]})]}),(0,I.jsx)(G,{id:`changes-h`,icon:n,title:`Recent changes`,children:e.changes.length?(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-ink-2`,children:e.changes.map((e,t)=>(0,I.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}):(0,I.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`ForgeQE has not changed this story's cases.`})}),e.notes.map((e,t)=>(0,I.jsx)(`p`,{className:`m-0 text-[13px] text-muted [overflow-wrap:anywhere]`,children:e},t))]})}function q({sub:e}){let{systems:t,error:n}=W(),r=e?e.indexOf(`/`):-1,i=r>0?e.slice(0,r):e,a=R(i)?i:void 0,o=a&&r>0?s(e.slice(r+1)):``,[u,f]=(0,F.useState)(a??`azure_devops`),[p,m]=(0,F.useState)(o),[_,b]=(0,F.useState)(null),[T,O]=(0,F.useState)(``),[k,j]=(0,F.useState)(!1);(0,F.useEffect)(()=>{a&&f(a),m(o)},[a,o]),(0,F.useEffect)(()=>{!a&&t.length&&!t.some(e=>e.id===u)&&f(t[0].id)},[t,u,a]);let M=(0,F.useCallback)(()=>{!a||!o?b(null):(j(!0),g.view(a,o).then(e=>{b(e),O(``),j(!1)},e=>{O(e.message),j(!1)}))},[a,o]);return(0,F.useEffect)(()=>b(null),[a,o]),(0,F.useEffect)(M,[M]),(0,I.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,I.jsx)(D,{}),(0,I.jsxs)(`main`,{className:h(A,`@container flex-auto gap-4`),children:[(0,I.jsx)(E,{}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,I.jsx)(w,{pixel:C[`test-cases`],size:`lg`}),(0,I.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test cases`})]}),(0,I.jsxs)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:[`A story's test cases in your test management system: which are older than the story's last change, which acceptance criteria no case covers, and the changes save_test_cases proposed. Tick the ones to make; nothing is written until you review and apply them. The tests that run them are on `,(0,I.jsx)(`a`,{href:l(`regression`),children:`Regression`}),`; their results on `,(0,I.jsx)(`a`,{href:l(`runs`),children:`Runs`}),`.`]}),(0,I.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=p.trim();if(!t)return;let n=l(`test-cases`,u,encodeURIComponent(t));location.hash===n?M():location.hash=n},className:`flex flex-col gap-4`,children:[(0,I.jsx)(`div`,{role:`group`,"aria-label":`System`,className:`flex flex-wrap gap-2`,children:(0,I.jsx)(S,{items:t,value:u,onChange:f})}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4`,children:[(0,I.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_320px] flex-col gap-1 text-[13px] font-medium`,children:[`Story`,(0,I.jsx)(v,{value:p,maxLength:120,spellCheck:!1,placeholder:u===`azure_devops`?`1234`:u===`qtest`?`5678`:u===`testrail`?`R12`:`SHOP-12`,onChange:e=>m(e.target.value)})]}),(0,I.jsxs)(y,{type:`submit`,variant:`primary`,disabled:!p.trim()||k,"data-tip":`Open the story's test cases`,children:[(0,I.jsx)(d,{"aria-hidden":`true`}),`Open`]})]})]}),[n,T].filter(Boolean).map(e=>(0,I.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e},e)),k&&(0,I.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),_&&(0,I.jsx)(K,{view:_,onApplied:M,onError:O},`${_.system}:${_.story.id}`),!o&&!_&&(0,I.jsx)(x,{icon:c,title:`No story opened yet`,children:`Pick the system and type a story's id to see its linked test cases, its acceptance criteria and which cases trace to them. When save_test_cases runs in a chat for a story, the changes it proposes to existing cases show here to apply.`})]})]})}export{q as TestCases};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Hr as t,Ht as n,O as r,Rr as i,U as a,lt as o,n as s,on as c,r as l,sn as u,u as d,ut as f,wr as p}from"./route-Dg53WdFu.js";import{t as m}from"./jsx-runtime-LKYXHABd.js";import{A as h,It as g,W as _,t as v}from"./input-D7iHeNXz.js";import{d as y,l as b,o as x,t as S}from"./filters-Culzq1j1.js";import{L as C}from"./palette-lUno7fso.js";import{Dn as w,Ft as T,H as E,K as D,Lt as O,Pt as k,U as A,g as j,j as M,u as N,zt as P}from"./index-CljX5dI4.js";var F=e(t(),1),I=m(),L=[{id:`azure_devops`,label:`Azure DevOps`},{id:`jira`,label:`Jira`},{id:`testrail`,label:`TestRail`},{id:`zephyr`,label:`Zephyr Scale`},{id:`qtest`,label:`qTest`}],R=e=>L.some(t=>t.id===e),z=e=>e&&M(e)===`web`?e:void 0,B=(e,t)=>`${e} ${t}${e===1?``:`s`}`,V=e=>`${e.kind}:${e.id}`;function H(e){return e.found===`reuse`||e.kind===`link`?`Link`:e.found===`extends`||e.kind===`extend`?`Add ${B((e.insert??[]).reduce((e,t)=>e+t.steps.length,0),`step`)}`:`Update steps`}function U(e,t){let n=`Story ${t} asks for it: ${e.wrote}`,r=e.link?{link:!0}:{};return e.kind===`link`?{kind:`link`,id:e.id}:e.kind===`extend`?{kind:`extend`,id:e.id,insert:e.insert??[],reason:n,...r}:{kind:`update`,id:e.id,steps:e.steps??[],reason:n,...r}}function W(){let[e,t]=(0,F.useState)(L.map(e=>e.id)),[n,r]=(0,F.useState)(``);return(0,F.useEffect)(()=>{_.settings().then(e=>{let n=e.config.sources??{},r=L.map(e=>e.id).filter(e=>n[e]&&typeof n[e]==`object`);r.length&&t(r)},e=>r(`The settings could not be read, so every system is offered: ${e.message}`))},[]),{systems:L.filter(t=>e.includes(t.id)),error:n}}function G({id:e,icon:t,title:n,children:r}){return(0,I.jsxs)(`section`,{"aria-labelledby":e,className:`flex min-w-0 flex-col gap-4`,children:[(0,I.jsxs)(`h2`,{id:e,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,I.jsx)(b,{icon:t,size:18,className:`text-accent-fg`}),n]}),r]})}function K({view:e,onApplied:t,onError:s}){let[l,d]=(0,F.useState)([]),[m,_]=(0,F.useState)(null),[v,b]=(0,F.useState)(!1),[x,S]=(0,F.useState)(null),C=e.story.id,w=e.proposals.filter(e=>l.includes(V(e))),E=async()=>{let t=w.map(e=>U(e,C));b(!0);try{let n=await g.preview(e.system,C,t);_({lines:n.lines,changes:t}),s(``)}catch(e){s(e.message)}finally{b(!1)}},D=async()=>{if(m){b(!0);try{let n=await g.apply(e.system,C,m.changes);S({applied:n.applied,failed:n.failed}),_(null),d([]),s(``),t()}catch(e){s(e.message)}finally{b(!1)}}},A=z(e.story.url);return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,I.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-lg font-semibold [overflow-wrap:anywhere]`,children:[A?(0,I.jsxs)(`a`,{href:A,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[C,(0,I.jsx)(o,{size:14,"aria-hidden":`true`})]}):(0,I.jsx)(`span`,{children:C}),e.story.title&&(0,I.jsx)(`span`,{className:`font-normal text-ink-2`,children:e.story.title})]}),e.changed&&(0,I.jsxs)(`p`,{className:`m-0 text-[13px] text-muted`,"data-tip":new Date(e.changed.when).toLocaleString(),children:[`The story's `,e.changed.field,` changed `,j(e.changed.when),`.`]})]}),(0,I.jsx)(G,{id:`cases-h`,icon:c,title:`Linked cases`,children:(0,I.jsx)(k,{label:`Linked cases`,empty:`No test case is linked to this story.`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Case`}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Title`}),(0,I.jsx)(`th`,{scope:`col`,className:h(O,`text-right`),children:`Steps`}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`State`})]}),children:e.cases.map(e=>{let t=z(e.url);return(0,I.jsxs)(`tr`,{className:P,children:[(0,I.jsx)(`td`,{className:h(T,`whitespace-nowrap`),children:t?(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1`,children:[e.id,(0,I.jsx)(o,{size:12,"aria-hidden":`true`})]}):e.id}),(0,I.jsx)(`td`,{className:h(T,`[overflow-wrap:anywhere]`),children:e.title}),(0,I.jsx)(`td`,{className:h(T,`text-right tabular-nums`),children:e.steps}),(0,I.jsx)(`td`,{className:h(T,e.stale?`text-warn`:`text-muted`),children:e.stale?(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(p,{size:13,"aria-hidden":`true`,className:`flex-none`}),`older than the story's last change`]}):e.changed?(0,I.jsxs)(`span`,{"data-tip":new Date(e.changed).toLocaleString(),children:[`changed `,j(e.changed)]}):`–`})]},e.id)})})}),(0,I.jsx)(G,{id:`criteria-h`,icon:a,title:`Acceptance criteria`,children:(0,I.jsx)(k,{label:`Acceptance criteria`,empty:`No acceptance criteria were read for this story.`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Criterion`}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Cases`})]}),children:e.criteria.map((e,t)=>(0,I.jsxs)(`tr`,{className:P,children:[(0,I.jsx)(`td`,{className:h(T,`[overflow-wrap:anywhere]`),children:e.text}),(0,I.jsx)(`td`,{className:h(T,e.cases.length?`text-ink-2`:`text-warn`),children:e.cases.length?e.cases.join(`, `):`no case`})]},t))})}),(0,I.jsxs)(G,{id:`proposals-h`,icon:u,title:`Proposed changes`,children:[(0,I.jsx)(k,{label:`Proposed changes`,empty:`No change is waiting. save_test_cases in a chat proposes them.`,tools:(0,I.jsxs)(y,{size:`sm`,variant:`primary`,disabled:v||!w.length||!!m,"data-tip":`Review ${B(w.length,`change`)}`,onClick:()=>void E(),children:[(0,I.jsx)(f,{"aria-hidden":`true`}),`Review (`,w.length,`)`]}),head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`th`,{scope:`col`,className:h(O,`w-10`),children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Pick`})}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Change`}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`Existing case`}),(0,I.jsx)(`th`,{scope:`col`,className:O,children:`The agent wrote`})]}),children:e.proposals.map(e=>{let t=V(e);return(0,I.jsxs)(`tr`,{className:P,children:[(0,I.jsx)(`td`,{className:T,children:(0,I.jsx)(N,{"aria-label":`${H(e)}: ${e.id} ${e.title}`,checked:l.includes(t),disabled:v||!!m,onCheckedChange:e=>d(e?[...l,t]:l.filter(e=>e!==t))})}),(0,I.jsxs)(`td`,{className:h(T,`whitespace-nowrap font-medium`),children:[H(e),e.link&&e.kind!==`link`&&(0,I.jsx)(`span`,{className:`block text-[13px] font-normal text-muted`,children:`and link it`})]}),(0,I.jsxs)(`td`,{className:h(T,`[overflow-wrap:anywhere]`),children:[(0,I.jsx)(`span`,{className:`font-mono text-[13px] text-ink-2`,children:e.id}),` `,e.title]}),(0,I.jsx)(`td`,{className:h(T,`text-ink-2 [overflow-wrap:anywhere]`),children:e.wrote})]},t)})}),m&&(0,I.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Apply the changes`,className:`flex flex-col gap-2 rounded-[10px] border border-accent-line bg-accent-soft p-4 text-[13px]`,children:[(0,I.jsxs)(`span`,{className:`font-medium`,children:[`Apply `,B(m.changes.length,`change`),` to `,L.find(t=>t.id===e.system)?.label,`?`]}),(0,I.jsx)(`ul`,{className:`m-0 flex flex-col gap-1 pl-6 text-ink-2`,children:m.lines.map((e,t)=>(0,I.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsxs)(y,{size:`sm`,variant:`primary`,disabled:v,onClick:()=>void D(),children:[(0,I.jsx)(r,{"aria-hidden":`true`}),`Apply`]}),(0,I.jsxs)(y,{size:`sm`,disabled:v,onClick:()=>_(null),children:[(0,I.jsx)(i,{"aria-hidden":`true`}),`Cancel`]})]})]}),x&&x.applied.length>0&&(0,I.jsxs)(`p`,{role:`status`,className:`m-0 text-[13px] text-pass`,children:[`Applied: `,x.applied.join(`, `)]}),x&&x.failed.length>0&&(0,I.jsxs)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:[`Not applied: `,x.failed.map(e=>`${e.id||`a change`}: ${e.error}`).join(`; `)]})]}),(0,I.jsx)(G,{id:`changes-h`,icon:n,title:`Recent changes`,children:e.changes.length?(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px] text-ink-2`,children:e.changes.map((e,t)=>(0,I.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},t))}):(0,I.jsx)(`p`,{className:`m-0 text-[13px] text-muted`,children:`ForgeQE has not changed this story's cases.`})}),e.notes.map((e,t)=>(0,I.jsx)(`p`,{className:`m-0 text-[13px] text-muted [overflow-wrap:anywhere]`,children:e},t))]})}function q({sub:e}){let{systems:t,error:n}=W(),r=e?e.indexOf(`/`):-1,i=r>0?e.slice(0,r):e,a=R(i)?i:void 0,o=a&&r>0?s(e.slice(r+1)):``,[u,f]=(0,F.useState)(a??`azure_devops`),[p,m]=(0,F.useState)(o),[_,b]=(0,F.useState)(null),[T,O]=(0,F.useState)(``),[k,j]=(0,F.useState)(!1);(0,F.useEffect)(()=>{a&&f(a),m(o)},[a,o]),(0,F.useEffect)(()=>{!a&&t.length&&!t.some(e=>e.id===u)&&f(t[0].id)},[t,u,a]);let M=(0,F.useCallback)(()=>{!a||!o?b(null):(j(!0),g.view(a,o).then(e=>{b(e),O(``),j(!1)},e=>{O(e.message),j(!1)}))},[a,o]);return(0,F.useEffect)(()=>b(null),[a,o]),(0,F.useEffect)(M,[M]),(0,I.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,I.jsx)(D,{}),(0,I.jsxs)(`main`,{className:h(A,`@container flex-auto gap-4`),children:[(0,I.jsx)(E,{}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,I.jsx)(w,{pixel:C[`test-cases`],size:`lg`}),(0,I.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test cases`})]}),(0,I.jsxs)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:[`A story's test cases in your test management system: which are older than the story's last change, which acceptance criteria no case covers, and the changes save_test_cases proposed. Tick the ones to make; nothing is written until you review and apply them. The tests that run them are on `,(0,I.jsx)(`a`,{href:l(`regression`),children:`Regression`}),`; their results on `,(0,I.jsx)(`a`,{href:l(`runs`),children:`Runs`}),`.`]}),(0,I.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let t=p.trim();if(!t)return;let n=l(`test-cases`,u,encodeURIComponent(t));location.hash===n?M():location.hash=n},className:`flex flex-col gap-4`,children:[(0,I.jsx)(`div`,{role:`group`,"aria-label":`System`,className:`flex flex-wrap gap-2`,children:(0,I.jsx)(S,{items:t,value:u,onChange:f})}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4`,children:[(0,I.jsxs)(`label`,{className:`flex min-w-0 flex-[0_1_320px] flex-col gap-1 text-[13px] font-medium`,children:[`Story`,(0,I.jsx)(v,{value:p,maxLength:120,spellCheck:!1,placeholder:u===`azure_devops`?`1234`:u===`qtest`?`5678`:u===`testrail`?`R12`:`SHOP-12`,onChange:e=>m(e.target.value)})]}),(0,I.jsxs)(y,{type:`submit`,variant:`primary`,disabled:!p.trim()||k,"data-tip":`Open the story's test cases`,children:[(0,I.jsx)(d,{"aria-hidden":`true`}),`Open`]})]})]}),[n,T].filter(Boolean).map(e=>(0,I.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:e},e)),k&&(0,I.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),_&&(0,I.jsx)(K,{view:_,onApplied:M,onError:O},`${_.system}:${_.story.id}`),!o&&!_&&(0,I.jsx)(x,{icon:c,title:`No story opened yet`,children:`Pick the system and type a story's id to see its linked test cases, its acceptance criteria and which cases trace to them. When save_test_cases runs in a chat for a story, the changes it proposes to existing cases show here to apply.`})]})]})}export{q as TestCases};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Bn as n,Hr as r,M as i,O as a,Rr as o,Tt as s,gn as c,or as l,ot as u,r as d,rt as f,ut as p,xr as m}from"./route-Dg53WdFu.js";import{t as h}from"./jsx-runtime-LKYXHABd.js";import{A as g,Z as _,j as v,n as y,t as b,tt as x}from"./input-D7iHeNXz.js";import{a as S,d as C,f as w,l as T,o as E,t as D}from"./filters-Culzq1j1.js";import{L as O}from"./palette-lUno7fso.js";import{Bt as k,Dn as A,Ft as j,It as M,K as N,Lt as P,Pt as ee,Rt as F,U as I,V as L,Wt as R,g as z}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{A as t,Bn as n,Hr as r,M as i,O as a,Rr as o,Tt as s,gn as c,or as l,ot as u,r as d,rt as f,ut as p,xr as m}from"./route-Dg53WdFu.js";import{t as h}from"./jsx-runtime-LKYXHABd.js";import{A as g,Z as _,j as v,n as y,t as b,tt as x}from"./input-D7iHeNXz.js";import{a as S,d as C,f as w,l as T,o as E,t as D}from"./filters-Culzq1j1.js";import{L as O}from"./palette-lUno7fso.js";import{Bt as k,Dn as A,Ft as j,It as M,K as N,Lt as P,Pt as ee,Rt as F,U as I,V as L,Wt as R,g as z}from"./index-CljX5dI4.js";import{a as te,c as B,f as ne,i as V,n as H,o as U,r as W,s as G,t as K,u as q}from"./dataParts-D56_9p6T.js";var J=e(r(),1),Y=h(),X=[`requests`,`kept`,`specs`,`batches`],Z={fetch:`kept`,request:`requests`,gen:`specs`,files:`specs`,insert:`specs`,batches:`batches`,clean:`batches`},Q=e=>Object.values(e.row_counts||{}).reduce((e,t)=>e+t,0);function re({e,kept:t,busy:r,act:i}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 px-1 py-2`,children:[(0,Y.jsxs)(`dl`,{className:`m-0 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-[13px]`,children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:`Asked for`}),(0,Y.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:e.need}),(0,Y.jsx)(`dt`,{className:`text-muted`,children:`When`}),(0,Y.jsxs)(`dd`,{className:`m-0`,children:[new Date(e.at).toLocaleString(),e.ms===void 0?``:` · answered in ${(e.ms/1e3).toFixed(1)} s`]}),(0,Y.jsx)(`dt`,{className:`text-muted`,children:`How`}),(0,Y.jsxs)(`dd`,{className:`m-0`,children:[e.source===`fetch`?`A kept request fetched again, with no model`:`Asked Miner for ${e.asked===`existing`?`existing rows`:e.asked===`new`?`new rows`:`either`}`,e.name?(0,Y.jsxs)(Y.Fragment,{children:[` · `,(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.name})]}):null]}),e.why&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`dt`,{className:`text-muted`,children:`The answer`}),(0,Y.jsx)(`dd`,{className:`m-0`,children:e.why})]})]}),e.error&&(0,Y.jsx)(B,{text:e.error}),Object.entries(e.sample||{}).map(([t,n])=>(0,Y.jsx)(q,{title:t===`result`?`Rows found`:t,rows:n,total:e.row_counts?.[t]??n.length},t)),e.sql&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`The query`}),(0,Y.jsx)(H,{label:`SQL`,children:e.sql})]}),e.script_preview?.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:`INSERT script`}),(0,Y.jsx)(H,{label:`INSERT script`,children:e.script_preview.join(`
|
|
2
2
|
`)})]}):null,t&&e.name&&(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(C,{size:`sm`,disabled:r,onClick:()=>i(`fetch`,{name:e.name}),"data-tip":`Fetch again`,children:[(0,Y.jsx)(n,{"aria-hidden":`true`}),`Refresh`]})})]})}function $({view:e,log:n,busy:r,act:a}){let[o,l]=(0,J.useState)(`all`),[u,f]=(0,J.useState)(``),[p,m]=(0,J.useState)(``),[h,_]=(0,J.useState)(``),v=n??[],b=(0,J.useMemo)(()=>[...new Set(v.map(e=>e.requester))].sort(),[n]),x=(0,J.useMemo)(()=>[...new Set(v.map(e=>e.database).filter(Boolean))].sort(),[n]),C=v.filter(e=>!e.ok).length,T=v.filter(e=>(o===`all`||o===`ok`===e.ok)&&(!u||e.requester===u)&&(!p||e.database===p)),O=new Set(e.requests.map(e=>e.name));return n===null?(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading the requests…`}):v.length?(0,Y.jsx)(ee,{label:`Requests`,resetKey:`${o}|${u}|${p}`,minWidth:760,fixed:!0,placeholder:`Find a request`,tools:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(D,{value:o,onChange:l,items:[{id:`all`,label:`All`,n:v.length},{id:`ok`,label:`Answered`,n:v.length-C},{id:`failed`,label:`Failed`,n:C,alert:!0}]}),b.length>1&&(0,Y.jsxs)(y,{size:`sm`,"aria-label":`Who asked`,value:u,onChange:e=>f(e.target.value),className:`w-[180px]`,children:[(0,Y.jsx)(`option`,{value:``,children:`Anyone`}),b.map(e=>(0,Y.jsx)(`option`,{children:e},e))]}),x.length>1&&(0,Y.jsxs)(y,{size:`sm`,"aria-label":`Database`,value:p,onChange:e=>m(e.target.value),className:`w-[160px]`,children:[(0,Y.jsx)(`option`,{value:``,children:`Any database`}),x.map(e=>(0,Y.jsx)(`option`,{children:e},e))]})]}),head:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`th`,{scope:`col`,className:g(P,`w-9`),children:(0,Y.jsx)(`span`,{className:`sr-only`,children:`Open`})}),(0,Y.jsx)(`th`,{scope:`col`,className:g(P,`w-[110px]`),children:`When`}),(0,Y.jsx)(`th`,{scope:`col`,className:g(P,`w-[150px]`),children:`Who asked`}),(0,Y.jsx)(`th`,{scope:`col`,className:P,children:`What for`}),(0,Y.jsx)(`th`,{scope:`col`,className:g(P,`w-[110px]`),children:`Database`}),(0,Y.jsx)(`th`,{scope:`col`,className:g(P,`w-[140px]`),children:`Answer`}),(0,Y.jsx)(`th`,{scope:`col`,className:g(F,`w-[70px]`),children:`Rows`})]}),empty:`No requests match these filters. Pick All and Anyone to see every request.`,children:T.map(e=>{let n=h===e.id;return(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsxs)(`tr`,{className:g(k,n&&`bg-surface-muted`),onClick:()=>_(n?``:e.id),children:[(0,Y.jsx)(`td`,{className:g(j,`pr-0`),children:(0,Y.jsx)(`button`,{type:`button`,"aria-expanded":n,"aria-label":n?`Close the request`:`Open the request`,onClick:t=>(t.stopPropagation(),_(n?``:e.id)),className:`flex cursor-pointer items-center border-0 bg-transparent p-0 text-muted`,children:n?(0,Y.jsx)(t,{size:16,"aria-hidden":`true`}):(0,Y.jsx)(i,{size:16,"aria-hidden":`true`})})}),(0,Y.jsx)(`td`,{className:g(j,`whitespace-nowrap text-muted`),"data-tip":new Date(e.at).toLocaleString(),children:z(e.at)}),(0,Y.jsx)(`td`,{className:g(j,`truncate`),"data-tip":e.requester,children:e.requester}),(0,Y.jsxs)(`td`,{className:g(j,`truncate`),"data-tip":e.need,children:[e.need,e.source===`fetch`?(0,Y.jsx)(`span`,{className:`text-muted`,children:` · fetched again`}):null]}),(0,Y.jsx)(`td`,{className:g(j,`truncate`),"data-tip":e.database,children:e.database||(0,Y.jsx)(`span`,{className:`text-muted`,children:`—`})}),(0,Y.jsx)(`td`,{className:g(j,`whitespace-nowrap`),children:(0,Y.jsx)(S,{tone:e.ok?`pass`:`fail`,children:e.ok?U[e.kind||``]||`Answered`:`Failed`})}),(0,Y.jsx)(`td`,{className:M,children:e.ok?Q(e):``})]}),n&&(0,Y.jsx)(`tr`,{className:`border-t border-line-soft bg-surface-muted/40`,children:(0,Y.jsx)(`td`,{colSpan:7,className:g(`px-4 py-2`,`max-w-0`),children:(0,Y.jsx)(re,{e,kept:!!e.name&&O.has(e.name),busy:r,act:a})})})]},e.id)})}):(0,Y.jsx)(E,{icon:s,title:`No test data asked for yet`,action:(0,Y.jsxs)(`a`,{href:d(`data`,`ask`,`test-data`),"data-tip":`Ask for test data`,className:g(w({size:`sm`}),`no-underline`),children:[(0,Y.jsx)(c,{"aria-hidden":`true`}),`Ask`]}),children:`The agents ask before a test runs, or you can ask yourself.`})}function ie({view:e,job:t,busy:r,act:i,onNote:a}){let o=t&&!t.running&&t.kind===`fetch`?t:null,s=o?.result;return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:`Each request is kept in test-data/requests with its query or INSERT script. Fetch one again to get the same data with no model: a query reads the rows there now, a spec makes the same rows.`}),o&&(0,Y.jsxs)(`section`,{"aria-label":`Fetched ${o.target}`,className:`flex flex-col gap-4 rounded-[14px] card border p-4`,children:[(0,Y.jsx)(`h2`,{className:`m-0 text-base font-semibold [overflow-wrap:anywhere]`,children:o.target}),s&&!s.ok&&(0,Y.jsx)(B,{text:s.error||`It could not fetch the data.`}),s?.ok&&(0,Y.jsx)(K,{r:s,onNote:a})]}),e.requests.length===0?(0,Y.jsxs)(E,{className:`py-4`,children:[`No kept requests yet. Each request Miner answers is kept here; `,(0,Y.jsx)(`a`,{href:d(`data`,`ask`,`test-data`),children:`ask for test data`}),` to make the first.`]}):(0,Y.jsx)(G,{items:e.requests,text:e=>`${e.need} ${e.name} ${e.database} ${e.requester||``}`,label:`Kept requests`,size:15,children:e=>(0,Y.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-4 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`text-[13px] font-medium [overflow-wrap:anywhere]`,children:e.need}),(0,Y.jsxs)(`span`,{className:`text-[13px] text-muted [overflow-wrap:anywhere]`,children:[(0,Y.jsx)(`span`,{className:`font-mono`,children:e.name}),` · `,e.database,` · `,U[e.kind],e.rows?` · ${v(e.rows,`row`)}`:``,e.created?` · ${z(e.created)}`:``,e.requester?` · asked by ${e.requester}`:``]})]}),(0,Y.jsx)(C,{size:`icon`,variant:`icon`,disabled:r,onClick:()=>i(`fetch`,{name:e.name}),"aria-label":`Fetch ${e.name} again`,"data-tip":`Fetch ${e.name} again`,className:`size-8`,children:(0,Y.jsx)(n,{"aria-hidden":`true`})})]},e.name)})]})}function ae({view:e,job:t,busy:n,act:r,onNote:i}){let[a,l]=(0,J.useState)(e.specs[0]??``),[m,h]=(0,J.useState)(``),[g,v]=(0,J.useState)(``),[x,S]=(0,J.useState)(`csv`),[w,D]=(0,J.useState)(!1),O={spec:a,...m?{db:m}:{},...g?{seed:g}:{}},k=t&&!t.running?t:null,A=k&&[`gen`,`files`,`insert`].includes(k.kind)&&k.target===a?k.result:void 0,j=e.databases.find(e=>e.name===m),M=async()=>{try{let{id:e}=await _.start(`Write a test data spec for this project (a YAML file with tables: under test-data/), from the database's schema. Show me the spec and a preview before you save it.`,{});location.hash=d(`chats`,e)}catch(e){i(e.message)}};return(0,Y.jsxs)(`section`,{"aria-labelledby":`spec-h`,className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Y.jsxs)(`h2`,{id:`spec-h`,className:`m-0 flex flex-1 items-center gap-2 text-lg font-semibold`,children:[(0,Y.jsx)(T,{icon:s,size:18,className:`text-accent-fg`}),`Make test data from a spec`]}),(0,Y.jsxs)(C,{variant:`ghost`,onClick:()=>void M(),"data-tip":`Write a spec in a chat`,children:[(0,Y.jsx)(c,{"aria-hidden":`true`}),`Chat`]})]}),(0,Y.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:`A spec is a YAML file with tables: and what goes in each column. The same spec and seed make the same data again, so a test or a pipeline can rely on it. No model is used.`}),e.specs.length===0?(0,Y.jsx)(E,{className:`py-4`,children:`No specs in this project yet: a YAML file with tables: in test-data/, data/ or specs/. Write one in a chat, from a database's schema.`}):(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-[14px] card border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-4`,children:[(0,Y.jsxs)(`label`,{className:`flex min-w-0 flex-[2_1_260px] flex-col gap-2 text-sm font-medium`,children:[`Spec`,(0,Y.jsx)(y,{value:a,onChange:e=>l(e.target.value),children:e.specs.map(e=>(0,Y.jsx)(`option`,{children:e},e))})]}),(0,Y.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_180px] flex-col gap-2 text-sm font-medium`,children:[`Database`,(0,Y.jsxs)(y,{value:m,onChange:e=>h(e.target.value),children:[(0,Y.jsx)(`option`,{value:``,children:`The spec's own`}),e.databases.map(e=>(0,Y.jsxs)(`option`,{value:e.name,children:[e.name,e.writable?``:` (read only)`]},e.name))]})]}),(0,Y.jsxs)(`label`,{className:`flex w-[120px] flex-col gap-2 text-sm font-medium`,children:[`Seed`,(0,Y.jsx)(b,{value:g,inputMode:`numeric`,placeholder:`Random`,onChange:e=>v(e.target.value.replace(/\D/g,``).slice(0,9))})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsxs)(C,{variant:w?void 0:`primary`,disabled:n||!a,onClick:()=>r(`gen`,O),children:[(0,Y.jsx)(p,{"aria-hidden":`true`}),`Preview`]}),(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Y.jsxs)(C,{disabled:n||!a,onClick:()=>r(`gen`,{...O,mode:`files`,format:x}),"data-tip":`Write files (${x})`,children:[(0,Y.jsx)(u,{"aria-hidden":`true`}),`Export`]}),(0,Y.jsx)(y,{"aria-label":`File format`,value:x,onChange:e=>S(e.target.value),className:`w-[88px]`,children:[`csv`,`json`,`sql`].map(e=>(0,Y.jsx)(`option`,{children:e},e))})]}),(0,Y.jsxs)(C,{disabled:n||!a||!j?.writable,"data-tip":j?.writable?`Insert into ${j.name}`:`Pick a writable database to insert into`,onClick:()=>D(!0),children:[(0,Y.jsx)(f,{"aria-hidden":`true`}),`Insert`]})]}),w&&j&&(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Insert test data`,className:`flex flex-col gap-4 rounded-[12px] border border-warn bg-warn-soft p-4`,children:[(0,Y.jsxs)(`span`,{className:`font-medium`,children:[`Insert the rows of `,a,` into `,j.name,`?`]}),(0,Y.jsx)(`span`,{className:`text-sm text-ink-2`,children:`They go in as one batch, which you can remove again under Batches. Only on a test database.`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(C,{variant:`primary`,onClick:()=>{D(!1),r(`gen`,{...O,mode:`insert`,confirmed:!0})},children:[(0,Y.jsx)(f,{"aria-hidden":`true`}),`Insert`]}),(0,Y.jsxs)(C,{onClick:()=>D(!1),"data-tip":`Don't insert`,children:[(0,Y.jsx)(o,{"aria-hidden":`true`}),`Cancel`]})]})]}),A&&!A.ok&&(0,Y.jsx)(B,{text:A.error||`It did not make the data.`}),A?.ok&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[A.batch&&(0,Y.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-4 py-2 text-sm text-pass`,children:[`Inserted as batch `,(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:A.batch}),`.`]}),A.files?.length?(0,Y.jsxs)(`p`,{className:`m-0 flex flex-wrap items-center gap-2 text-sm`,children:[`Wrote`,A.files.map(e=>(0,Y.jsx)(W,{file:e,onNote:i},e))]}):null,(0,Y.jsx)(V,{r:A})]})]})]})}function oe({view:e,job:t,busy:n,act:r}){let i=e.databases.filter(e=>e.writable),[o,s]=(0,J.useState)(i[0]?.name??``),[c,u]=(0,J.useState)(``),d=t&&!t.running?t:null,f=d?.kind===`batches`?(Array.isArray(d.result)?d.result.flatMap(e=>e.batches||[]):d.result?.batches)??[]:null;return(0,Y.jsxs)(`section`,{"aria-labelledby":`batch-h`,className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`h2`,{id:`batch-h`,className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[(0,Y.jsx)(T,{icon:l,size:18,className:`text-accent-fg`}),`Inserted batches`]}),(0,Y.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:`Rows inserted from a spec go in as a batch. Remove a batch to take exactly those rows out again, children first.`}),i.length===0?(0,Y.jsx)(E,{className:`py-4`,children:`No writable database: test data is inserted only into one marked writable in Settings, Databases.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(y,{"aria-label":`Database`,value:o,onChange:e=>s(e.target.value),className:`w-[220px]`,children:i.map(e=>(0,Y.jsx)(`option`,{children:e.name},e.name))}),(0,Y.jsxs)(C,{disabled:n||!o,onClick:()=>r(`batches`,{db:o}),"data-tip":`List batches`,children:[(0,Y.jsx)(p,{"aria-hidden":`true`}),`Show`]})]}),f&&f.length===0&&(0,Y.jsxs)(`p`,{className:`m-0 text-sm text-muted`,children:[`No batches in `,d?.target,`.`]}),f&&f.length>0&&(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:f.map(e=>(0,Y.jsxs)(`li`,{className:`flex min-h-[52px] flex-wrap items-center gap-4 border-t border-line-soft py-2 text-sm first:border-t-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-[1_1_240px] flex-col gap-1`,children:[(0,Y.jsx)(`span`,{className:`font-mono text-[13px]`,children:e.batch}),(0,Y.jsxs)(`span`,{className:`text-[13px] text-muted`,children:[(0,Y.jsx)(`span`,{"data-tip":new Date(e.created).toLocaleString(),children:z(e.created)}),e.spec?` · ${e.spec}`:``,` ·`,` `,Object.entries(e.rows).map(([e,t])=>`${e} ${t}`).join(`, `)]})]}),c===e.batch?(0,Y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`span`,{className:`text-[13px] text-warn`,children:[`Remove its rows from `,d?.target,`?`]}),(0,Y.jsxs)(C,{variant:`danger`,size:`sm`,onClick:()=>{u(``),r(`clean`,{db:d?.target,batch:e.batch,confirmed:!0})},children:[(0,Y.jsx)(m,{"aria-hidden":`true`}),`Remove`]}),(0,Y.jsxs)(C,{size:`sm`,onClick:()=>u(``),children:[(0,Y.jsx)(a,{"aria-hidden":`true`}),`Keep`]})]}):(0,Y.jsx)(C,{size:`icon`,variant:`icon`,disabled:n,onClick:()=>u(e.batch),"aria-label":`Remove batch ${e.batch}`,"data-tip":`Remove batch ${e.batch}`,className:`size-8`,children:(0,Y.jsx)(m,{"aria-hidden":`true`})})]},e.batch))}),d?.kind===`clean`&&d.result?.ok&&(0,Y.jsxs)(`p`,{className:`m-0 rounded-[12px] bg-pass-soft px-4 py-2 text-sm text-pass`,children:[`Removed:`,` `,Object.entries(d.result.removed||{}).map(([e,t])=>`${e} ${t}`).join(`, `)]})]})]})}function se({sub:e}){let{view:t,error:n,busy:r,act:i,stop:a,job:o}=ne(),[s,l]=(0,J.useState)(null),[u,f]=(0,J.useState)(``),p=X.includes(e)?e:`requests`,m=o&&!o.running?o.endedAt:``;(0,J.useEffect)(()=>{x.log().then(l,e=>f(e.message))},[m]);let h=(s||[]).filter(e=>!e.ok).length,_=new Set((s||[]).map(e=>e.requester)).size,y={requests:`Requests${s?` (${s.length})`:``}`,kept:`Kept${t?` (${t.requests.length})`:``}`,specs:`Specs${t?` (${t.specs.length})`:``}`,batches:`Batches`};return(0,Y.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,Y.jsx)(N,{}),(0,Y.jsxs)(`main`,{className:g(I,`@container flex-auto gap-4`),children:[(0,Y.jsx)(L,{href:d(`data`,`databases`),label:`All databases`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Y.jsx)(A,{pixel:O[`test-data`],size:`lg`}),(0,Y.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test data`}),t&&(0,Y.jsx)(R,{label:`Test data`,className:`mb-0`,current:p,onPick:e=>location.hash=d(`test-data`,e),tabs:X.map(e=>({id:e,label:y[e]}))}),(0,Y.jsx)(`span`,{className:`flex-auto`}),(0,Y.jsxs)(`a`,{href:d(`data`,`ask`,`test-data`),"data-tip":`Ask for test data`,className:g(w(),`no-underline`),children:[(0,Y.jsx)(c,{"aria-hidden":`true`}),`Ask`]})]}),(0,Y.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-ink-2`,children:`Every request for test data: which agent asked, what for, when, and what Miner sent back. Kept requests fetch the same data again with no model; specs make data you can insert as batches and remove again.`}),s&&s.length>0&&(0,Y.jsxs)(`p`,{className:`m-0 text-sm text-ink-2 tabular-nums`,children:[v(s.length,`request`),` · `,v(_,`asker`),` · `,(0,Y.jsxs)(`span`,{className:h?`text-fail`:``,children:[h,` failed`]}),t?` · ${t.requests.length} kept`:``]}),(n||u)&&(0,Y.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[12px] bg-fail-soft px-4 py-2 text-sm text-fail [overflow-wrap:anywhere]`,children:n||u}),!t&&!n&&(0,Y.jsx)(`p`,{role:`status`,className:`m-0 text-sm text-muted`,children:`Loading…`}),t&&(0,Y.jsxs)(Y.Fragment,{children:[o&&(o.running?Z[o.kind]!==void 0:Z[o.kind]===p)&&(0,Y.jsx)(te,{job:o,onStop:a}),(0,Y.jsxs)(`div`,{role:`tabpanel`,id:`panel-${p}`,"aria-labelledby":`tab-${p}`,children:[p===`requests`&&(0,Y.jsx)($,{view:t,log:s,busy:r,act:i}),p===`kept`&&(0,Y.jsx)(ie,{view:t,job:o,busy:r,act:i,onNote:f}),p===`specs`&&(0,Y.jsx)(ae,{view:t,job:o,busy:r,act:i,onNote:f}),p===`batches`&&(0,Y.jsx)(oe,{view:t,job:o,busy:r,act:i})]})]})]})]})}export{$ as Requests,se as TestData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,Bn as n,Er as r,H as i,Hr as a,I as o,L as s,on as c,r as l,u,ur as d,wr as f}from"./route-Dg53WdFu.js";import{t as p}from"./jsx-runtime-LKYXHABd.js";import{A as m,X as h,Z as ee,n as te,t as ne}from"./input-D7iHeNXz.js";import{d as g,f as _,o as v,t as y}from"./filters-Culzq1j1.js";import{L as re}from"./palette-lUno7fso.js";import{Dn as b,H as ie,K as ae,Pt as x,U as oe,g as S}from"./index-Cq2sihjc.js";import{_ as C,o as w}from"./qualityParts-B8bouYKy.js";var T=e(a(),1),E={view:()=>h(`GET`,`/api/testdebt`),refresh:()=>h(`POST`,`/api/testdebt/refresh`,{}),readCases:(e,t)=>h(`POST`,`/api/testdebt/cases`,{source:e,scope:t})},D=p(),O=[`untested`,`signal`,`duplicates`,`cases`],k={endpoint:`Endpoint`,screen:`Screen`,file:`Code file`},A={test:`Test`,recording:`Recording`,case:`Test case`},j={azure_devops:`Azure DevOps`,jira:`Jira`,xray:`Xray`,testrail:`TestRail`,zephyr:`Zephyr Scale`,qtest:`qTest`,other:`Other`},M={azure_devops:`plan=12/suite=34`,testrail:`run=7`,zephyr:`cycle=SHOP-R12`,qtest:`cycle=12`,xray:`plan=SHOP-100`},N=e=>`${Math.round(e*100)}%`,se=e=>O.includes(e)?e:`untested`;function P({part:e,what:t,action:n}){return(0,D.jsxs)(v,{icon:f,title:e.state===`empty`?`No ${t} yet`:`${t[0].toUpperCase()}${t.slice(1)}: not connected`,action:(0,D.jsxs)(`a`,{className:_({size:`sm`}),href:n.to,"data-tip":`Open ${n.label}`,children:[(0,D.jsx)(u,{"aria-hidden":`true`}),n.label]}),children:[`To see this list, set `,e.set,`.`]})}function F({text:e,tip:t}){return(0,D.jsx)(`span`,{"data-tip":t??e,className:`block truncate`,children:e})}function I({sub:e}){let[a,f]=(0,T.useState)(null),[p,h]=(0,T.useState)(``),[O,I]=(0,T.useState)(!1),[L,R]=(0,T.useState)(``),z=se(e),[B,V]=(0,T.useState)(`all`),[H,U]=(0,T.useState)(`manual`),[W,G]=(0,T.useState)(``),[K,ce]=(0,T.useState)(``);(0,T.useEffect)(()=>{E.view().then(e=>{f(e),h(``)},e=>h(e.message))},[]);let q=(0,T.useCallback)(async(e,t)=>{I(!0),R(``);try{f(await e()),h(``),t&&R(t)}catch(e){h(e.message)}finally{I(!1)}},[]),le=async e=>{if(e){I(!0);try{let{id:t}=await ee.start(e,{});location.hash=l(`chats`,t)}catch(e){h(e.message),I(!1)}}},J=(e,t)=>(0,D.jsx)(g,{size:`icon`,variant:`icon`,className:`size-8`,disabled:O||!e,onClick:()=>void le(e),"aria-label":`Draft a test for this ${t} in a chat`,"data-tip":e?`Draft a test for this ${t} in a chat`:`Its id or file is not of a plain shape, so no chat request names it: open it where it lives instead.`,children:(0,D.jsx)(d,{"aria-hidden":`true`})}),Y=a?.sources.filter(e=>e.connected&&e.id!==`jira`)??[],X=W||Y[0]?.id||``,Z=a?.cases.filter(e=>!e.automated).length??0,ue=a?.areas.filter(e=>B===`all`||e.kind===B)??[],de=a?.cases.filter(e=>H===`all`||(H===`manual`?!e.automated:e.automated))??[],Q=`py-2 pr-4 text-right tabular-nums`,$={untested:(a?.areas.length??0)+(a?.rules.length??0),signal:(a?.quiet.length??0)+(a?.gone.length??0),duplicates:a?.duplicates.length??0,cases:Z};return(0,D.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,D.jsx)(ae,{}),(0,D.jsxs)(`main`,{className:m(oe,`@container flex-auto gap-4`),children:[(0,D.jsx)(ie,{}),(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,D.jsx)(b,{pixel:re[`test-debt`],size:`lg`}),(0,D.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test debt`}),a&&(0,D.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[13px] text-muted`,children:[(0,D.jsxs)(`span`,{"data-tip":C(a.at),children:[`Worked out `,S(a.at)]}),(0,D.jsxs)(g,{size:`sm`,disabled:O,onClick:()=>void q(E.refresh,`Worked out again.`),children:[(0,D.jsx)(n,{"aria-hidden":`true`}),`Refresh`]})]})]}),(0,D.jsxs)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:[`What no test checks yet, and tests that tell little: code and business rules no test reaches in the `,(0,D.jsx)(`a`,{href:l(`product`),children:`product graph`}),`, tests that passed every one of their last 30 runs or whose file is gone from `,a?.repo&&a.repo!==`.`?(0,D.jsx)(`code`,{className:`font-mono text-[13px]`,children:a.repo}):`the test repository`,`, tests that read alike, and each test case with whether it is automated. It only reads; Draft the test asks in a chat, and nothing changes until you agree there.`]}),p&&(0,D.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:p}),!a&&!p&&(0,D.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),L&&(0,D.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2`,children:L}),a&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-6 @xl:divide-x @xl:divide-line-soft`,children:[(0,D.jsx)(w,{label:`Untested code`,value:a.graph.state===`ok`?a.areas.length:`–`,tone:a.areas.length?`text-warn`:void 0,sub:a.graph.state===`ok`?`of ${a.graph.checked} areas`:`graph not built`}),(0,D.jsx)(w,{label:`Untested rules`,value:a.rules.length,tone:a.rules.length?`text-warn`:void 0,sub:`of ${a.graph.rulesChecked} rules`}),(0,D.jsx)(w,{label:`Never fail`,value:a.quiet.length,sub:`30 passes in a row`}),(0,D.jsx)(w,{label:`Code gone`,value:a.gone.length,tone:a.gone.length?`text-fail`:void 0,sub:`of ${a.files.count} files listed`}),(0,D.jsx)(w,{label:`Near-duplicates`,value:a.duplicates.length,sub:`from ${N(a.threshold)} alike`}),(0,D.jsx)(w,{label:`Not automated`,value:Z,tone:Z?`text-warn`:void 0,sub:`of ${a.cases.length} test cases`})]}),(0,D.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,D.jsx)(y,{items:[{id:`untested`,label:`Untested code and rules`,n:$.untested},{id:`signal`,label:`Low-signal tests`,n:$.signal},{id:`duplicates`,label:`Near-duplicates`,n:$.duplicates},{id:`cases`,label:`Test cases`,n:$.cases}],value:z,onChange:e=>location.hash=l(`test-debt`,e)})}),a.notes.map(e=>(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:e},e)),z===`untested`&&(0,D.jsxs)(D.Fragment,{children:[a.graph.state===`ok`?(0,D.jsx)(x,{label:`Code no test reaches`,placeholder:`Find an endpoint, screen or file`,resetKey:B,empty:a.areas.length?`Nothing matches.`:`Every endpoint, screen and code file the graph holds is reached by a test.`,tools:(0,D.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,D.jsx)(y,{items:[{id:`all`,label:`All`,n:a.areas.length},...[`endpoint`,`screen`,`file`].map(e=>({id:e,label:`${k[e]}s`,n:a.areas.filter(t=>t.kind===e).length}))],value:B,onChange:V})}),head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[34%]`),children:`Code`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Kind`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Where`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Used by`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:ue.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(s,{size:15,"aria-label":`No test reaches it`,className:`flex-none text-warn`}),(0,D.jsx)(F,{text:e.name,tip:`${e.name} · ${e.known===`observed`?`read in the code`:`worked out from the code`}`})]})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`text-[13px] whitespace-nowrap`),children:k[e.kind]}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden max-w-0 font-mono text-[13px] text-ink-2 @xl:table-cell`),children:(0,D.jsx)(F,{text:e.where})}),(0,D.jsx)(`td`,{className:m(Q,`hidden text-muted @2xl:table-cell`),children:e.users}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,k[e.kind].toLowerCase())})]},e.id))}):(0,D.jsx)(P,{part:a.graph,what:`product graph`,action:{label:`Product`,to:l(`product`)}}),(0,D.jsx)(x,{label:`Business rules no test checks`,placeholder:`Find a rule`,empty:a.graph.rulesChecked?`Every business rule found is checked by a test.`:`No business rules found: the product graph's rules come from the code; the knowledge folder's from a business-rules.md file.`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[46%]`),children:`Rule`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`From`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Where`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Closest test`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.rules.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(s,{size:15,"aria-label":`No test checks it`,className:`flex-none text-warn`}),(0,D.jsx)(F,{text:e.text,tip:e.endpoint?`${e.text} · checked by ${e.endpoint}`:e.text})]})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`text-[13px] whitespace-nowrap`),"data-tip":e.from===`graph`?`Found in the code by forgeqe knowledge build`:`A rule of the knowledge folder, matched to tests by its words`,children:e.from===`graph`?`Code`:`Knowledge`}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden max-w-0 font-mono text-[13px] text-ink-2 @xl:table-cell`),children:(0,D.jsx)(F,{text:e.where})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:e.nearest?(0,D.jsx)(F,{text:`${e.nearest.name} (${N(e.nearest.score)})`,tip:`${N(e.nearest.score)} of the rule's words are in ${e.nearest.name}`}):`–`}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`rule`)})]},e.id))})]}),z===`signal`&&(a.history.state===`ok`?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(x,{label:`Tests that never fail`,placeholder:`Find a test`,empty:`No test has passed 30 runs in a row without a failure or a retry.`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[50%]`),children:`Test`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Passes`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Since`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.quiet.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(o,{size:15,"aria-label":`Always passed`,className:`flex-none text-muted`}),(0,D.jsx)(F,{text:e.name,tip:e.file?`${e.name} · ${e.file}`:e.name})]})}),(0,D.jsx)(`td`,{className:m(Q,`text-muted`),children:e.runs}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden text-[13px] whitespace-nowrap text-muted @xl:table-cell`),"data-tip":e.since?C(e.since):void 0,children:e.since?S(e.since):`–`}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`test`)})]},e.key))}),(0,D.jsx)(x,{label:`Tests whose file is gone`,placeholder:`Find a test or file`,empty:`Every test file the history names is in the test repository (${a.files.count} files, listed by ${a.files.by===`git`?`git`:`walking the folder`}).`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[40%]`),children:`Test`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`File`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Last run`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.gone.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(i,{size:15,"aria-label":`Its file is gone`,className:`flex-none text-fail`}),(0,D.jsx)(F,{text:e.name})]})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0 font-mono text-[13px] text-ink-2`),children:(0,D.jsx)(F,{text:e.file})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden text-[13px] whitespace-nowrap text-muted @xl:table-cell`),"data-tip":e.last?C(e.last):void 0,children:e.last?S(e.last):`–`}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`test`)})]},e.key))})]}):(0,D.jsx)(P,{part:a.history,what:`test history`,action:{label:`Regression`,to:l(`regression`)}})),z===`duplicates`&&(0,D.jsx)(x,{label:`Tests that read alike`,placeholder:`Find a test, recording or case`,empty:`No two tests, recordings or test cases share ${N(a.threshold)} of their words (${a.compared} pairs compared).`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Alike`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[30%]`),children:`First`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[30%]`),children:`Second`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Shared words`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.duplicates.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(Q,`pl-4`,e.score>=.85?`text-warn`:`text-muted`),children:(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,D.jsx)(t,{size:14,"aria-hidden":`true`}),N(e.score)]})}),[e.a,e.b].map((e,t)=>(0,D.jsxs)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:[(0,D.jsx)(F,{text:e.name,tip:`${A[e.kind]}: ${e.name}${e.where?` · ${e.where}`:``}`}),(0,D.jsx)(`span`,{className:`block text-[13px] text-muted`,children:A[e.kind]})]},t)),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:(0,D.jsx)(F,{text:e.shared.join(`, `)})}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`pair`)})]},`${e.a.kind}:${e.a.key}|${e.b.kind}:${e.b.key}`))}),z===`cases`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(`span`,{className:`text-[13px] font-medium`,children:`Test management`}),(0,D.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:a.sources.map(e=>(0,D.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[e.connected?(0,D.jsx)(o,{size:15,"aria-label":`Connected`,className:`flex-none text-pass`}):(0,D.jsx)(s,{size:15,"aria-label":`Not connected`,className:`flex-none text-muted`}),(0,D.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,D.jsx)(`span`,{className:`text-ink-2`,children:e.connected?e.scopes.length?e.scopes.map(e=>`${e.scope}: ${e.cases} read ${S(e.at)}`).join(` · `):e.id===`jira`?`connected: its cases show once ForgeQE has indexed or automated them`:`connected`:`not connected: set ${e.set}`})]},e.id))})]}),Y.length>0&&(0,D.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),X&&q(()=>E.readCases(X,K.trim()),`Test cases read.`)},children:[(0,D.jsx)(te,{size:`sm`,"aria-label":`Source`,value:X,onChange:e=>G(e.target.value),children:Y.map(e=>(0,D.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,D.jsx)(ne,{size:`sm`,"aria-label":`Scope`,placeholder:X&&X!==`jira`?M[X]:``,value:K,maxLength:80,onChange:e=>ce(e.target.value),className:`w-full max-w-[240px] flex-[0_1_240px]`}),(0,D.jsxs)(g,{size:`sm`,type:`submit`,disabled:O||!K.trim(),"data-tip":`Read the test cases`,children:[(0,D.jsx)(r,{"aria-hidden":`true`}),`Import`]})]}),a.cases.length?(0,D.jsx)(x,{label:`Test cases`,placeholder:`Find a test case by id or title`,resetKey:H,empty:`Nothing matches.`,tools:(0,D.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,D.jsx)(y,{items:[{id:`manual`,label:`Not automated`,n:Z,alert:!0},{id:`automated`,label:`Automated`,n:a.cases.length-Z},{id:`all`,label:`All`,n:a.cases.length}],value:H,onChange:U})}),head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Case`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[36%]`),children:`Title`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Source`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Automated`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Test`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:de.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`font-mono text-[13px] whitespace-nowrap`),children:/^https?:\/\//i.test(e.url)?(0,D.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id}):e.id}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:(0,D.jsx)(F,{text:e.title||`–`})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden text-[13px] whitespace-nowrap @xl:table-cell`),"data-tip":`From ${e.scope}`,children:j[e.source]}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`text-[13px] whitespace-nowrap`),children:(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2`,"data-tip":e.how===`mapping`?`Its test is in the automated tests' mapping`:e.how===`name`?`A test in the history names its id`:`No automated test names it`,children:[e.automated?(0,D.jsx)(o,{size:15,"aria-hidden":`true`,className:`text-pass`}):(0,D.jsx)(s,{size:15,"aria-hidden":`true`,className:`text-muted`}),e.automated?`Yes`:`No`]})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:e.test?(0,D.jsx)(F,{text:e.test,tip:e.file?`${e.test} · ${e.file}`:e.test}):`–`}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:!e.automated&&J(e.draft,`test case`)})]},`${e.source}|${e.id}`))}):(0,D.jsx)(v,{icon:c,title:`No test cases yet`,action:(0,D.jsxs)(`a`,{className:_({size:`sm`}),href:l(`settings`,`integrations`),"data-tip":`Open Settings, Integrations`,children:[(0,D.jsx)(u,{"aria-hidden":`true`}),`Settings`]}),children:`Test cases show here from ForgeQE's case index, the automated tests' mapping (.forgeqe/test-cases.json), and the plans, runs or cycles you read above from a connected source.`})]})]})]})]})}export{I as TestDebt};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,Bn as n,Er as r,H as i,Hr as a,I as o,L as s,on as c,r as l,u,ur as d,wr as f}from"./route-Dg53WdFu.js";import{t as p}from"./jsx-runtime-LKYXHABd.js";import{A as m,X as h,Z as ee,n as te,t as ne}from"./input-D7iHeNXz.js";import{d as g,f as _,o as v,t as y}from"./filters-Culzq1j1.js";import{L as re}from"./palette-lUno7fso.js";import{Dn as b,H as ie,K as ae,Pt as x,U as oe,g as S}from"./index-CljX5dI4.js";import{_ as C,o as w}from"./qualityParts-D_U5zhKC.js";var T=e(a(),1),E={view:()=>h(`GET`,`/api/testdebt`),refresh:()=>h(`POST`,`/api/testdebt/refresh`,{}),readCases:(e,t)=>h(`POST`,`/api/testdebt/cases`,{source:e,scope:t})},D=p(),O=[`untested`,`signal`,`duplicates`,`cases`],k={endpoint:`Endpoint`,screen:`Screen`,file:`Code file`},A={test:`Test`,recording:`Recording`,case:`Test case`},j={azure_devops:`Azure DevOps`,jira:`Jira`,xray:`Xray`,testrail:`TestRail`,zephyr:`Zephyr Scale`,qtest:`qTest`,other:`Other`},M={azure_devops:`plan=12/suite=34`,testrail:`run=7`,zephyr:`cycle=SHOP-R12`,qtest:`cycle=12`,xray:`plan=SHOP-100`},N=e=>`${Math.round(e*100)}%`,se=e=>O.includes(e)?e:`untested`;function P({part:e,what:t,action:n}){return(0,D.jsxs)(v,{icon:f,title:e.state===`empty`?`No ${t} yet`:`${t[0].toUpperCase()}${t.slice(1)}: not connected`,action:(0,D.jsxs)(`a`,{className:_({size:`sm`}),href:n.to,"data-tip":`Open ${n.label}`,children:[(0,D.jsx)(u,{"aria-hidden":`true`}),n.label]}),children:[`To see this list, set `,e.set,`.`]})}function F({text:e,tip:t}){return(0,D.jsx)(`span`,{"data-tip":t??e,className:`block truncate`,children:e})}function I({sub:e}){let[a,f]=(0,T.useState)(null),[p,h]=(0,T.useState)(``),[O,I]=(0,T.useState)(!1),[L,R]=(0,T.useState)(``),z=se(e),[B,V]=(0,T.useState)(`all`),[H,U]=(0,T.useState)(`manual`),[W,G]=(0,T.useState)(``),[K,ce]=(0,T.useState)(``);(0,T.useEffect)(()=>{E.view().then(e=>{f(e),h(``)},e=>h(e.message))},[]);let q=(0,T.useCallback)(async(e,t)=>{I(!0),R(``);try{f(await e()),h(``),t&&R(t)}catch(e){h(e.message)}finally{I(!1)}},[]),le=async e=>{if(e){I(!0);try{let{id:t}=await ee.start(e,{});location.hash=l(`chats`,t)}catch(e){h(e.message),I(!1)}}},J=(e,t)=>(0,D.jsx)(g,{size:`icon`,variant:`icon`,className:`size-8`,disabled:O||!e,onClick:()=>void le(e),"aria-label":`Draft a test for this ${t} in a chat`,"data-tip":e?`Draft a test for this ${t} in a chat`:`Its id or file is not of a plain shape, so no chat request names it: open it where it lives instead.`,children:(0,D.jsx)(d,{"aria-hidden":`true`})}),Y=a?.sources.filter(e=>e.connected&&e.id!==`jira`)??[],X=W||Y[0]?.id||``,Z=a?.cases.filter(e=>!e.automated).length??0,ue=a?.areas.filter(e=>B===`all`||e.kind===B)??[],de=a?.cases.filter(e=>H===`all`||(H===`manual`?!e.automated:e.automated))??[],Q=`py-2 pr-4 text-right tabular-nums`,$={untested:(a?.areas.length??0)+(a?.rules.length??0),signal:(a?.quiet.length??0)+(a?.gone.length??0),duplicates:a?.duplicates.length??0,cases:Z};return(0,D.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,D.jsx)(ae,{}),(0,D.jsxs)(`main`,{className:m(oe,`@container flex-auto gap-4`),children:[(0,D.jsx)(ie,{}),(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,D.jsx)(b,{pixel:re[`test-debt`],size:`lg`}),(0,D.jsx)(`h1`,{className:`m-0 text-[25px] font-semibold tracking-[-0.01em]`,children:`Test debt`}),a&&(0,D.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[13px] text-muted`,children:[(0,D.jsxs)(`span`,{"data-tip":C(a.at),children:[`Worked out `,S(a.at)]}),(0,D.jsxs)(g,{size:`sm`,disabled:O,onClick:()=>void q(E.refresh,`Worked out again.`),children:[(0,D.jsx)(n,{"aria-hidden":`true`}),`Refresh`]})]})]}),(0,D.jsxs)(`p`,{className:`m-0 text-[13px] leading-relaxed text-ink-2`,children:[`What no test checks yet, and tests that tell little: code and business rules no test reaches in the `,(0,D.jsx)(`a`,{href:l(`product`),children:`product graph`}),`, tests that passed every one of their last 30 runs or whose file is gone from `,a?.repo&&a.repo!==`.`?(0,D.jsx)(`code`,{className:`font-mono text-[13px]`,children:a.repo}):`the test repository`,`, tests that read alike, and each test case with whether it is automated. It only reads; Draft the test asks in a chat, and nothing changes until you agree there.`]}),p&&(0,D.jsx)(`p`,{role:`alert`,className:`m-0 rounded-[10px] bg-fail-soft px-4 py-2 text-[13px] text-fail [overflow-wrap:anywhere]`,children:p}),!a&&!p&&(0,D.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-muted`,children:`Loading…`}),L&&(0,D.jsx)(`p`,{role:`status`,className:`m-0 text-[13px] text-ink-2`,children:L}),a&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`grid grid-cols-2 overflow-hidden border-y border-line-soft @xl:grid-cols-6 @xl:divide-x @xl:divide-line-soft`,children:[(0,D.jsx)(w,{label:`Untested code`,value:a.graph.state===`ok`?a.areas.length:`–`,tone:a.areas.length?`text-warn`:void 0,sub:a.graph.state===`ok`?`of ${a.graph.checked} areas`:`graph not built`}),(0,D.jsx)(w,{label:`Untested rules`,value:a.rules.length,tone:a.rules.length?`text-warn`:void 0,sub:`of ${a.graph.rulesChecked} rules`}),(0,D.jsx)(w,{label:`Never fail`,value:a.quiet.length,sub:`30 passes in a row`}),(0,D.jsx)(w,{label:`Code gone`,value:a.gone.length,tone:a.gone.length?`text-fail`:void 0,sub:`of ${a.files.count} files listed`}),(0,D.jsx)(w,{label:`Near-duplicates`,value:a.duplicates.length,sub:`from ${N(a.threshold)} alike`}),(0,D.jsx)(w,{label:`Not automated`,value:Z,tone:Z?`text-warn`:void 0,sub:`of ${a.cases.length} test cases`})]}),(0,D.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,D.jsx)(y,{items:[{id:`untested`,label:`Untested code and rules`,n:$.untested},{id:`signal`,label:`Low-signal tests`,n:$.signal},{id:`duplicates`,label:`Near-duplicates`,n:$.duplicates},{id:`cases`,label:`Test cases`,n:$.cases}],value:z,onChange:e=>location.hash=l(`test-debt`,e)})}),a.notes.map(e=>(0,D.jsx)(`p`,{className:`m-0 text-[13px] text-ink-2`,children:e},e)),z===`untested`&&(0,D.jsxs)(D.Fragment,{children:[a.graph.state===`ok`?(0,D.jsx)(x,{label:`Code no test reaches`,placeholder:`Find an endpoint, screen or file`,resetKey:B,empty:a.areas.length?`Nothing matches.`:`Every endpoint, screen and code file the graph holds is reached by a test.`,tools:(0,D.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,D.jsx)(y,{items:[{id:`all`,label:`All`,n:a.areas.length},...[`endpoint`,`screen`,`file`].map(e=>({id:e,label:`${k[e]}s`,n:a.areas.filter(t=>t.kind===e).length}))],value:B,onChange:V})}),head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[34%]`),children:`Code`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Kind`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Where`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Used by`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:ue.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(s,{size:15,"aria-label":`No test reaches it`,className:`flex-none text-warn`}),(0,D.jsx)(F,{text:e.name,tip:`${e.name} · ${e.known===`observed`?`read in the code`:`worked out from the code`}`})]})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`text-[13px] whitespace-nowrap`),children:k[e.kind]}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden max-w-0 font-mono text-[13px] text-ink-2 @xl:table-cell`),children:(0,D.jsx)(F,{text:e.where})}),(0,D.jsx)(`td`,{className:m(Q,`hidden text-muted @2xl:table-cell`),children:e.users}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,k[e.kind].toLowerCase())})]},e.id))}):(0,D.jsx)(P,{part:a.graph,what:`product graph`,action:{label:`Product`,to:l(`product`)}}),(0,D.jsx)(x,{label:`Business rules no test checks`,placeholder:`Find a rule`,empty:a.graph.rulesChecked?`Every business rule found is checked by a test.`:`No business rules found: the product graph's rules come from the code; the knowledge folder's from a business-rules.md file.`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[46%]`),children:`Rule`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`From`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Where`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Closest test`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.rules.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(s,{size:15,"aria-label":`No test checks it`,className:`flex-none text-warn`}),(0,D.jsx)(F,{text:e.text,tip:e.endpoint?`${e.text} · checked by ${e.endpoint}`:e.text})]})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`text-[13px] whitespace-nowrap`),"data-tip":e.from===`graph`?`Found in the code by forgeqe knowledge build`:`A rule of the knowledge folder, matched to tests by its words`,children:e.from===`graph`?`Code`:`Knowledge`}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden max-w-0 font-mono text-[13px] text-ink-2 @xl:table-cell`),children:(0,D.jsx)(F,{text:e.where})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:e.nearest?(0,D.jsx)(F,{text:`${e.nearest.name} (${N(e.nearest.score)})`,tip:`${N(e.nearest.score)} of the rule's words are in ${e.nearest.name}`}):`–`}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`rule`)})]},e.id))})]}),z===`signal`&&(a.history.state===`ok`?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(x,{label:`Tests that never fail`,placeholder:`Find a test`,empty:`No test has passed 30 runs in a row without a failure or a retry.`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[50%]`),children:`Test`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Passes`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Since`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.quiet.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(o,{size:15,"aria-label":`Always passed`,className:`flex-none text-muted`}),(0,D.jsx)(F,{text:e.name,tip:e.file?`${e.name} · ${e.file}`:e.name})]})}),(0,D.jsx)(`td`,{className:m(Q,`text-muted`),children:e.runs}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden text-[13px] whitespace-nowrap text-muted @xl:table-cell`),"data-tip":e.since?C(e.since):void 0,children:e.since?S(e.since):`–`}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`test`)})]},e.key))}),(0,D.jsx)(x,{label:`Tests whose file is gone`,placeholder:`Find a test or file`,empty:`Every test file the history names is in the test repository (${a.files.count} files, listed by ${a.files.by===`git`?`git`:`walking the folder`}).`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[40%]`),children:`Test`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`File`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Last run`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.gone.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(i,{size:15,"aria-label":`Its file is gone`,className:`flex-none text-fail`}),(0,D.jsx)(F,{text:e.name})]})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0 font-mono text-[13px] text-ink-2`),children:(0,D.jsx)(F,{text:e.file})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden text-[13px] whitespace-nowrap text-muted @xl:table-cell`),"data-tip":e.last?C(e.last):void 0,children:e.last?S(e.last):`–`}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`test`)})]},e.key))})]}):(0,D.jsx)(P,{part:a.history,what:`test history`,action:{label:`Regression`,to:l(`regression`)}})),z===`duplicates`&&(0,D.jsx)(x,{label:`Tests that read alike`,placeholder:`Find a test, recording or case`,empty:`No two tests, recordings or test cases share ${N(a.threshold)} of their words (${a.compared} pairs compared).`,head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-right text-[13px] font-medium whitespace-nowrap text-muted`,children:`Alike`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[30%]`),children:`First`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[30%]`),children:`Second`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Shared words`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:a.duplicates.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(Q,`pl-4`,e.score>=.85?`text-warn`:`text-muted`),children:(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,D.jsx)(t,{size:14,"aria-hidden":`true`}),N(e.score)]})}),[e.a,e.b].map((e,t)=>(0,D.jsxs)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:[(0,D.jsx)(F,{text:e.name,tip:`${A[e.kind]}: ${e.name}${e.where?` · ${e.where}`:``}`}),(0,D.jsx)(`span`,{className:`block text-[13px] text-muted`,children:A[e.kind]})]},t)),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:(0,D.jsx)(F,{text:e.shared.join(`, `)})}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:J(e.draft,`pair`)})]},`${e.a.kind}:${e.a.key}|${e.b.kind}:${e.b.key}`))}),z===`cases`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,D.jsx)(`span`,{className:`text-[13px] font-medium`,children:`Test management`}),(0,D.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-[13px]`,children:a.sources.map(e=>(0,D.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2`,children:[e.connected?(0,D.jsx)(o,{size:15,"aria-label":`Connected`,className:`flex-none text-pass`}):(0,D.jsx)(s,{size:15,"aria-label":`Not connected`,className:`flex-none text-muted`}),(0,D.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,D.jsx)(`span`,{className:`text-ink-2`,children:e.connected?e.scopes.length?e.scopes.map(e=>`${e.scope}: ${e.cases} read ${S(e.at)}`).join(` · `):e.id===`jira`?`connected: its cases show once ForgeQE has indexed or automated them`:`connected`:`not connected: set ${e.set}`})]},e.id))})]}),Y.length>0&&(0,D.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:e=>{e.preventDefault(),X&&q(()=>E.readCases(X,K.trim()),`Test cases read.`)},children:[(0,D.jsx)(te,{size:`sm`,"aria-label":`Source`,value:X,onChange:e=>G(e.target.value),children:Y.map(e=>(0,D.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,D.jsx)(ne,{size:`sm`,"aria-label":`Scope`,placeholder:X&&X!==`jira`?M[X]:``,value:K,maxLength:80,onChange:e=>ce(e.target.value),className:`w-full max-w-[240px] flex-[0_1_240px]`}),(0,D.jsxs)(g,{size:`sm`,type:`submit`,disabled:O||!K.trim(),"data-tip":`Read the test cases`,children:[(0,D.jsx)(r,{"aria-hidden":`true`}),`Import`]})]}),a.cases.length?(0,D.jsx)(x,{label:`Test cases`,placeholder:`Find a test case by id or title`,resetKey:H,empty:`Nothing matches.`,tools:(0,D.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,D.jsx)(y,{items:[{id:`manual`,label:`Not automated`,n:Z,alert:!0},{id:`automated`,label:`Automated`,n:a.cases.length-Z},{id:`all`,label:`All`,n:a.cases.length}],value:H,onChange:U})}),head:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Case`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`w-[36%]`),children:`Title`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @xl:table-cell`),children:`Source`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:`Automated`}),(0,D.jsx)(`th`,{scope:`col`,className:m(`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,`hidden @2xl:table-cell`),children:`Test`}),(0,D.jsx)(`th`,{scope:`col`,className:`px-4 py-2 text-left text-[13px] font-medium whitespace-nowrap text-muted`,children:(0,D.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]}),children:de.map(e=>(0,D.jsxs)(`tr`,{className:`border-t border-line-soft hover:bg-surface-muted`,children:[(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`font-mono text-[13px] whitespace-nowrap`),children:/^https?:\/\//i.test(e.url)?(0,D.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id}):e.id}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`max-w-0`),children:(0,D.jsx)(F,{text:e.title||`–`})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden text-[13px] whitespace-nowrap @xl:table-cell`),"data-tip":`From ${e.scope}`,children:j[e.source]}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`text-[13px] whitespace-nowrap`),children:(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2`,"data-tip":e.how===`mapping`?`Its test is in the automated tests' mapping`:e.how===`name`?`A test in the history names its id`:`No automated test names it`,children:[e.automated?(0,D.jsx)(o,{size:15,"aria-hidden":`true`,className:`text-pass`}):(0,D.jsx)(s,{size:15,"aria-hidden":`true`,className:`text-muted`}),e.automated?`Yes`:`No`]})}),(0,D.jsx)(`td`,{className:m(`px-4 py-2`,`hidden max-w-0 text-[13px] text-ink-2 @2xl:table-cell`),children:e.test?(0,D.jsx)(F,{text:e.test,tip:e.file?`${e.test} · ${e.file}`:e.test}):`–`}),(0,D.jsx)(`td`,{className:`px-4 py-2 text-right whitespace-nowrap tabular-nums`,children:!e.automated&&J(e.draft,`test case`)})]},`${e.source}|${e.id}`))}):(0,D.jsx)(v,{icon:c,title:`No test cases yet`,action:(0,D.jsxs)(`a`,{className:_({size:`sm`}),href:l(`settings`,`integrations`),"data-tip":`Open Settings, Integrations`,children:[(0,D.jsx)(u,{"aria-hidden":`true`}),`Settings`]}),children:`Test cases show here from ForgeQE's case index, the automated tests' mapping (.forgeqe/test-cases.json), and the plans, runs or cycles you read above from a connected source.`})]})]})]})]})}export{I as TestDebt};
|