@capagents/forgeqe 3.2.7 → 3.2.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 +2 -2
- package/dist/web/assets/{3d-force-graph-CUGt_TSW.js → 3d-force-graph-CbGbqGhp.js} +1 -1
- package/dist/web/assets/Agent-g57O0gf2.js +8 -0
- package/dist/web/assets/{AgentWork-BpfMY_xu.js → AgentWork-DEZxLOeM.js} +1 -1
- package/dist/web/assets/ApiTests-DhxqD5GK.js +15 -0
- package/dist/web/assets/Browse-DfvSk_5f.js +1 -0
- package/dist/web/assets/Chat-CuuX_MnF.js +3 -0
- package/dist/web/assets/{CommandPalette-CKJHtRjo.js → CommandPalette-DLXhO1e4.js} +1 -1
- package/dist/web/assets/{Compare-DtW2g-qb.js → Compare-DFRzCXyA.js} +1 -1
- package/dist/web/assets/{Cost-DW-kVEL8.js → Cost-CZ1xMPze.js} +1 -1
- package/dist/web/assets/Data-jxeBry5m.js +6 -0
- package/dist/web/assets/Desktop-4S45Nhc5.js +1 -0
- package/dist/web/assets/DesktopReview-CUyNT0Hl.js +2 -0
- package/dist/web/assets/{DeviceScreen-DzVNfMwl.js → DeviceScreen-DlJqIxZ-.js} +1 -1
- package/dist/web/assets/Evidence-BP-fY7HX.js +1 -0
- package/dist/web/assets/{Explore-ChpAuezG.js → Explore-DY5e98Jz.js} +2 -2
- package/dist/web/assets/Features-CKpQ7ilm.js +1 -0
- package/dist/web/assets/{Flags-Do-pvmCF.js → Flags-CLm40jFw.js} +2 -2
- package/dist/web/assets/Flaky-CQx5RPZt.js +1 -0
- package/dist/web/assets/Impact-DsvECtFV.js +3 -0
- package/dist/web/assets/Jobs-Dzgeugby.js +5 -0
- package/dist/web/assets/KindPage-Dy8mhe14.js +6 -0
- package/dist/web/assets/{LiveDevice-OyxEiqBt.js → LiveDevice-DGXIulGh.js} +1 -1
- package/dist/web/assets/Migration-ecdFw6JR.js +8 -0
- package/dist/web/assets/Mobile-89JRhyfb.js +1 -0
- package/dist/web/assets/{Observability-DdTOLp2C.js → Observability-BTxPNYcK.js} +1 -1
- package/dist/web/assets/PageAgent-CtHfmMj1.js +1 -0
- package/dist/web/assets/Product-DutzjAnI.js +12 -0
- package/dist/web/assets/{Production-oTXhv40a.js → Production-DVc4vly0.js} +1 -1
- package/dist/web/assets/Quality-DDRPOOgr.js +1 -0
- package/dist/web/assets/{Readiness-Bv9uTTiI.js → Readiness-BRtsOnY7.js} +1 -1
- package/dist/web/assets/Record-BgX9IgVU.js +1 -0
- package/dist/web/assets/Regression-B5TZmljh.js +5 -0
- package/dist/web/assets/{RelationGraph-BQl3M4zd.js → RelationGraph-Bf7JxnoO.js} +1 -1
- package/dist/web/assets/Reports-Ckul-6_Z.js +2 -0
- package/dist/web/assets/Responsive-BuFvnY-7.js +3 -0
- package/dist/web/assets/{RunDiff-BBT1sQLh.js → RunDiff-lbzcjQPB.js} +1 -1
- package/dist/web/assets/Settings-DICPHvyS.js +21 -0
- package/dist/web/assets/{Steps-C_vL6-8p.js → Steps-Bgta9n5a.js} +3 -3
- package/dist/web/assets/TestData-DhzYxkRb.js +2 -0
- package/dist/web/assets/TestManagement-DOTikKBJ.js +4 -0
- package/dist/web/assets/{WhatsNew-DTcaqdOJ.js → WhatsNew-BNpscacD.js} +1 -1
- package/dist/web/assets/{agentSettingsSheet-DM1aa237.js → agentSettingsSheet-CE2-cOUE.js} +1 -1
- package/dist/web/assets/{choice-B6z9CWyZ.js → choice-DPE-97iI.js} +1 -1
- package/dist/web/assets/{coverage-BhtF065n.js → coverage-8y4Ntf5j.js} +4 -4
- package/dist/web/assets/{dataParts-BNDVxwFb.js → dataParts-BWLBAktB.js} +3 -3
- package/dist/web/assets/desktopAppPath-CNgKUGx-.js +1 -0
- package/dist/web/assets/frame-CILGAQMi.js +13 -0
- package/dist/web/assets/index-CAiu49as.css +2 -0
- package/dist/web/assets/index-jQktxp_0.js +56 -0
- package/dist/web/assets/{markdown-BhU7ng6c.js → markdown-C3_rYFsI.js} +4 -4
- package/dist/web/assets/pageBack-CpPsn9m9.js +3 -0
- package/dist/web/assets/{palette-BsY8OLxd.js → palette-B4gvOIk7.js} +1 -1
- package/dist/web/assets/{paletteCommands-DflHQ05x.js → paletteCommands-Df6J2Ddx.js} +1 -1
- package/dist/web/assets/parts-CoaptHZw.js +1 -0
- package/dist/web/assets/{preload-helper-qorOEK5q.js → preload-helper-Bjdk4wEa.js} +1 -1
- package/dist/web/assets/{productParts-Dxl-TQKY.js → productParts-yX7pkb5g.js} +1 -1
- package/dist/web/assets/{qualityParts-ClGKtjEv.js → qualityParts-DfUjhv4u.js} +1 -1
- package/dist/web/assets/{radio-DDxnnflQ.js → radio-BerZ8bce.js} +1 -1
- package/dist/web/assets/{recordTest-B33rIncn.js → recordTest-CYjGtHjQ.js} +1 -1
- package/dist/web/assets/{route-D9uPlFWw.js → route-M6BKgobp.js} +1 -1
- package/dist/web/assets/{sectionList-e5mFDaS2.js → sectionList-K06uJ9W7.js} +1 -1
- package/dist/web/assets/{stepper-DSDz0uu8.js → stepper-yRhSVs0I.js} +1 -1
- package/dist/web/index.html +9 -9
- package/package.json +1 -1
- package/dist/web/assets/Agent-DiX8ljlC.js +0 -8
- package/dist/web/assets/ApiTests-4jfzlfVd.js +0 -15
- package/dist/web/assets/Browse-ByDemInL.js +0 -1
- package/dist/web/assets/Chat-C3wKV0CI.js +0 -3
- package/dist/web/assets/Data--HGneNun.js +0 -6
- package/dist/web/assets/Desktop-DQf5gv7D.js +0 -1
- package/dist/web/assets/DesktopReview-BaPYt0kl.js +0 -2
- package/dist/web/assets/Evidence-CxRMnZch.js +0 -1
- package/dist/web/assets/Features-VsLb8QTH.js +0 -1
- package/dist/web/assets/Flaky-CyhTszAg.js +0 -1
- package/dist/web/assets/Impact-BWBAXRuw.js +0 -3
- package/dist/web/assets/Jobs-C_MjXv0_.js +0 -5
- package/dist/web/assets/KindPage-Bb3Kp4-q.js +0 -6
- package/dist/web/assets/Migration-C80mGA3h.js +0 -8
- package/dist/web/assets/Mobile-C4wVBYfr.js +0 -1
- package/dist/web/assets/PageAgent-Bi53-H99.js +0 -1
- package/dist/web/assets/Product-0LXndvp-.js +0 -12
- package/dist/web/assets/Quality-CY0CJF9e.js +0 -1
- package/dist/web/assets/Record-C-kyOkYq.js +0 -1
- package/dist/web/assets/Regression-CwKxvG1h.js +0 -5
- package/dist/web/assets/Reports-Ck8rc3br.js +0 -2
- package/dist/web/assets/Responsive-COmV2NXo.js +0 -3
- package/dist/web/assets/Settings-7aMk9Sqx.js +0 -21
- package/dist/web/assets/TestData-KzMy9N9f.js +0 -2
- package/dist/web/assets/TestManagement-BCEhOGB9.js +0 -4
- package/dist/web/assets/desktopAppPath-D4hHP56R.js +0 -1
- package/dist/web/assets/frame-CNYHTG4T.js +0 -13
- package/dist/web/assets/index-B1Q2Dlqw.js +0 -56
- package/dist/web/assets/index-sxUpjgyw.css +0 -2
- package/dist/web/assets/pageBack-BoSbGSU6.js +0 -3
- package/dist/web/assets/parts-C4QMgN_N.js +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Cn as t,Dr as n,G as r,L as i,Mt as a,Qn as o,Rn as s,St as c,U as l,Ur as u,Vn as d,Yt as f,Zn as p,Zt as m,bt as h,cn as g,k as _,kr as v,l as y,ln as ee,nn as b,or as x,qr as S,r as C,u as w,ur as T,vr as E,wn as D,wr as O,yn as k}from"./route-D9uPlFWw.js";import{D as A,E as j,Ht as M,K as N,O as te,Vt as P,qt as ne,ut as re}from"./preload-helper-qorOEK5q.js";import{t as F}from"./jsx-runtime-LKYXHABd.js";import{d as ie}from"./sectionList-e5mFDaS2.js";import{E as ae,F as I,N as L,O as oe,c as R,i as z,j as B,l as V,n as se,s as ce,v as le}from"./pageBack-BoSbGSU6.js";import{Ct as ue,Gt as de,Kt as H,St as U,bt as W,dt as fe,gt as pe,ht as G,qt as K,ut as me,vt as q,xt as he,yt as ge}from"./frame-CNYHTG4T.js";import{t as _e}from"./when-BuWCTaKm.js";import{G as ve,U as ye,W as be,a as xe,n as Se,t as Ce}from"./index-B1Q2Dlqw.js";import{i as we,s as Te,t as Ee}from"./parts-C4QMgN_N.js";import{t as De}from"./stepper-DSDz0uu8.js";var J=e(S(),1),Y={browserstack:`BrowserStack`,testmu:`TestMu AI`},Oe=/^rsp-\d{8}-\d{6}-[0-9a-f]{4}$/,X={info:()=>N(`GET`,`/api/responsive`),runs:()=>N(`GET`,`/api/responsive/runs`),run:e=>N(`GET`,`/api/responsive/runs/${encodeURIComponent(e)}`),shot:(e,t)=>re(`/api/responsive/runs/${encodeURIComponent(e)}/shots/${encodeURIComponent(t)}`,`image/jpeg`),start:e=>N(`POST`,`/api/responsive/runs`,e),stop:e=>N(`POST`,`/api/responsive/runs/${encodeURIComponent(e)}/stop`,{}),flows:()=>N(`GET`,`/api/responsive/flows`),saveFlow:(e,t,n=!1)=>N(`POST`,`/api/responsive/flows`,{label:e,prompt:t,replace:n}),cloudDevices:(e,t=!1)=>N(`GET`,`/api/responsive/clouds/${e}/devices${t?`?fresh=1`:``}`),cases:e=>N(`GET`,`/api/responsive/cases?q=${encodeURIComponent(e)}`),caseSteps:e=>N(`GET`,`/api/responsive/case?key=${encodeURIComponent(e)}`)};function ke(e,t=`600px`){let[n,r]=(0,J.useState)(()=>typeof IntersectionObserver>`u`);return(0,J.useEffect)(()=>{let i=e.current;if(n||!i)return;let a=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(r(!0),a.disconnect())},{rootMargin:t});return a.observe(i),()=>a.disconnect()},[e,n,t]),n}var Z=F(),Ae={phone:x,tablet:E,desktop:t};function je({devices:e,picked:t,max:n,onChange:r,drawnBy:i,real:a}){let[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(`all`),u=o.trim().toLowerCase(),d=e.filter(e=>(c===`all`||e.category===c)&&(!u||`${e.label} ${e.os??``} ${e.width}x${e.height} ${e.width}×${e.height}`.toLowerCase().includes(u))),f=t.length>=n,p=t=>e.filter(e=>e.category===t).length;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,Z.jsx)(ce,{id:`rp-search`,label:`Search devices`,value:o,onChange:s,placeholder:`iPhone, Pixel, 1920…`,className:`flex-none`}),(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which devices to list`,children:(0,Z.jsx)(z,{value:c,onChange:l,items:[{id:`all`,label:`All`,n:e.length},{id:`phone`,label:`Phones`,n:p(`phone`)},{id:`tablet`,label:`Tablets`,n:p(`tablet`)},...a?[]:[{id:`desktop`,label:`Desktops`,n:p(`desktop`)}]]})})]}),(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:[t.length,` of `,n,` picked`,f?`: remove one to add another.`:`.`,` `,a?`Real devices on ${a}, as it lists them now: each is its own session of your plan, and a real browser (Safari on iOS, Chrome on Android).`:(0,Z.jsxs)(Z.Fragment,{children:[`Each is emulated in full (size, pixel ratio, touch, user agent)`,i?` and drawn by ${i}.`:` and drawn by Chromium, so a Safari-only difference does not show.`]})]}),d.length?(0,Z.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-1 gap-2 p-0 @3xl:grid-cols-2`,children:d.map(e=>{let n=t.includes(e.id);return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`label`,{className:P(ne,`gap-2`,!n&&f&&`cursor-not-allowed text-muted hover:bg-transparent hover:text-muted`),children:[(0,Z.jsx)(ye,{checked:n,disabled:!n&&f,onCheckedChange:n=>r(n?[...t,e.id]:t.filter(t=>t!==e.id))}),(0,Z.jsx)(B,{icon:Ae[e.category],size:16,className:`flex-none text-muted`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label}),(0,Z.jsx)(`span`,{className:`ml-auto flex-none text-body-sm text-muted`,children:e.os??`${e.width}×${e.height} · ${e.scale}x`})]})},e.id)})}):(0,Z.jsxs)(V,{children:[`No device matches “`,o,`”.`]})]})}function Me({results:e}){return(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm`,"aria-label":`What happened on each device`,children:e.map(e=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2`,children:[(0,Z.jsx)(B,{icon:e.skipped?m:e.ok?i:l,size:16,className:P(`mt-1 flex-none`,e.skipped?`text-muted`:e.ok?`text-pass`:`text-fail`)}),(0,Z.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,Z.jsx)(`strong`,{className:`font-medium`,children:e.label}),(0,Z.jsxs)(`span`,{className:`text-muted`,children:[` `,`· `,e.skipped?`nothing to do on this layout`:`${e.done} of ${M(e.of,`step`)}`]}),e.error&&(0,Z.jsx)(`span`,{className:`block text-muted`,children:e.error})]})]},e.device))})}var Ne={running:{label:`Running`,tone:`running`},done:{label:`Done`,tone:`pass`},stopped:{label:`Stopped`,tone:`neutral`},failed:{label:`Failed`,tone:`fail`}},Pe=e=>{try{let t=new URL(e);return`${t.host}${t.pathname===`/`?``:t.pathname}`}catch{return e}},Fe=e=>e.status===`running`?`running`:e.findings?`findings`:`clean`;function Ie({rows:e}){let[t,n]=(0,J.useState)(`all`),r=t=>t===`all`?e.length:e.filter(e=>Fe(e)===t).length,i=e.filter(e=>t===`all`||Fe(e)===t),a=e=>location.hash=C(`responsive`,e);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Te,{children:[(0,Z.jsx)(we,{label:`All`,value:r(`all`),onClick:()=>n(`all`),on:t===`all`}),(0,Z.jsx)(we,{label:`Running`,value:r(`running`),onClick:()=>n(`running`),on:t===`running`}),(0,Z.jsx)(we,{label:`With findings`,value:r(`findings`),tone:r(`findings`)?`text-warn`:void 0,onClick:()=>n(`findings`),on:t===`findings`}),(0,Z.jsx)(we,{label:`Clean`,value:r(`clean`),tone:r(`clean`)?`text-pass`:void 0,onClick:()=>n(`clean`),on:t===`clean`})]}),(0,Z.jsx)(G,{label:`Runs`,placeholder:`Find a run`,empty:t===`all`?`No runs.`:`None here.`,resetKey:t,height:pe,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Page`}),(0,Z.jsx)(`th`,{scope:`col`,className:P(W,`hidden @xl:table-cell`),children:`Devices`}),(0,Z.jsx)(`th`,{scope:`col`,className:P(W,`hidden @3xl:table-cell`),children:`How`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Findings`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Status`}),(0,Z.jsx)(`th`,{scope:`col`,className:P(W,`hidden @xl:table-cell`),children:`When`})]}),children:i.map(e=>{let t=Ne[e.status];return(0,Z.jsxs)(`tr`,{onClick:()=>a(e.id),className:ue,children:[(0,Z.jsxs)(`td`,{className:q,children:[(0,Z.jsx)(`a`,{href:C(`responsive`,e.id),onClick:e=>e.stopPropagation(),className:`font-medium text-ink no-underline [overflow-wrap:anywhere] hover:underline`,children:Pe(e.url)}),(0,Z.jsx)(`span`,{className:`block text-body-sm text-muted`,children:e.id})]}),(0,Z.jsxs)(`td`,{className:P(q,`hidden text-body-sm text-ink-2 @xl:table-cell`),children:[e.devices,e.on?(0,Z.jsxs)(`span`,{className:`block text-muted`,children:[`on `,Y[e.on]]}):null]}),(0,Z.jsx)(`td`,{className:P(q,`hidden text-body-sm text-ink-2 @3xl:table-cell`),children:e.mode===`guided`?`Guided, ${e.steps} step${e.steps===1?``:`s`}`:`Interactive${e.steps?`, ${e.steps} instruction${e.steps===1?``:`s`}`:``}`}),(0,Z.jsx)(`td`,{className:P(q,`text-body-sm whitespace-nowrap`),"data-sort":(e.high||0)*1e3+(e.findings||0),children:e.findings?(0,Z.jsxs)(`span`,{className:e.high?`text-fail`:`text-warn`,children:[e.findings,e.high?` · ${e.high} high`:``]}):e.status===`running`?(0,Z.jsx)(`span`,{className:`text-muted`,children:`So far none`}):(0,Z.jsx)(`span`,{className:`text-pass`,children:`None`})}),(0,Z.jsx)(`td`,{className:P(q,`whitespace-nowrap`),children:(0,Z.jsx)(R,{tone:t.tone,children:t.label})}),(0,Z.jsx)(`td`,{className:P(q,`hidden text-body-sm whitespace-nowrap text-muted @xl:table-cell`),"data-sort":new Date(e.endedAt||e.startedAt).getTime()||0,children:_e(e.endedAt||e.startedAt)})]},e.id)})})]})}var Le={high:{label:`High`,tone:`fail`},medium:{label:`Medium`,tone:`warn`},low:{label:`Low`,tone:`neutral`}},Re=1500,ze={chrome:`Chrome`,edge:`Edge`,firefox:`Firefox`,webkit:`WebKit`};function Be({id:e,file:t,label:n,className:r,onOpen:i,thumb:a}){let[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(!1),u=(0,J.useRef)(null),d=ke(u);(0,J.useEffect)(()=>{if(!d)return;let n=!1;return X.shot(e,t).then(e=>!n&&s(e),()=>!n&&l(!0)),()=>{n=!0}},[e,t,d]);let f=c?(0,Z.jsx)(`span`,{className:`grid min-h-24 place-items-center text-body-sm text-muted`,children:`No picture`}):o?(0,Z.jsx)(`img`,{src:o,alt:`${n} screenshot`,className:P(`block w-full object-top`,a?`h-24 object-cover`:`object-contain`)}):(0,Z.jsx)(`span`,{className:`block min-h-24`});return i?(0,Z.jsx)(`button`,{ref:u,type:`button`,onClick:i,"aria-label":`Show the ${n} screenshot larger`,"data-tip":`Show larger`,className:P(ae,`block cursor-zoom-in overflow-hidden border-0 p-0`,r),children:f}):(0,Z.jsx)(`div`,{ref:u,className:P(ae,`overflow-hidden`,r),children:f})}var Ve=[`high`,`medium`,`low`],He={sideways:`Scrolls sideways`,small_text:`Text under 12px`,small_targets:`Tap targets under 24px`,broken_images:`Broken images`},Q=e=>e.check.startsWith(`custom-`),$=e=>Q(e)?e.title:He[e.check]??e.title,Ue=e=>{let t=e.steps.filter(e=>e>0);return t.length?`${t.length<e.steps.length?`Start, step`:`Step`}${t.length>1?`s`:``} ${t.join(`, `)}`:`At the start`};function We({run:e,onOpen:t}){let[n,r]=(0,J.useState)(`all`),i=t=>t===`all`?e.findings.length:e.findings.filter(e=>e.severity===t).length;if(!e.findings.length)return(0,Z.jsx)(V,{icon:_,title:e.status===`running`?`Nothing found so far`:`Nothing found`,children:e.status===`running`?`Each device is checked after every step; findings show here as they are made.`:`Every device passed the checks at each of the run's ${M(e.steps.length,`step`)}.`});let a=e.findings.filter(e=>n===`all`||e.severity===n).sort((e,t)=>Ve.indexOf(e.severity)-Ve.indexOf(t.severity)||Math.min(...e.steps)-Math.min(...t.steps));return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which findings to show`,children:(0,Z.jsx)(z,{value:n,onChange:r,items:[{id:`all`,label:`All`,n:i(`all`)},{id:`high`,label:`High`,n:i(`high`)},{id:`medium`,label:`Medium`,n:i(`medium`)},{id:`low`,label:`Low`,n:i(`low`)}]})}),(0,Z.jsx)(G,{label:`Findings`,placeholder:`Find a finding`,empty:`None here.`,resetKey:n,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Finding`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Severity`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Device`}),(0,Z.jsx)(`th`,{scope:`col`,className:P(W,`hidden @xl:table-cell`),children:`When`})]}),children:a.map(e=>{let n=Le[e.severity];return(0,Z.jsxs)(`tr`,{onClick:()=>t(e),className:ue,children:[(0,Z.jsxs)(`td`,{className:q,children:[(0,Z.jsx)(L,{variant:`link`,size:`inline`,onClick:n=>(n.stopPropagation(),t(e)),className:`whitespace-normal text-left [overflow-wrap:anywhere]`,children:Q(e)?`“${$(e)}”`:$(e)}),(0,Z.jsx)(`span`,{className:`block text-body-sm text-muted [overflow-wrap:anywhere]`,children:Q(e)?`Your check`:e.title===$(e)?e.detail:e.title})]}),(0,Z.jsx)(`td`,{className:P(q,`whitespace-nowrap`),"data-sort":{high:3,medium:2,low:1}[e.severity]??0,children:(0,Z.jsx)(R,{tone:n.tone,icon:!1,children:n.label})}),(0,Z.jsx)(`td`,{className:P(q,`text-body-sm whitespace-nowrap`),children:(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Z.jsx)(B,{icon:Ae[e.layout],size:16,className:`flex-none text-muted`}),e.label]})}),(0,Z.jsx)(`td`,{className:P(q,`hidden text-body-sm whitespace-nowrap text-muted @xl:table-cell`),"data-sort":e.steps.length?Math.min(...e.steps):0,children:Ue(e)})]},e.id)})})]})}function Ge({f:e,run:t,onOpen:n}){let r=t.findings.filter(t=>t.check===e.check&&t.id!==e.id);return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 pt-4`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-body-sm`,children:[(0,Z.jsx)(R,{tone:Le[e.severity].tone,icon:!1,children:Le[e.severity].label}),(0,Z.jsx)(B,{icon:Ae[e.layout],size:16,className:`flex-none text-muted`}),(0,Z.jsx)(`strong`,{className:`font-medium`,children:e.label}),(0,Z.jsx)(`span`,{className:`text-body-sm text-muted`,children:Ue(e)})]}),e.title!==$(e)&&(0,Z.jsx)(`p`,{className:`m-0 text-body-sm font-medium [overflow-wrap:anywhere]`,children:e.title}),e.detail&&(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2 [overflow-wrap:anywhere]`,children:e.detail}),e.quote&&(0,Z.jsxs)(`p`,{className:P(I.info,`m-0`),children:[`On the screen: “`,e.quote,`”`]}),(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm text-ink-2`,children:e.steps.map(e=>(0,Z.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e?`Step ${e}: ${t.steps.find(t=>t.n===e)?.instruction??``}`:`When the page opened`},e))}),e.shot?(0,Z.jsx)(Be,{id:t.id,file:e.shot,label:e.label},e.shot):(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No screenshot for this finding.`}),r.length>0&&(0,Z.jsx)(be,{id:`rp-others`,level:3,icon:x,title:(0,Z.jsxs)(Z.Fragment,{children:[`Also on `,M(new Set(r.map(e=>e.device)).size,`other device`)]}),children:(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-2 p-0`,children:r.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(L,{size:`sm`,onClick:()=>n(e),"data-tip":`Show it on ${e.label}`,children:[(0,Z.jsx)(B,{icon:Ae[e.layout],size:16,"aria-hidden":`true`}),e.label]})},e.id))})})]})}function Ke({run:e,onShot:t}){let n=e.spec;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[n.prompt&&(0,Z.jsxs)(be,{id:`rp-prompt`,level:3,icon:k,title:`Your prompt`,className:P(`rounded-lg bg-bg p-6 shadow-sm`,`gap-2`),children:[(0,Z.jsx)(`p`,{className:P(`panel rounded-md bg-(--page-surface-strong) p-6`,`m-0 text-body-sm whitespace-pre-wrap [overflow-wrap:anywhere]`),children:n.prompt}),n.attachments&&n.attachments.length>0&&(0,Z.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`Attached: `,n.attachments.join(`, `)]}),(0,Z.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`Read as `,M(n.steps.length,`step`),n.custom.length?`, with ${M(n.custom.length,`check`)} of your own`:``,`: `,n.steps.join(` → `)||`none`]})]}),(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-4 p-0`,children:e.steps.map(n=>{let r=e.shots.filter(e=>e.step===n.n),i=e.findings.filter(e=>e.steps.includes(n.n)).length;return(0,Z.jsxs)(`li`,{className:P(oe,`flex min-w-0 flex-col gap-4`),children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`inline-flex size-6 flex-none items-center justify-center rounded-full bg-surface-strong text-body-sm font-medium tabular-nums`,children:n.n}),(0,Z.jsx)(`h3`,{className:`m-0 min-w-0 flex-1 text-body-lg font-medium [overflow-wrap:anywhere]`,children:n.instruction}),(0,Z.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[i?`${M(i,`finding`)}`:`No findings`,` · `,_e(n.at)]})]}),n.plan.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0 text-body-sm text-muted`,children:n.plan.map(e=>(0,Z.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:e},e))}),n.results.length>0&&(0,Z.jsx)(Me,{results:n.results}),!n.results.length&&n.note&&n.by!==`check`&&n.by!==`open`&&(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-warn [overflow-wrap:anywhere]`,children:n.note}),r.length>0&&(0,Z.jsx)(`div`,{className:`flex gap-2 overflow-x-auto pb-2`,"aria-label":`Screenshots after step ${n.n}`,children:r.map(r=>{let i=e.spec.devices.includes(r.device)?r.device:`device`;return(0,Z.jsx)(Be,{id:e.id,file:r.file,label:i,className:`w-[120px] flex-none`,onOpen:()=>t(r.file,`${i}, step ${n.n}`)},r.file)})})]},`${n.n}-${n.at}`)})})]})}function qe({run:e,onShot:t}){let n=[...new Set(e.shots.map(e=>e.step))];return n.length?(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:n.map(n=>{let r=e.steps.find(e=>e.n===n);return(0,Z.jsx)(be,{id:`rp-shots-${n}`,level:3,icon:f,title:n?`Step ${n}: ${r?.instruction??``}`:`When the page opened`,className:`gap-2`,children:(0,Z.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-2 gap-4 p-0 @3xl:grid-cols-4 @5xl:grid-cols-6`,children:e.shots.filter(e=>e.step===n).map(r=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(Be,{id:e.id,file:r.file,label:r.device,onOpen:()=>t(r.file,`${r.device}, ${n?`step ${n}`:`start`}`)}),(0,Z.jsx)(`span`,{className:`truncate text-body-sm text-muted`,children:r.device})]},r.file))})},n)})}):(0,Z.jsx)(V,{children:`No screenshots were kept.`})}function Je({log:e}){let[t,r]=(0,J.useState)(`all`),i=e.filter(e=>e.level!==`info`),a=t===`all`?e:i;return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,role:`group`,"aria-label":`Which lines to show`,children:(0,Z.jsx)(z,{value:t,onChange:r,items:[{id:`all`,label:`Everything`,n:e.length},{id:`problems`,label:`Errors and warnings`,n:i.length}]})}),a.length?(0,Z.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,"aria-label":`Log`,children:a.map((e,t)=>(0,Z.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 border-t border-line-soft py-2 text-body-sm first:border-t-0`,children:[(0,Z.jsx)(B,{icon:e.level===`error`?l:e.level===`warn`?n:m,size:16,className:P(`mt-1 flex-none`,e.level===`error`?`text-fail`:e.level===`warn`?`text-warn`:`text-muted`)}),(0,Z.jsx)(`span`,{className:`w-[72px] flex-none text-muted tabular-nums`,children:new Date(e.at).toLocaleTimeString()}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 [overflow-wrap:anywhere]`,children:e.text})]},`${e.at}-${t}`))}):(0,Z.jsx)(V,{children:t===`all`?`Nothing logged yet.`:`No errors or warnings.`})]})}function Ye({run:e}){let t=e.steps.toReversed();return(0,Z.jsx)(G,{label:`Devices`,placeholder:`Find a device`,empty:`No devices.`,head:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Device`}),(0,Z.jsx)(`th`,{scope:`col`,className:W,children:`Last step`}),(0,Z.jsx)(`th`,{scope:`col`,className:he,children:`Findings`})]}),children:e.spec.devices.map(n=>{let r=t.find(e=>e.results.some(e=>e.device===n)),a=r?.results.find(e=>e.device===n),o=e.findings.filter(e=>e.device===n).length,s=a?.label||e.spec.labels?.[n]||e.findings.find(e=>e.device===n)?.label||n,c=e.shots.some(e=>e.device===n);return(0,Z.jsxs)(`tr`,{className:U,children:[(0,Z.jsx)(`td`,{className:P(q,`font-medium whitespace-nowrap`),children:s}),(0,Z.jsx)(`td`,{className:P(q,`text-body-sm`),children:a?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2`,children:[(0,Z.jsx)(B,{icon:a.skipped?m:a.ok?i:l,size:16,className:P(`mt-1 flex-none`,a.skipped?`text-muted`:a.ok?`text-pass`:`text-fail`)}),(0,Z.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`Step `,r.n,`: `,a.skipped?`nothing to do on this layout`:a.ok?`done`:a.error||`did not finish`]})]}):(0,Z.jsx)(`span`,{className:`text-muted`,children:c?`Page opened`:`Opening…`})}),(0,Z.jsx)(`td`,{className:P(ge,`text-body-sm`,o?`text-warn`:`text-muted`),children:o})]},n)})})}function Xe({id:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)([]),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(null),[l,d]=(0,J.useState)(``),[m,g]=(0,J.useState)(!1),[_,v]=(0,J.useState)(null),[y,b]=(0,J.useState)(null),S=(0,J.useCallback)(()=>{X.run(e).then(e=>{n(e.run),i(e.log),o(e.live)},e=>d(e.message))},[e]);(0,J.useEffect)(S,[S]),(0,J.useEffect)(()=>{if(!a)return;let e=H(S,Re);return()=>de(e)},[a,S]);let w=async()=>{g(!0),d(``);try{await X.stop(e),S()}catch(e){d(e.message)}finally{g(!1)}};if(!t)return l?(0,Z.jsx)(`p`,{role:`alert`,className:P(I.fail,`m-0`),children:l}):(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`});let E=Ne[t.status],O=r.filter(e=>e.level!==`info`).length,k=a?[{id:`findings`,label:`Findings`,icon:h,n:t.findings.length,tone:t.findings.length?`text-warn`:void 0},{id:`devices`,label:`Devices`,icon:x,n:t.spec.devices.length},{id:`log`,label:`Log and errors`,icon:p,n:O||void 0,tone:O?`text-fail`:void 0}]:[{id:`steps`,label:`Steps`,icon:ee,n:t.steps.length},{id:`findings`,label:`Findings`,icon:h,n:t.findings.length,tone:t.findings.length?`text-warn`:void 0},{id:`shots`,label:`Screenshots`,icon:f,n:t.shots.length},{id:`log`,label:`Log and errors`,icon:p,n:O||void 0,tone:O?`text-fail`:void 0}],A=s&&k.some(e=>e.id===s)?s:k[0].id,j=t.steps.filter(e=>e.by===`plan`||e.by===`words`).length,N=t.spec.steps.length;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(se,{to:{href:C(`responsive`,`runs`),label:`All runs`}}),(0,Z.jsx)(ve,{icon:D,title:Pe(t.spec.url),description:(0,Z.jsxs)(Z.Fragment,{children:[M(t.spec.devices.length,`device`),t.spec.on?` on ${Y[t.spec.on]} (${t.spec.real?`real devices`:ze[t.spec.browser??`chrome`]})`:``,` · `,t.spec.mode===`guided`?`${N?M(N,`step`):`reading the prompt`}${t.spec.source?.label?` from ${t.spec.source.label}`:``}`:`interactive (an earlier kind of run)`,` · started `,_e(t.startedAt)]}),actions:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(R,{tone:E.tone,children:E.label}),a&&(0,Z.jsxs)(L,{variant:`danger`,disabled:m,onClick:()=>void w(),"data-tip":`Stop now; what was done is kept`,children:[(0,Z.jsx)(T,{fill:`currentColor`,"aria-hidden":`true`}),`Stop`]})]})}),a&&(0,Z.jsxs)(`div`,{className:P(`rounded-lg bg-bg p-6 shadow-sm`,`flex items-center gap-4`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-sm`,children:N?j<N?`Step ${Math.min(j+1,N)} of ${N}: ${t.spec.steps[j]??``}`:`Last checks…`:`Reading your prompt as steps…`}),(0,Z.jsx)(`span`,{className:`w-[160px] flex-none`,children:(0,Z.jsx)(Ee,{value:j/Math.max(1,N)*100,label:`Steps done`})})]}),t.error&&(0,Z.jsx)(`p`,{role:`alert`,className:P(I.fail,`m-0`),children:t.error}),l&&(0,Z.jsx)(`p`,{role:`alert`,className:P(I.fail,`m-0`),children:l}),(0,Z.jsx)(me,{prefix:`rtab`,className:`mb-0`,tabs:k,current:A,onPick:c,label:`Run`}),(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`rtab-panel-${A}`,"aria-labelledby":`rtab-${A}`,className:`flex min-w-0 flex-col gap-4`,children:[A===`devices`&&a&&(0,Z.jsx)(Ye,{run:t}),A===`steps`&&(0,Z.jsx)(Ke,{run:t,onShot:(e,t)=>v({file:e,label:t})}),A===`findings`&&(0,Z.jsx)(We,{run:t,onOpen:b}),A===`shots`&&(0,Z.jsx)(qe,{run:t,onShot:(e,t)=>v({file:e,label:t})}),A===`log`&&(0,Z.jsx)(Je,{log:r})]}),(0,Z.jsx)(K,{open:!!_,onClose:()=>v(null),wide:!0,title:_?.label??`Screenshot`,footer:(0,Z.jsxs)(L,{onClick:()=>v(null),children:[(0,Z.jsx)(u,{"aria-hidden":`true`}),`Close`]}),children:_&&(0,Z.jsx)(Be,{id:t.id,file:_.file,label:_.label})}),(0,Z.jsx)(K,{open:!!y,onClose:()=>b(null),wide:!0,title:y?Q(y)?`“${$(y)}”`:$(y):`Finding`,...y&&Q(y)?{description:`A check of your own`}:{},footer:(0,Z.jsxs)(L,{onClick:()=>b(null),children:[(0,Z.jsx)(u,{"aria-hidden":`true`}),`Close`]}),children:y&&(0,Z.jsx)(Ge,{f:y,run:t,onOpen:b})})]})}var Ze=[{name:`Page and devices`,tip:`The page and the devices to show it on`},{name:`What to do`,tip:`Your prompt, files or a test case`},{name:`What to check`,tip:`Built-in checks and your own`},{name:`Review`,tip:`Check and start`}],Qe=8,$e=[`The main menu can be opened`,`Sign in is visible without scrolling`,`The page title is shown`,`Prices show next to each product`],et=`forgeqe:responsive`;function tt(){try{let e=JSON.parse(localStorage.getItem(et)||`{}`);return e&&typeof e==`object`?e:{}}catch{return{}}}function nt(e){try{localStorage.setItem(et,JSON.stringify({...tt(),...e}))}catch{}}function rt({id:e,label:t,help:n,children:r}){return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:e,className:`text-body-sm font-medium`,children:t}),r,n&&(0,Z.jsx)(`span`,{className:`text-body-sm text-muted`,children:n})]})}function it({busy:e,onBack:t,next:n,onNext:r,disabled:i,aside:a}){return(0,Z.jsxs)(`div`,{className:`sticky bottom-0 flex flex-wrap items-center gap-4 border-t border-line-soft bg-canvas py-4`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 text-body-sm`,children:a}),t&&(0,Z.jsxs)(L,{variant:`ghost`,disabled:e,onClick:t,children:[(0,Z.jsx)(y,{"aria-hidden":`true`}),`Back`]}),(0,Z.jsx)(L,{variant:`primary`,disabled:e||i,onClick:r,children:n})]})}var at=4e3,ot=3,st=5e4,ct=`Search for pliers, open the first result and add it to the cart, then open the cart.
|
|
2
|
-
The cart should show 1 item and its total should be visible without scrolling.`;function lt({prompt:e,setPrompt:t,files:n,setFiles:i,source:s,setSource:l,flows:d,onFlowsChanged:f,onError:p}){let[m,h]=(0,J.useState)(!1),[g,_]=(0,J.useState)(``),[y,ee]=(0,J.useState)(null),[b,x]=(0,J.useState)(``),[S,C]=(0,J.useState)(``),[w,T]=(0,J.useState)(``),E=(0,J.useRef)(null),D=(e,n)=>{t(e.slice(0,at)),l(n),p(``)},O=async t=>{try{let n=await X.saveFlow(b.trim(),e,t);T(``),C(n.flow.label),x(``),f()}catch(e){let n=e.message;!t&&/saved already/.test(n)?T(n):p(n)}},k=async e=>{let t=[...e??[]];if(!t.length)return;if(n.length+t.length>ot)return p(`Attach at most ${ot} files.`);let r=[...n];for(let e of t){if(!/\.(txt|md|csv|feature)$/i.test(e.name)||e.size>262144)return p(`Attach .txt, .md, .csv or .feature files of at most 256 KB.`);let t=await e.text();if(t.length>st)return p(`${e.name} is longer than ${st/1e3}k characters.`);r.some(t=>t.name===e.name)||r.push({name:e.name.replace(/[^\w .()-]/g,`_`).slice(-80),text:t})}i(r),p(``)};return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Z.jsx)(rt,{id:`rp-prompt`,label:`What should ForgeQE do on every device?`,help:`Write it as you would tell a tester: what to do, in order, and what should be true. Attached files are read too. ${e.length}/${at}`,children:(0,Z.jsx)(te,{id:`rp-prompt`,value:e,rows:6,maxLength:at,placeholder:ct,onChange:e=>t(e.target.value)})}),n.length>0&&(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-wrap gap-2 p-0`,"aria-label":`Attached files`,children:n.map(e=>(0,Z.jsx)(`li`,{className:`inline-flex`,children:(0,Z.jsxs)(R,{tone:`neutral`,icon:!1,children:[(0,Z.jsx)(c,{size:13,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`max-w-[240px] truncate`,children:e.name}),(0,Z.jsx)(L,{variant:`icon`,size:`icon-xs`,"aria-label":`Remove ${e.name}`,"data-tip":`Remove ${e.name}`,onClick:()=>i(n.filter(t=>t.name!==e.name)),children:(0,Z.jsx)(u,{"aria-hidden":`true`})})]})},e.name))}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsxs)(L,{size:`sm`,disabled:n.length>=ot,onClick:()=>E.current?.click(),"data-tip":`Attach a test case, notes or a feature file (.txt, .md, .csv, .feature), read in this browser`,children:[(0,Z.jsx)(v,{"aria-hidden":`true`}),`Attach`]}),(0,Z.jsx)(`input`,{ref:E,type:`file`,multiple:!0,accept:`.txt,.md,.csv,.feature,text/plain,text/markdown,text/csv`,className:`hidden`,onChange:e=>{k(e.target.files),e.target.value=``}}),(0,Z.jsxs)(L,{size:`sm`,"aria-expanded":m,onClick:()=>h(!m),"data-tip":`Fill the prompt from a test case of test management`,children:[(0,Z.jsx)(r,{"aria-hidden":`true`}),`Test case`]}),(0,Z.jsxs)(A,{"aria-label":`A saved prompt`,size:`sm`,value:``,disabled:!d.length,onChange:e=>{let t=d.find(t=>t.name===e.target.value);t&&D(t.prompt,{kind:`flow`,label:t.label})},className:`min-w-0 flex-[0_1_220px]`,children:[(0,Z.jsx)(`option`,{value:``,children:d.length?`A saved prompt…`:`No saved prompts yet`}),d.map(e=>(0,Z.jsx)(`option`,{value:e.name,children:e.label},e.name))]}),(0,Z.jsx)(`span`,{className:`flex-1`}),(0,Z.jsx)(j,{"aria-label":`Name for the prompt`,size:`sm`,value:b,maxLength:80,placeholder:`Name to save as`,onChange:e=>x(e.target.value),className:`min-w-0 flex-[0_1_200px]`}),(0,Z.jsxs)(L,{size:`sm`,disabled:!b.trim()||!e.trim(),"data-tip":`Save this prompt to use again`,onClick:()=>void O(!1),children:[(0,Z.jsx)(a,{"aria-hidden":`true`}),`Save`]})]}),m&&(0,Z.jsxs)(`div`,{className:P(`panel rounded-md bg-(--page-surface-strong) p-6`,`flex flex-col gap-2`),children:[(0,Z.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:async e=>{e.preventDefault();try{ee((await X.cases(g)).cases)}catch(e){p(e.message)}},children:[(0,Z.jsx)(j,{"aria-label":`Find a test case`,autoFocus:!0,value:g,maxLength:100,placeholder:`checkout, ADO-12…`,onChange:e=>_(e.target.value),className:`min-w-0 flex-[1_1_200px] bg-bg`}),(0,Z.jsxs)(L,{size:`sm`,type:`submit`,"data-tip":`Find test cases from test management`,children:[(0,Z.jsx)(o,{"aria-hidden":`true`}),`Find`]})]}),y&&(y.length?(0,Z.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:y.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,className:P(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`gap-2`),onClick:async()=>{try{let t=await X.caseSteps(e.key),n=t.key.split(`:`)[1];D(`Test case ${n}: ${t.title}\n${t.steps.map((e,t)=>`${t+1}. ${e}`).join(`
|
|
3
|
-
`)}`,{kind:`case`,label:`${n} ${t.title}`}),h(!1),ee(null)}catch(e){p(e.message)}},children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,Z.jsxs)(`span`,{className:`flex-none text-body-sm text-muted`,children:[e.key.split(`:`)[1],` · `,M(e.steps,`step`)]})]})},e.key))}):(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-muted`,children:`No test case with steps matches. Test management lists the cases of the plans Settings connects.`}))]}),s.kind!==`typed`&&s.label&&(0,Z.jsxs)(`p`,{className:`m-0 text-body-sm text-muted`,children:[`From `,s.kind===`flow`?`the saved prompt`:`the test case`,` `,(0,Z.jsx)(`strong`,{className:`font-medium text-ink-2`,children:s.label}),`; change it as you like.`]}),S&&(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 text-body-sm text-pass`,children:[`Saved as “`,S,`”.`]}),(0,Z.jsx)(K,{open:!!w,onClose:()=>T(``),title:`Replace the saved prompt?`,description:w,footer:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(L,{onClick:()=>T(``),children:[(0,Z.jsx)(u,{"aria-hidden":`true`}),`Cancel`]}),(0,Z.jsxs)(L,{variant:`accent`,onClick:()=>void O(!0),children:[(0,Z.jsx)(a,{"aria-hidden":`true`}),`Replace`]})]}),children:(0,Z.jsx)(`p`,{className:`m-0 text-body-sm text-ink-2`,children:`The saved prompt's old text is not kept.`})})]})}function ut({info:e,url:t,named:n,where:r,prompt:i,files:a,checks:o,custom:s}){let c=(e,t)=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 border-b border-line-soft py-4 first:pt-0 last:border-b-0 last:pb-0`,children:[(0,Z.jsx)(`span`,{className:`text-body-sm font-medium text-muted`,children:e}),(0,Z.jsx)(`div`,{className:`text-body-sm`,children:t})]});return(0,Z.jsxs)(`aside`,{"aria-label":`Summary`,className:P(oe,`flex flex-col`),children:[c(`Page`,t.trim()?(0,Z.jsx)(`span`,{className:`font-medium [overflow-wrap:anywhere]`,children:Pe(t.trim())}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`Not given yet`})),c(`Devices`,n.length?(0,Z.jsx)(`span`,{children:n.join(`, `)}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`None picked`})),c(`Runs on`,r),c(`What to do`,i.trim()?`Your prompt${a?` and ${M(a,`file`)}`:``}`:(0,Z.jsx)(`span`,{className:`text-muted`,children:`No prompt yet`})),c(`Checks`,o.length+s.filter(e=>e.trim()).length?(0,Z.jsx)(`span`,{children:[...o.map(t=>e.checks.find(e=>e.id===t)?.label??t),...s.filter(e=>e.trim())].join(` · `)}):(0,Z.jsx)(`span`,{className:`text-muted`,children:`None yet`}))]})}function dt({info:e,onStarted:t}){let n=tt(),r=(n.devices??[]).filter(t=>e.devices.some(e=>e.id===t)).slice(0,e.maxPanes),[i,a]=(0,J.useState)(0),[o,c]=(0,J.useState)(0),[l,u]=(0,J.useState)(n.address??e.start),[f,p]=(0,J.useState)(r.length?r:e.defaults),[m,h]=(0,J.useState)(``),[_,v]=(0,J.useState)([]),[y,ee]=(0,J.useState)({kind:`typed`}),[b,x]=(0,J.useState)((n.checks??[]).filter(t=>e.checks.some(e=>e.id===t)).length?n.checks.filter(t=>e.checks.some(e=>e.id===t)):e.checks.map(e=>e.id)),[S,C]=(0,J.useState)([]),[T,E]=(0,J.useState)(n.on&&n.on!==`local`&&e.clouds[n.on]?.ready?n.on:`local`),[M,N]=(0,J.useState)(e.browsers.some(e=>e.id===n.browser)?n.browser:`chrome`),te=e.browsers.find(e=>e.id===M)?.label??M,[ne,re]=(0,J.useState)(n.kind===`browser`?`browser`:`real`),[F,ie]=(0,J.useState)(null),[ae,oe]=(0,J.useState)(``),[R,z]=(0,J.useState)([]),B=T!==`local`&&ne===`real`;(0,J.useEffect)(()=>{if(!B||F?.cloud===T)return;let e=!1;return oe(``),z([]),X.cloudDevices(T).then(t=>!e&&ie({cloud:T,devices:t.devices,max:t.max}),t=>!e&&oe(t.message)),()=>{e=!0}},[B,T,F?.cloud]);let V=F?.cloud===T?F.devices.map(e=>({id:e.id,label:e.name,category:e.category,width:0,height:0,scale:1,os:`${e.platform===`ios`?`iOS`:`Android`} ${e.version}`})):[],se=B?R:f,ce=B?R.map(e=>F?.devices.find(t=>t.id===e)?.label??e):f.map(t=>e.devices.find(e=>e.id===t)?.label??t),le=T===`local`?`This computer (Chromium)`:B?`${Y[T]}: real devices, one session each`:`${Y[T]}: ${te}`,[ue,de]=(0,J.useState)([]),[H,U]=(0,J.useState)(``),[W,pe]=(0,J.useState)(!1),G=()=>void X.flows().then(e=>de(e.flows),()=>{});(0,J.useEffect)(G,[]);let K=e=>{U(``),a(e),c(t=>Math.max(t,e)),window.scrollTo({top:0})},me=S.map(e=>e.trim()).filter(Boolean),q=/^(https?:\/\/)?[^\s/]+\.[^\s]+|^https?:\/\/(localhost|127\.0\.0\.1)/i.test(l.trim()),he=async()=>{pe(!0),U(``);let e={url:l.trim(),devices:se,prompt:m.trim(),attachments:_,source:y,checks:b,custom:me,...T===`local`?{}:B?{on:T,real:!0}:{on:T,browser:M}};try{nt({...B?{}:{devices:f},address:l.trim(),checks:b,on:T,browser:M,kind:ne}),t((await X.start(e)).id)}catch(e){U(e.message),pe(!1)}};return(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,Z.jsx)(De,{steps:Ze,at:i,reached:o,onGo:e=>!W&&K(e)}),(0,Z.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)] items-start gap-6 @5xl:grid-cols-[minmax(0,1fr)_280px]`,children:[(0,Z.jsxs)(`section`,{"aria-labelledby":`rp-step`,className:`flex min-w-0 flex-col gap-6`,children:[(0,Z.jsx)(ve,{id:`rp-step`,icon:[D,k,g,s][i],title:[`Which page, on which devices?`,`What should ForgeQE do?`,`What should be checked?`,`Check and start`][i]}),H&&(0,Z.jsx)(`p`,{role:`alert`,className:P(I.fail,`m-0`),children:H}),i===0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rt,{id:`rp-url`,label:`Page address`,help:e.start&&l.trim()===e.start?`The active environment's web app, from env.yaml.`:`An http or https address; sign in on the page itself.`,children:(0,Z.jsx)(j,{id:`rp-url`,type:`url`,value:l,placeholder:`https://your-app.example.com`,spellCheck:!1,onChange:e=>u(e.target.value)})}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{id:`rp-on`,className:`text-body-sm font-medium`,children:`Run on`}),(0,Z.jsx)(fe,{labelledBy:`rp-on`,value:T,onChange:E,options:[{id:`local`,label:`This computer`,tip:`ForgeQE's own browser, in the background`},...[`browserstack`,`testmu`].map(t=>({id:t,label:Y[t],disabled:!e.clouds[t]?.ready,tip:e.clouds[t]?.ready?`A real browser on ${Y[t]}: one session for every device`:`Not signed in: ${e.clouds[t]?.missing??`no sign-in`}. Save it in Settings › Secrets.`}))]}),T!==`local`&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 pt-2`,children:[(0,Z.jsxs)(`span`,{id:`rp-kind`,className:`text-body-sm font-medium`,children:[`Devices on `,Y[T]]}),(0,Z.jsx)(fe,{labelledBy:`rp-kind`,value:ne,onChange:re,options:[{id:`real`,label:`Real devices`,tip:`Phones and tablets ${Y[T]} lists now, each its own session`},{id:`browser`,label:`Emulated in a browser`,tip:`The device list emulated in one desktop browser on the cloud`}]})]}),T!==`local`&&!B&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 pt-2`,children:[(0,Z.jsxs)(`label`,{htmlFor:`rp-browser`,className:`text-body-sm font-medium`,children:[`Browser on `,Y[T]]}),(0,Z.jsx)(A,{id:`rp-browser`,value:M,onChange:e=>N(e.target.value),className:`max-w-[360px]`,children:e.browsers.map(e=>(0,Z.jsx)(`option`,{value:e.id,children:e.label},e.id))}),(0,Z.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`One `,Y[T],` session for the whole run, each device in its own window of it. It takes longer to start than this computer, and counts against your `,Y[T],` plan. A page on this computer or your own network cannot be reached from there.`]})]})]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Devices`}),B?ae?(0,Z.jsx)(`p`,{role:`alert`,className:P(I.fail,`m-0`),children:ae}):F?.cloud===T?(0,Z.jsx)(je,{devices:V,picked:R,max:F.max,onChange:z,real:Y[T]}):(0,Z.jsxs)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:[`Asking `,Y[T],` for its devices…`]}):(0,Z.jsx)(je,{devices:e.devices,picked:f,max:e.maxPanes,onChange:p,...T===`local`?{}:{drawnBy:`${te} on ${Y[T]}`}})]}),(0,Z.jsx)(it,{busy:W,next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(w,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>K(1),disabled:!q||!se.length,aside:q?void 0:(0,Z.jsx)(`span`,{className:`text-muted`,children:`Enter the page's address.`})})]}),i===1&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`m-0 text-body-sm leading-relaxed text-ink-2`,children:[`ForgeQE reads your prompt as steps and does each on every device in its own browser in the background, planned for each layout from what its screen shows (a phone's menu is often behind a button). After every step it checks every device and keeps a screenshot of each. What the prompt asks to verify becomes a check. It goes on if you leave the page.`,e.planner?``:` No model is set up, so the prompt is read line by line and only plain steps work (click …, scroll down, go back, press Enter).`]}),(0,Z.jsx)(lt,{prompt:m,setPrompt:h,files:_,setFiles:v,source:y,setSource:ee,flows:ue,onFlowsChanged:G,onError:U}),(0,Z.jsx)(it,{busy:W,onBack:()=>K(0),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(w,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>K(2),disabled:!m.trim(),aside:m.trim()?void 0:(0,Z.jsx)(`span`,{className:`text-muted`,children:`Say what to do.`})})]}),i===2&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`fieldset`,{className:`m-0 flex flex-col gap-2 border-0 p-0`,children:[(0,Z.jsx)(`legend`,{className:`mb-2 p-0 text-body-sm font-medium`,children:`Checked by ForgeQE on every device`}),e.checks.map(e=>(0,Z.jsxs)(`label`,{className:P(`flex w-full min-h-11 cursor-pointer items-center gap-4 rounded-base border-0 bg-transparent px-4 py-2 text-left text-body-sm text-ink no-underline transition-colors duration-150 hover:bg-tint hover:text-ink aria-[current]:bg-tint-hover aria-selected:bg-tint-hover aria-pressed:bg-tint-hover aria-checked:bg-tint-hover has-[:checked]:bg-tint-hover disabled:cursor-not-allowed disabled:opacity-50`,`items-start gap-2`),children:[(0,Z.jsx)(ye,{className:`mt-1`,checked:b.includes(e.id),onCheckedChange:t=>x(t?[...b,e.id]:b.filter(t=>t!==e.id))}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-body-sm`,children:e.label}),(0,Z.jsx)(`span`,{className:`text-body-sm text-muted`,children:e.about})]})]},e.id))]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-body-sm font-medium`,children:`Your own checks`}),(0,Z.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`In plain words, judged on each layout from what its screen shows; a finding always quotes the screen.`,e.planner?``:` No model is set up, so these are not judged.`]}),S.map((e,t)=>(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(j,{"aria-label":`Your check ${t+1}`,value:e,maxLength:300,placeholder:`The cart total shows without scrolling`,onChange:e=>C(S.map((n,r)=>r===t?e.target.value:n)),className:`min-w-0 flex-1`}),(0,Z.jsx)(L,{variant:`icon`,size:`icon`,"aria-label":`Remove your check ${t+1}`,"data-tip":`Remove`,onClick:()=>C(S.filter((e,n)=>n!==t)),children:(0,Z.jsx)(O,{"aria-hidden":`true`})})]},t)),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsxs)(L,{size:`sm`,disabled:S.length>=Qe,onClick:()=>C([...S,``]),children:[(0,Z.jsx)(d,{"aria-hidden":`true`}),`Add a check`]}),$e.map(e=>(0,Z.jsxs)(L,{size:`sm`,disabled:S.includes(e)||S.length>=Qe,onClick:()=>C([...S.filter(e=>e.trim()),e]),children:[(0,Z.jsx)(d,{"aria-hidden":`true`}),e]},e))]})]}),(0,Z.jsx)(it,{busy:W,onBack:()=>K(1),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(w,{"aria-hidden":`true`}),`Continue`]}),onNext:()=>K(3),aside:!b.length&&!me.length?(0,Z.jsx)(`span`,{className:`text-muted`,children:`Only what your prompt asks to verify will be checked.`}):void 0})]}),i===3&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`dl`,{className:`m-0 grid grid-cols-[minmax(0,1fr)] gap-4 @xl:grid-cols-[160px_minmax(0,1fr)]`,children:[(0,Z.jsx)(`dt`,{className:`text-body-sm font-medium text-muted`,children:`Page`}),(0,Z.jsx)(`dd`,{className:`m-0 text-body-sm [overflow-wrap:anywhere]`,children:l.trim()}),(0,Z.jsx)(`dt`,{className:`text-body-sm font-medium text-muted`,children:`Devices`}),(0,Z.jsx)(`dd`,{className:`m-0 text-body-sm`,children:ce.join(`, `)}),(0,Z.jsx)(`dt`,{className:`text-body-sm font-medium text-muted`,children:`Runs on`}),(0,Z.jsx)(`dd`,{className:`m-0 text-body-sm`,children:le}),(0,Z.jsx)(`dt`,{className:`text-body-sm font-medium text-muted`,children:`What to do`}),(0,Z.jsx)(`dd`,{className:`m-0 text-body-sm`,children:(0,Z.jsxs)(`span`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`span`,{className:P(`panel rounded-md bg-(--page-surface-strong) p-6`,`whitespace-pre-wrap [overflow-wrap:anywhere]`),children:m.trim()}),_.length>0&&(0,Z.jsxs)(`span`,{className:`text-body-sm text-muted`,children:[`Attached: `,_.map(e=>e.name).join(`, `)]}),(0,Z.jsx)(`span`,{className:`text-body-sm text-muted`,children:`Read as steps and checks when the run starts; the run's page shows how.`})]})}),(0,Z.jsx)(`dt`,{className:`text-body-sm font-medium text-muted`,children:`Checks`}),(0,Z.jsxs)(`dd`,{className:`m-0 flex flex-col gap-1 text-body-sm`,children:[b.map(t=>(0,Z.jsx)(`span`,{children:e.checks.find(e=>e.id===t)?.label},t)),me.map(t=>(0,Z.jsxs)(`span`,{className:P(!e.planner&&`text-muted`),children:[`“`,t,`”`,e.planner?``:` (not judged: no model)`]},t))]})]}),(0,Z.jsx)(it,{busy:W,onBack:()=>K(2),next:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(s,{"aria-hidden":`true`}),W?`Starting…`:`Start`]}),onNext:()=>void he(),aside:(0,Z.jsx)(`span`,{className:`text-muted`,children:`Opens in ForgeQE's own browser on this computer; screenshots and findings are kept with the run.`})})]})]}),(0,Z.jsx)(`div`,{className:`@5xl:sticky @5xl:top-6`,children:(0,Z.jsx)(ut,{info:e,url:l,named:ce,where:le,prompt:m,files:_.length,checks:b,custom:S})})]})]})}function ft({tab:e,wide:t,action:n,children:r}){let i=ie(`responsive`);return(0,Z.jsx)(Se,{title:le(`responsive`),page:i,label:`Responsive`,current:e,onPick:e=>location.hash=e===`agent`?C(`responsive`):C(`responsive`,`runs`),tabs:[{id:`runs`,label:`Runs`,icon:s}],below:(0,Z.jsx)(xe,{page:i}),...t?{wide:t}:{},...n?{end:n}:{},children:r})}function pt({sub:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)(``),s=(0,J.useCallback)(()=>{Promise.all([X.info(),X.runs()]).then(([e,t])=>{n(e),i(t.runs),o(``)},e=>o(e.message))},[]);(0,J.useEffect)(s,[s,e]);let c=!!r?.some(e=>e.status===`running`);(0,J.useEffect)(()=>{if(!c||e!==`runs`)return;let t=H(s,3e3);return()=>de(t)},[c,e,s]);let l=()=>location.hash=C(`responsive`,`new`),u=a&&(0,Z.jsx)(`p`,{role:`alert`,className:P(I.fail,`m-0`),children:a}),f=!t&&!a&&(0,Z.jsx)(`p`,{role:`status`,className:`m-0 text-body-sm text-muted`,children:`Loading…`});if(e===`new`)return(0,Z.jsxs)(ft,{tab:`runs`,children:[u,f,t&&(0,Z.jsx)(dt,{info:t,onStarted:e=>location.hash=C(`responsive`,e)})]});if(e&&Oe.test(e))return(0,Z.jsxs)(ft,{tab:`runs`,wide:!0,children:[u,f,(0,Z.jsx)(Xe,{id:e},e)]});if(e!==`runs`)return(0,Z.jsx)(ft,{tab:Ce});let p=r?.find(e=>e.status===`running`);return(0,Z.jsxs)(ft,{tab:`runs`,action:r&&!r.length?void 0:(0,Z.jsxs)(L,{variant:`accent`,disabled:!t||!!p,onClick:l,"data-tip":p?`A run is going: finish or stop it first`:`New run`,children:[(0,Z.jsx)(d,{"aria-hidden":`true`}),`New`]}),children:[u,f,t&&r&&(r.length?(0,Z.jsx)(Ie,{rows:r}):(0,Z.jsx)(V,{icon:b,title:`No runs yet`,action:(0,Z.jsxs)(L,{size:`sm`,onClick:l,"data-tip":`New run`,children:[(0,Z.jsx)(d,{"aria-hidden":`true`}),`New`]}),children:`Pick a page and the phones, tablets and desktops to show it on, say in a prompt what to do (or start from a test case or a saved prompt), and say what to check. The run goes on by itself, and each device is checked after every step, with a screenshot of each.`}))]})}export{pt as Responsive};
|