@capagents/forgeqe 3.3.7 → 3.3.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 +1681 -1681
- package/dist/web/assets/{3d-force-graph-Bsispdm1.js → 3d-force-graph-bqf5EzgX.js} +1 -1
- package/dist/web/assets/Agent-8Y47YLdR.js +10 -0
- package/dist/web/assets/{AgentWork-BugEUl60.js → AgentWork-Dqa1UKaU.js} +1 -1
- package/dist/web/assets/{ApiTests-B9rtwCbe.js → ApiTests-BOdFugGs.js} +1 -1
- package/dist/web/assets/{Browse-Dl2Lneca.js → Browse-W54t28gX.js} +1 -1
- package/dist/web/assets/{Chat-DocT7FlH.js → Chat-DiIxGONU.js} +1 -1
- package/dist/web/assets/{CommandPalette-B7YPDCOk.js → CommandPalette-DnIxy2ga.js} +1 -1
- package/dist/web/assets/{Compare-D6XsFmmb.js → Compare-VdisgqmY.js} +1 -1
- package/dist/web/assets/{Cost-DvbuXS6u.js → Cost-qfQZZB7-.js} +1 -1
- package/dist/web/assets/{Data-BmZHJkfj.js → Data-CDyRsQ0U.js} +1 -1
- package/dist/web/assets/{Desktop-DD3F69ih.js → Desktop-DEYZusRQ.js} +1 -1
- package/dist/web/assets/{DesktopReview-BR0LtVFw.js → DesktopReview-4YU21PCr.js} +1 -1
- package/dist/web/assets/{Evidence-OqAiYzrl.js → Evidence-l0_yQUpE.js} +1 -1
- package/dist/web/assets/{Explore-QNyusEFo.js → Explore-DkybdJjI.js} +1 -1
- package/dist/web/assets/{Features-N3_77mz-.js → Features-CIhQJMAK.js} +1 -1
- package/dist/web/assets/{Flags-Yv4Ttmmh.js → Flags-OCOPCt4-.js} +1 -1
- package/dist/web/assets/{Flaky-Bg2f2K1U.js → Flaky-B9EYZK9j.js} +1 -1
- package/dist/web/assets/{Impact-CpxvVnKj.js → Impact-BXDjDf_Q.js} +1 -1
- package/dist/web/assets/{Jobs-_gZTxoaG.js → Jobs-COZhEsxq.js} +1 -1
- package/dist/web/assets/{KindPage-Amr6R7Ym.js → KindPage-DIeBVPZA.js} +1 -1
- package/dist/web/assets/{LiveDevice-j7NZXIJZ.js → LiveDevice-CZZRu6xl.js} +1 -1
- package/dist/web/assets/{Migration-DfPYzTfk.js → Migration-BTCG2m5B.js} +1 -1
- package/dist/web/assets/{Mobile-fIhhQPsp.js → Mobile-CLT5OlqS.js} +1 -1
- package/dist/web/assets/{Observability-13DkrRp2.js → Observability-Nd9uj2hQ.js} +1 -1
- package/dist/web/assets/{OwnItems-BdiPfdTw.js → OwnItems-BinKnGAs.js} +1 -1
- package/dist/web/assets/{PageAgent-CC8Ha6vu.js → PageAgent-DrELdLct.js} +1 -1
- package/dist/web/assets/{Product-CnXkqwQm.js → Product-1SMtAUqO.js} +2 -2
- package/dist/web/assets/{Production-5mTIt4sr.js → Production-C5q3LjAR.js} +1 -1
- package/dist/web/assets/{Quality-DbLcbP1X.js → Quality-DVb1L07l.js} +1 -1
- package/dist/web/assets/{Readiness-BG1xmC09.js → Readiness-BN1VQDip.js} +1 -1
- package/dist/web/assets/{Record-sFth-2I1.js → Record-C8ohbDBp.js} +1 -1
- package/dist/web/assets/{Regression-Dd4y8I1z.js → Regression-mAzdSpwD.js} +1 -1
- package/dist/web/assets/{RelationGraph-Blfs7PhK.js → RelationGraph-CszRGlEp.js} +1 -1
- package/dist/web/assets/{Reports-HQkTX4Kr.js → Reports-BPD6ODz4.js} +1 -1
- package/dist/web/assets/{Requirements-DmhUNCIP.js → Requirements-D1xVywdV.js} +1 -1
- package/dist/web/assets/{Responsive-D18eYdCh.js → Responsive-DnK0Myzs.js} +1 -1
- package/dist/web/assets/{RunDiff-75a-smeg.js → RunDiff-aEt4BZYX.js} +1 -1
- package/dist/web/assets/{Settings-BaodIliH.js → Settings-D188FdLb.js} +7 -7
- package/dist/web/assets/{Steps-ZPH_rTJh.js → Steps-CgQ8E_Vv.js} +1 -1
- package/dist/web/assets/{TestData-DUlTo5qt.js → TestData-Dj73b-hW.js} +1 -1
- package/dist/web/assets/{TestManagement-DUMGdHDw.js → TestManagement-DxPMUroR.js} +1 -1
- package/dist/web/assets/{WhatsNew-BrVNacPl.js → WhatsNew-D-5E8NFV.js} +1 -1
- package/dist/web/assets/{agentSettingsSheet-UCqUtdjq.js → agentSettingsSheet-5JMUsoLi.js} +1 -1
- package/dist/web/assets/api-D_HT-I9y.js +1 -0
- package/dist/web/assets/{dataParts-C0C67bVQ.js → dataParts-bqVlyE0X.js} +1 -1
- package/dist/web/assets/{desktopAppPath-B89LKvjx.js → desktopAppPath-BDSG0kvw.js} +1 -1
- package/dist/web/assets/{flowTheme-BNKwRxun.js → flowTheme-DU5XjJr-.js} +1 -1
- package/dist/web/assets/{frame-C8sL1yo-.js → frame-Dt9QcYNX.js} +3 -3
- package/dist/web/assets/index-BdWLAq_n.js +57 -0
- package/dist/web/assets/index-CpAtlS2x.css +2 -0
- package/dist/web/assets/{markdown-CxsWgpYs.js → markdown-DgUpsCX8.js} +1 -1
- package/dist/web/assets/{nav-DYgvAJu-.js → nav-IMBXh0Jg.js} +1 -1
- package/dist/web/assets/{pageBack-BefA2rh7.js → pageBack-DwhsvsK7.js} +1 -1
- package/dist/web/assets/{palette-BgJTq_Ot.js → palette-CeG8IIbL.js} +1 -1
- package/dist/web/assets/{parts-BNpm4gXC.js → parts-DVUUpFdW.js} +1 -1
- package/dist/web/assets/{productParts-ZEi0sPIk.js → productParts-ClDOvIlz.js} +1 -1
- package/dist/web/assets/{qualityParts-DtsD70Qh.js → qualityParts-DF3ZMgo5.js} +1 -1
- package/dist/web/assets/{recordTest-Bz5ryzpS.js → recordTest-BBDRjct0.js} +1 -1
- package/dist/web/assets/{stepper-CONWT_tv.js → stepper-uX1iUWez.js} +1 -1
- package/dist/web/assets/{wizardParts-CulZqqjz.js → wizardParts-qs3g8O6h.js} +1 -1
- package/dist/web/index.html +8 -8
- package/docs/{ForgeQE-Static-Analysis-Report-5bbf0da7.html → ForgeQE-Static-Analysis-Report-ccbdac00.html} +33 -33
- package/docs/ForgeQE-Static-Analysis-Report-ccbdac00.pdf +0 -0
- package/package.json +1 -1
- package/dist/web/assets/Agent-39FbaH7G.js +0 -10
- package/dist/web/assets/api-D8-lxyQi.js +0 -1
- package/dist/web/assets/index-BFG13fbg.js +0 -55
- package/dist/web/assets/index-DBnWgocz.css +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{n,r}from"./route-oDy8sV6H.js";import{B as i,L as a,o}from"./preload-helper-BupTYkQW.js";import{t as s}from"./utils-DJRAScIl.js";import{t as c}from"./jsx-runtime-LKYXHABd.js";import{L as l}from"./palette-BgJTq_Ot.js";import{Q as u,y as d}from"./api-D8-lxyQi.js";import{C as f,S as p,_ as m,f as h,n as g,x as _}from"./pageBack-BefA2rh7.js";import{E as v,F as y,N as b,Sr as x,mn as S,mt as C,z as w}from"./line-icons-CwCZidXs.js";import{lt as T,qt as E,s as D,t as O,zt as k}from"./frame-C8sL1yo-.js";import{t as A}from"./when-BuWCTaKm.js";import{H as j,R as M,U as N,V as P}from"./index-BFG13fbg.js";import{g as F}from"./qualityParts-DtsD70Qh.js";var I=e(t(),1),L=c(),R={server:{label:`The server answered differently`,hint:`A call returned another status: likely a product or backend change, not the test. File it as a defect if the first run was right.`},locator:{label:`An element was not found`,hint:`The page likely changed under the test. If the change was intended, heal the test; if not, it is a product bug.`},navigation:{label:`It reached another page`,hint:`A redirect, a sign-in, a feature flag or the environment's settings may differ between the runs.`},path:{label:`It took another path`,hint:`The run did something else here: the flow changed, or the agent found another way through it.`},data:{label:`Same step, another outcome`,hint:`The step was the same but ended otherwise: the test data, the account or what the page held likely differs.`},timing:{label:`Only the timing differs`,hint:`A slow environment, or a wait that races the page: a likely cause of flaky failures.`},errors:{label:`New browser errors`,hint:`The page raised errors in the second run that it did not in the first.`},missing:{label:`A step only one run did`,hint:`One run has a step the other does not: a dialog, a retry or a changed flow.`}},z=e=>`${(e/1e3).toFixed(1)}s`,B=e=>`${e.goal.slice(0,80)} · ${e.status} · ${A(e.at)}`;function V(e,t){let n=e.find(e=>e.id===t),r=e.filter(e=>e.id!==t);if(!n)return{same:[],other:r};let i=n.goal.trim().toLowerCase();return{same:r.filter(e=>e.goal.trim().toLowerCase()===i),other:r.filter(e=>e.goal.trim().toLowerCase()!==i)}}function H({run:e,step:t}){let[n,r]=(0,I.useState)(``),[i,a]=(0,I.useState)(!1);return(0,I.useEffect)(()=>{let n=!1;return r(``),a(!1),t?.shot&&u.shot(e,t.n,t.shot).then(e=>!n&&r(e),()=>!n&&a(!0)),()=>{n=!0}},[e,t?.n,t?.shot]),t?!t.shot||i?(0,L.jsx)(`p`,{className:s(o,`m-0 px-4 py-6 text-center text-body-sm text-muted`),children:`No screenshot`}):n?(0,L.jsx)(`img`,{src:n,alt:`Step ${t.n} of ${e}`,className:s(o,`max-h-[420px] w-full object-contain object-top`)}):(0,L.jsx)(`div`,{className:s(o,`min-h-24`)}):(0,L.jsx)(`p`,{className:s(o,`m-0 px-4 py-6 text-center text-body-sm text-muted`),children:`Not in this run`})}function U({step:e,other:t}){if(!e)return(0,L.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Not in this run`});let n=e.ok?b:w,r=new Set((t?.calls??[]).map(e=>`${e.method} ${e.path} ${e.status}`)),i=t?e.calls.filter(e=>!r.has(`${e.method} ${e.path} ${e.status}`)):[];return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,L.jsx)(n,{size:14,"aria-label":e.ok?`Passed`:`Failed`,className:s(`mt-1 flex-none`,e.ok?`text-pass`:`text-fail`)}),(0,L.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:e.action||`–`})]}),(0,L.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,"data-tip":e.title?`${e.title} · ${e.page}`:e.page,children:[e.page,typeof e.ms==`number`?` · ${z(e.ms)}`:``]}),e.error&&(0,L.jsx)(`span`,{className:`text-body-sm text-fail [overflow-wrap:anywhere]`,children:e.error}),i.slice(0,3).map(e=>(0,L.jsxs)(`span`,{className:s(`truncate font-mono text-body-sm`,e.status>=400||e.failed?`text-fail`:`text-muted`),"data-tip":`${e.method} ${e.path}`,children:[e.method,` `,e.path,` `,e.failed?`no answer`:e.status]},`${e.method} ${e.path}`)),e.problems.slice(0,2).map(e=>(0,L.jsx)(`span`,{className:`truncate text-body-sm text-warn`,"data-tip":e,children:e},e))]})}function W({row:e,i:t,a:n,b:r,focus:i,open:a,onToggle:o}){let c=e.a?.n,l=e.b?.n;return(0,L.jsxs)(`li`,{id:i?`look-here`:void 0,className:s(`border-t border-line-soft`,!e.same&&`bg-warn-soft/40`,i&&`outline-2 -outline-offset-2 outline-warn`),children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] items-start gap-4 px-4 py-2 text-body-sm`,children:[(0,L.jsx)(`span`,{className:`pt-1 text-muted tabular-nums`,"data-tip":c!==void 0&&l!==void 0&&c!==l?`Step ${c} of the first run, ${l} of the second`:void 0,children:c!==void 0&&l!==void 0&&c!==l?`${c}·${l}`:c??l??t+1}),(0,L.jsx)(U,{step:e.a,other:e.b}),(0,L.jsx)(U,{step:e.b,other:e.a}),(0,L.jsx)(_,{variant:`icon`,size:`icon-sm`,"aria-label":a?`Hide screenshots`:`Show screenshots`,"aria-expanded":a,onClick:o,"data-tip":a?`Hide screenshots`:`Show screenshots`,children:(0,L.jsx)(v,{"aria-hidden":`true`,className:s(`transition-transform`,a&&`rotate-180`)})})]}),!e.same&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2 pl-[3.75rem] text-body-sm text-ink-2`,children:[i&&e.kind&&(0,L.jsxs)(`span`,{className:`font-medium text-warn`,children:[`Look here first: `,R[e.kind].label]}),e.differences.map(e=>(0,L.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e},e))]}),(0,L.jsx)(E,{open:a,children:(0,L.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-4 px-4 pb-4 @2xl:grid-cols-2`,children:[(0,L.jsx)(H,{run:n,step:e.a}),(0,L.jsx)(H,{run:r,step:e.b})]})})]})}function G({runs:e,a:t,b:n}){let[i,o]=(0,I.useState)(t??``),[s,c]=(0,I.useState)(n??``);(0,I.useEffect)(()=>{o(t??``),c(n??``)},[t,n]);let{same:l,other:u}=V(e,i);return(0,L.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),i&&s&&i!==s&&(location.hash=r(`run-diff`,`${encodeURIComponent(i)}~${encodeURIComponent(s)}`))},children:[(0,L.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-body-sm font-medium`,children:[`First run (as expected)`,(0,L.jsxs)(a,{size:`sm`,value:i,onChange:e=>o(e.target.value),children:[(0,L.jsx)(`option`,{value:``,children:`Pick a run`}),e.map(e=>(0,L.jsx)(`option`,{value:e.id,children:B(e)},e.id))]})]}),(0,L.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-body-sm font-medium`,children:[`Second run`,(0,L.jsxs)(a,{size:`sm`,value:s,onChange:e=>c(e.target.value),disabled:!i,children:[(0,L.jsx)(`option`,{value:``,children:i?`Pick a run to compare`:`Pick the first run`}),l.length>0&&(0,L.jsx)(`optgroup`,{label:`Same test`,children:l.map(e=>(0,L.jsx)(`option`,{value:e.id,children:B(e)},e.id))}),(0,L.jsx)(`optgroup`,{label:l.length?`Other runs`:`Runs`,children:u.map(e=>(0,L.jsx)(`option`,{value:e.id,children:B(e)},e.id))})]})]}),(0,L.jsxs)(_,{size:`sm`,variant:`primary`,type:`submit`,disabled:!i||!s||i===s,children:[(0,L.jsx)(C,{"aria-hidden":`true`}),`Compare`]})]})}function K({sub:e}){let[t,a]=(0,I.useState)(null),[o,c]=(0,I.useState)(null),[v,b]=(0,I.useState)(``),[C,w]=(0,I.useState)(`all`),[E,A]=(0,I.useState)(new Set),[B,V]=(0,I.useState)(``),[H,U]=(0,I.useMemo)(()=>{let t=(e?n(e):``).split(`~`);return t.length===2&&t[0]&&t[1]?[t[0],t[1]]:[void 0,void 0]},[e]);(0,I.useEffect)(()=>{u.runs().then(e=>a(e.runs),e=>b(e.message))},[]),(0,I.useEffect)(()=>{let e=!1;if(c(null),V(``),H&&U)return u.diff(H,U).then(t=>{e||(c(t),b(``),A(new Set(t.focus===void 0?[]:[t.focus])))},t=>!e&&b(t.message)),()=>{e=!0}},[H,U]);let K=async()=>{if(o)try{let{id:e}=await d.start(`Compare the browser runs ${o.a.id} and ${o.b.id} in the reports folder, step by step (their steps.json, network.json and screenshots). Say where they first differ and whether that is a product bug, a test that needs healing, test data or the environment, and what to do next.`,{});location.hash=r(`chats`,e)}catch(e){V(e.message)}},q=o?.rows??[],J=q.map((e,t)=>({r:e,i:t})).filter(({r:e})=>C===`all`||!e.same),Y=e=>e===void 0?void 0:q[e]?.b?.n??q[e]?.a?.n,X=Y(o?.first),Z=Y(o?.focus);return(0,L.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,L.jsx)(D,{}),(0,L.jsxs)(`main`,{className:s(O,`@container flex-auto gap-4`),children:[(0,L.jsx)(g,{}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,L.jsx)(k,{pixel:l[`run-diff`],size:`lg`}),(0,L.jsx)(`h1`,{className:`m-0 text-headline-lg`,children:`Runs and reports`})]}),(0,L.jsx)(T,{label:`Runs and reports`,links:M,current:`run-diff`})]}),(0,L.jsx)(N,{more:(0,L.jsx)(L.Fragment,{children:`Compare a run that passed with one that failed, the same test on two environments or devices, or a test before and after it was healed. Steps are lined up by page and action, and the first one that differs is marked with what it likely means.`}),children:`Two browser runs side by side, step by step, to see where they part.`}),v&&(0,L.jsx)(`p`,{role:`alert`,className:s(f.fail,`m-0`),children:v}),!t&&!v&&(0,L.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`}),t&&t.length<2&&(0,L.jsx)(m,{page:!0,icon:x,title:`Two runs are needed`,action:(0,L.jsxs)(`a`,{className:p({size:`sm`}),href:r(`record`),"data-tip":`Record a flow`,children:[(0,L.jsx)(y,{"aria-hidden":`true`}),`Record`]}),children:`Run a flow twice from a chat or the Record page, or a test case on two environments, and compare them here. Every browser run keeps its steps in the reports folder.`}),t&&t.length>=2&&(0,L.jsx)(G,{runs:t,a:H,b:U}),H&&U&&!o&&!v&&(0,L.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Comparing…`}),o&&(0,L.jsxs)(`section`,{"aria-label":`Comparison`,className:`flex min-w-0 flex-col gap-4`,children:[(0,L.jsxs)(P,{label:`How the runs compare`,children:[(0,L.jsx)(j,{dot:o.first===void 0?`pass`:`warn`,value:o.first===void 0?`Same`:`Differ`,label:o.first===void 0?`every step alike`:`from step ${X??`?`}`}),(0,L.jsx)(j,{dot:`warn`,value:o.counts.differing,label:`of ${q.length} steps differ`}),(0,L.jsx)(j,{dot:`neutral`,value:`${o.a.steps} · ${o.b.steps}`,label:`steps, first · second`}),(0,L.jsx)(j,{dot:`neutral`,value:`${z(o.a.ms)} · ${z(o.b.ms)}`,label:`time, first · second`}),(0,L.jsx)(j,{dot:`fail`,value:o.counts.calls,label:`calls answered otherwise`}),(0,L.jsx)(j,{dot:`fail`,value:o.counts.errors,label:`new browser errors`})]}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 gap-2 text-body-sm @2xl:grid-cols-2`,children:[o.a,o.b].map((e,t)=>(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-body-sm text-muted`,children:t?`Second run`:`First run`}),(0,L.jsx)(`span`,{className:`truncate font-medium`,"data-tip":e.goal,children:e.goal}),(0,L.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,"data-tip":e.startUrl??e.id,children:[e.status,` · `,F(e.at),` · `,e.host??e.id]})]},e.id))}),!o.sameGoal&&(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-warn`,children:`These runs had different goals: they may not be the same test.`}),o.kind&&(0,L.jsxs)(`div`,{className:s(f.warn,`flex flex-wrap items-start gap-4`),children:[(0,L.jsx)(x,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none text-warn`}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`font-medium`,children:[`Look at step `,Z??`?`,` of the second run: `,R[o.kind].label]}),(0,L.jsx)(`span`,{className:`text-ink-2`,children:R[o.kind].hint}),o.first!==o.focus&&o.first!==void 0&&q[o.first]?.kind&&(0,L.jsxs)(`span`,{className:`text-ink-2`,children:[`They first differ at step `,X,`: `,R[q[o.first].kind].label.toLowerCase(),`.`]})]}),(0,L.jsx)(`a`,{href:`#look-here`,onClick:e=>(e.preventDefault(),document.getElementById(`look-here`)?.scrollIntoView({behavior:i(),block:`center`})),className:`self-center text-body-sm`,children:`Go to it`})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,L.jsx)(h,{items:[{id:`all`,label:`All steps`,n:q.length},{id:`diff`,label:`Only differences`,n:o.counts.differing,alert:!0}],value:C,onChange:w})}),(0,L.jsxs)(_,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void K(),className:`ml-auto`,children:[(0,L.jsx)(S,{"aria-hidden":`true`}),`Chat`]})]}),B&&(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:B}),(0,L.jsxs)(`div`,{className:s(`surface rounded-lg bg-bg p-6 shadow-sm`,`overflow-hidden p-0`),children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] gap-4 bg-surface-muted px-4 py-2 text-body-sm text-muted`,children:[(0,L.jsx)(`span`,{children:`Step`}),(0,L.jsx)(`span`,{children:`First run`}),(0,L.jsx)(`span`,{children:`Second run`}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Screenshots`})]}),J.length?(0,L.jsx)(`ol`,{className:`m-0 list-none p-0`,children:J.map(({r:e,i:t})=>(0,L.jsx)(W,{row:e,i:t,a:o.a.id,b:o.b.id,focus:t===o.focus,open:E.has(t),onToggle:()=>{let e=new Set(E);e.has(t)?e.delete(t):e.add(t),A(e)}},t))}):(0,L.jsx)(`p`,{className:`m-0 border-t border-line-soft px-4 py-4 text-body-sm text-muted`,children:`Nothing differs.`})]})]})]})]})}export{R as KIND_TEXT,K as RunDiff,V as choicesFor};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./react-BDur5s0O.js";import{n,r}from"./route-oDy8sV6H.js";import{B as i,L as a,o}from"./preload-helper-BupTYkQW.js";import{t as s}from"./utils-DJRAScIl.js";import{t as c}from"./jsx-runtime-LKYXHABd.js";import{L as l}from"./palette-CeG8IIbL.js";import{Q as u,y as d}from"./api-D_HT-I9y.js";import{C as f,S as p,_ as m,f as h,n as g,x as _}from"./pageBack-DwhsvsK7.js";import{E as v,F as y,N as b,Sr as x,mn as S,mt as C,z as w}from"./line-icons-CwCZidXs.js";import{lt as T,qt as E,s as D,t as O,zt as k}from"./frame-Dt9QcYNX.js";import{t as A}from"./when-BuWCTaKm.js";import{H as j,R as M,U as N,V as P}from"./index-BdWLAq_n.js";import{g as F}from"./qualityParts-DF3ZMgo5.js";var I=e(t(),1),L=c(),R={server:{label:`The server answered differently`,hint:`A call returned another status: likely a product or backend change, not the test. File it as a defect if the first run was right.`},locator:{label:`An element was not found`,hint:`The page likely changed under the test. If the change was intended, heal the test; if not, it is a product bug.`},navigation:{label:`It reached another page`,hint:`A redirect, a sign-in, a feature flag or the environment's settings may differ between the runs.`},path:{label:`It took another path`,hint:`The run did something else here: the flow changed, or the agent found another way through it.`},data:{label:`Same step, another outcome`,hint:`The step was the same but ended otherwise: the test data, the account or what the page held likely differs.`},timing:{label:`Only the timing differs`,hint:`A slow environment, or a wait that races the page: a likely cause of flaky failures.`},errors:{label:`New browser errors`,hint:`The page raised errors in the second run that it did not in the first.`},missing:{label:`A step only one run did`,hint:`One run has a step the other does not: a dialog, a retry or a changed flow.`}},z=e=>`${(e/1e3).toFixed(1)}s`,B=e=>`${e.goal.slice(0,80)} · ${e.status} · ${A(e.at)}`;function V(e,t){let n=e.find(e=>e.id===t),r=e.filter(e=>e.id!==t);if(!n)return{same:[],other:r};let i=n.goal.trim().toLowerCase();return{same:r.filter(e=>e.goal.trim().toLowerCase()===i),other:r.filter(e=>e.goal.trim().toLowerCase()!==i)}}function H({run:e,step:t}){let[n,r]=(0,I.useState)(``),[i,a]=(0,I.useState)(!1);return(0,I.useEffect)(()=>{let n=!1;return r(``),a(!1),t?.shot&&u.shot(e,t.n,t.shot).then(e=>!n&&r(e),()=>!n&&a(!0)),()=>{n=!0}},[e,t?.n,t?.shot]),t?!t.shot||i?(0,L.jsx)(`p`,{className:s(o,`m-0 px-4 py-6 text-center text-body-sm text-muted`),children:`No screenshot`}):n?(0,L.jsx)(`img`,{src:n,alt:`Step ${t.n} of ${e}`,className:s(o,`max-h-[420px] w-full object-contain object-top`)}):(0,L.jsx)(`div`,{className:s(o,`min-h-24`)}):(0,L.jsx)(`p`,{className:s(o,`m-0 px-4 py-6 text-center text-body-sm text-muted`),children:`Not in this run`})}function U({step:e,other:t}){if(!e)return(0,L.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Not in this run`});let n=e.ok?b:w,r=new Set((t?.calls??[]).map(e=>`${e.method} ${e.path} ${e.status}`)),i=t?e.calls.filter(e=>!r.has(`${e.method} ${e.path} ${e.status}`)):[];return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,L.jsx)(n,{size:14,"aria-label":e.ok?`Passed`:`Failed`,className:s(`mt-1 flex-none`,e.ok?`text-pass`:`text-fail`)}),(0,L.jsx)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:e.action||`–`})]}),(0,L.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,"data-tip":e.title?`${e.title} · ${e.page}`:e.page,children:[e.page,typeof e.ms==`number`?` · ${z(e.ms)}`:``]}),e.error&&(0,L.jsx)(`span`,{className:`text-body-sm text-fail [overflow-wrap:anywhere]`,children:e.error}),i.slice(0,3).map(e=>(0,L.jsxs)(`span`,{className:s(`truncate font-mono text-body-sm`,e.status>=400||e.failed?`text-fail`:`text-muted`),"data-tip":`${e.method} ${e.path}`,children:[e.method,` `,e.path,` `,e.failed?`no answer`:e.status]},`${e.method} ${e.path}`)),e.problems.slice(0,2).map(e=>(0,L.jsx)(`span`,{className:`truncate text-body-sm text-warn`,"data-tip":e,children:e},e))]})}function W({row:e,i:t,a:n,b:r,focus:i,open:a,onToggle:o}){let c=e.a?.n,l=e.b?.n;return(0,L.jsxs)(`li`,{id:i?`look-here`:void 0,className:s(`border-t border-line-soft`,!e.same&&`bg-warn-soft/40`,i&&`outline-2 -outline-offset-2 outline-warn`),children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] items-start gap-4 px-4 py-2 text-body-sm`,children:[(0,L.jsx)(`span`,{className:`pt-1 text-muted tabular-nums`,"data-tip":c!==void 0&&l!==void 0&&c!==l?`Step ${c} of the first run, ${l} of the second`:void 0,children:c!==void 0&&l!==void 0&&c!==l?`${c}·${l}`:c??l??t+1}),(0,L.jsx)(U,{step:e.a,other:e.b}),(0,L.jsx)(U,{step:e.b,other:e.a}),(0,L.jsx)(_,{variant:`icon`,size:`icon-sm`,"aria-label":a?`Hide screenshots`:`Show screenshots`,"aria-expanded":a,onClick:o,"data-tip":a?`Hide screenshots`:`Show screenshots`,children:(0,L.jsx)(v,{"aria-hidden":`true`,className:s(`transition-transform`,a&&`rotate-180`)})})]}),!e.same&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pb-2 pl-[3.75rem] text-body-sm text-ink-2`,children:[i&&e.kind&&(0,L.jsxs)(`span`,{className:`font-medium text-warn`,children:[`Look here first: `,R[e.kind].label]}),e.differences.map(e=>(0,L.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e},e))]}),(0,L.jsx)(E,{open:a,children:(0,L.jsxs)(`div`,{className:`grid grid-cols-1 items-start gap-4 px-4 pb-4 @2xl:grid-cols-2`,children:[(0,L.jsx)(H,{run:n,step:e.a}),(0,L.jsx)(H,{run:r,step:e.b})]})})]})}function G({runs:e,a:t,b:n}){let[i,o]=(0,I.useState)(t??``),[s,c]=(0,I.useState)(n??``);(0,I.useEffect)(()=>{o(t??``),c(n??``)},[t,n]);let{same:l,other:u}=V(e,i);return(0,L.jsxs)(`form`,{className:`flex flex-wrap items-end gap-2`,onSubmit:e=>{e.preventDefault(),i&&s&&i!==s&&(location.hash=r(`run-diff`,`${encodeURIComponent(i)}~${encodeURIComponent(s)}`))},children:[(0,L.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-body-sm font-medium`,children:[`First run (as expected)`,(0,L.jsxs)(a,{size:`sm`,value:i,onChange:e=>o(e.target.value),children:[(0,L.jsx)(`option`,{value:``,children:`Pick a run`}),e.map(e=>(0,L.jsx)(`option`,{value:e.id,children:B(e)},e.id))]})]}),(0,L.jsxs)(`label`,{className:`flex min-w-0 flex-[1_1_280px] flex-col gap-1 text-body-sm font-medium`,children:[`Second run`,(0,L.jsxs)(a,{size:`sm`,value:s,onChange:e=>c(e.target.value),disabled:!i,children:[(0,L.jsx)(`option`,{value:``,children:i?`Pick a run to compare`:`Pick the first run`}),l.length>0&&(0,L.jsx)(`optgroup`,{label:`Same test`,children:l.map(e=>(0,L.jsx)(`option`,{value:e.id,children:B(e)},e.id))}),(0,L.jsx)(`optgroup`,{label:l.length?`Other runs`:`Runs`,children:u.map(e=>(0,L.jsx)(`option`,{value:e.id,children:B(e)},e.id))})]})]}),(0,L.jsxs)(_,{size:`sm`,variant:`primary`,type:`submit`,disabled:!i||!s||i===s,children:[(0,L.jsx)(C,{"aria-hidden":`true`}),`Compare`]})]})}function K({sub:e}){let[t,a]=(0,I.useState)(null),[o,c]=(0,I.useState)(null),[v,b]=(0,I.useState)(``),[C,w]=(0,I.useState)(`all`),[E,A]=(0,I.useState)(new Set),[B,V]=(0,I.useState)(``),[H,U]=(0,I.useMemo)(()=>{let t=(e?n(e):``).split(`~`);return t.length===2&&t[0]&&t[1]?[t[0],t[1]]:[void 0,void 0]},[e]);(0,I.useEffect)(()=>{u.runs().then(e=>a(e.runs),e=>b(e.message))},[]),(0,I.useEffect)(()=>{let e=!1;if(c(null),V(``),H&&U)return u.diff(H,U).then(t=>{e||(c(t),b(``),A(new Set(t.focus===void 0?[]:[t.focus])))},t=>!e&&b(t.message)),()=>{e=!0}},[H,U]);let K=async()=>{if(o)try{let{id:e}=await d.start(`Compare the browser runs ${o.a.id} and ${o.b.id} in the reports folder, step by step (their steps.json, network.json and screenshots). Say where they first differ and whether that is a product bug, a test that needs healing, test data or the environment, and what to do next.`,{});location.hash=r(`chats`,e)}catch(e){V(e.message)}},q=o?.rows??[],J=q.map((e,t)=>({r:e,i:t})).filter(({r:e})=>C===`all`||!e.same),Y=e=>e===void 0?void 0:q[e]?.b?.n??q[e]?.a?.n,X=Y(o?.first),Z=Y(o?.focus);return(0,L.jsxs)(`div`,{className:`flex min-h-(--screen) flex-col`,children:[(0,L.jsx)(D,{}),(0,L.jsxs)(`main`,{className:s(O,`@container flex-auto gap-4`),children:[(0,L.jsx)(g,{}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-2`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-4`,children:[(0,L.jsx)(k,{pixel:l[`run-diff`],size:`lg`}),(0,L.jsx)(`h1`,{className:`m-0 text-headline-lg`,children:`Runs and reports`})]}),(0,L.jsx)(T,{label:`Runs and reports`,links:M,current:`run-diff`})]}),(0,L.jsx)(N,{more:(0,L.jsx)(L.Fragment,{children:`Compare a run that passed with one that failed, the same test on two environments or devices, or a test before and after it was healed. Steps are lined up by page and action, and the first one that differs is marked with what it likely means.`}),children:`Two browser runs side by side, step by step, to see where they part.`}),v&&(0,L.jsx)(`p`,{role:`alert`,className:s(f.fail,`m-0`),children:v}),!t&&!v&&(0,L.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`}),t&&t.length<2&&(0,L.jsx)(m,{page:!0,icon:x,title:`Two runs are needed`,action:(0,L.jsxs)(`a`,{className:p({size:`sm`}),href:r(`record`),"data-tip":`Record a flow`,children:[(0,L.jsx)(y,{"aria-hidden":`true`}),`Record`]}),children:`Run a flow twice from a chat or the Record page, or a test case on two environments, and compare them here. Every browser run keeps its steps in the reports folder.`}),t&&t.length>=2&&(0,L.jsx)(G,{runs:t,a:H,b:U}),H&&U&&!o&&!v&&(0,L.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Comparing…`}),o&&(0,L.jsxs)(`section`,{"aria-label":`Comparison`,className:`flex min-w-0 flex-col gap-4`,children:[(0,L.jsxs)(P,{label:`How the runs compare`,children:[(0,L.jsx)(j,{dot:o.first===void 0?`pass`:`warn`,value:o.first===void 0?`Same`:`Differ`,label:o.first===void 0?`every step alike`:`from step ${X??`?`}`}),(0,L.jsx)(j,{dot:`warn`,value:o.counts.differing,label:`of ${q.length} steps differ`}),(0,L.jsx)(j,{dot:`neutral`,value:`${o.a.steps} · ${o.b.steps}`,label:`steps, first · second`}),(0,L.jsx)(j,{dot:`neutral`,value:`${z(o.a.ms)} · ${z(o.b.ms)}`,label:`time, first · second`}),(0,L.jsx)(j,{dot:`fail`,value:o.counts.calls,label:`calls answered otherwise`}),(0,L.jsx)(j,{dot:`fail`,value:o.counts.errors,label:`new browser errors`})]}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 gap-2 text-body-sm @2xl:grid-cols-2`,children:[o.a,o.b].map((e,t)=>(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsx)(`span`,{className:`text-body-sm text-muted`,children:t?`Second run`:`First run`}),(0,L.jsx)(`span`,{className:`truncate font-medium`,"data-tip":e.goal,children:e.goal}),(0,L.jsxs)(`span`,{className:`truncate text-body-sm text-muted`,"data-tip":e.startUrl??e.id,children:[e.status,` · `,F(e.at),` · `,e.host??e.id]})]},e.id))}),!o.sameGoal&&(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-warn`,children:`These runs had different goals: they may not be the same test.`}),o.kind&&(0,L.jsxs)(`div`,{className:s(f.warn,`flex flex-wrap items-start gap-4`),children:[(0,L.jsx)(x,{size:16,"aria-hidden":`true`,className:`mt-1 flex-none text-warn`}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-[1_1_300px] flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`font-medium`,children:[`Look at step `,Z??`?`,` of the second run: `,R[o.kind].label]}),(0,L.jsx)(`span`,{className:`text-ink-2`,children:R[o.kind].hint}),o.first!==o.focus&&o.first!==void 0&&q[o.first]?.kind&&(0,L.jsxs)(`span`,{className:`text-ink-2`,children:[`They first differ at step `,X,`: `,R[q[o.first].kind].label.toLowerCase(),`.`]})]}),(0,L.jsx)(`a`,{href:`#look-here`,onClick:e=>(e.preventDefault(),document.getElementById(`look-here`)?.scrollIntoView({behavior:i(),block:`center`})),className:`self-center text-body-sm`,children:`Go to it`})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,L.jsx)(h,{items:[{id:`all`,label:`All steps`,n:q.length},{id:`diff`,label:`Only differences`,n:o.counts.differing,alert:!0}],value:C,onChange:w})}),(0,L.jsxs)(_,{size:`sm`,variant:`ghost`,"data-tip":`Ask in a chat`,onClick:()=>void K(),className:`ml-auto`,children:[(0,L.jsx)(S,{"aria-hidden":`true`}),`Chat`]})]}),B&&(0,L.jsx)(`p`,{className:`m-0 text-body-sm text-fail`,children:B}),(0,L.jsxs)(`div`,{className:s(`surface rounded-lg bg-bg p-6 shadow-sm`,`overflow-hidden p-0`),children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-[2.5rem_minmax(0,1fr)_minmax(0,1fr)_2.5rem] gap-4 bg-surface-muted px-4 py-2 text-body-sm text-muted`,children:[(0,L.jsx)(`span`,{children:`Step`}),(0,L.jsx)(`span`,{children:`First run`}),(0,L.jsx)(`span`,{children:`Second run`}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Screenshots`})]}),J.length?(0,L.jsx)(`ol`,{className:`m-0 list-none p-0`,children:J.map(({r:e,i:t})=>(0,L.jsx)(W,{row:e,i:t,a:o.a.id,b:o.b.id,focus:t===o.focus,open:E.has(t),onToggle:()=>{let e=new Set(E);e.has(t)?e.delete(t):e.add(t),A(e)}},t))}):(0,L.jsx)(`p`,{className:`m-0 border-t border-line-soft px-4 py-4 text-body-sm text-muted`,children:`Nothing differs.`})]})]})]})]})}export{R as KIND_TEXT,K as RunDiff,V as choicesFor};
|