@qaily/playwright-html-reporter 1.0.1-beta.2 → 1.0.1-beta.3
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/README.md +1 -0
- package/app/assets/{ai-labels-RxWQyXOZ.js → ai-labels-kOY7eKf_.js} +1 -1
- package/app/assets/{chronoscope-view-DzkFIDnY.js → chronoscope-view-D6I7WR1Z.js} +1 -1
- package/app/assets/{classic-view-XwD0J2Xr.js → classic-view-B4rO1rQX.js} +1 -1
- package/app/assets/{classic-view-BsyNALVL.js → classic-view-BrDjGEFT.js} +1 -1
- package/app/assets/{classic-view-BdOOIEJH.js → classic-view-C5zIaQbY.js} +32 -32
- package/app/assets/{classic-view-DsBjeaSR.js → classic-view-CA2jsB8a.js} +1 -1
- package/app/assets/{classic-view-3xvAtjNz.js → classic-view-CLY1_X2f.js} +1 -1
- package/app/assets/{classic-view-Ciekrvgw.js → classic-view-CQn_HJUG.js} +2 -2
- package/app/assets/index-BGc2KRte.js +983 -0
- package/app/assets/{index-CkVAQmKJ.js → index-BSeSdMcj.js} +2 -2
- package/app/assets/{index-mIO1FNDw.js → index-Bo6ugK3I.js} +2 -2
- package/app/assets/{index-Rhk-vtb9.js → index-Bx_mFI-E.js} +2 -2
- package/app/assets/{index-BNQj7yhU.js → index-CEMZIb_j.js} +2 -2
- package/app/assets/{index-DqZr3quD.js → index-CjIdaEbY.js} +2 -2
- package/app/assets/{index-BU7HqveP.js → index-DIUMnB6u.js} +3 -3
- package/app/assets/{index-BXYjgFWc.js → index-DKORV85a.js} +3 -3
- package/app/assets/{monthly-view-CqYfmVC_.js → monthly-view-BBOPlVBV.js} +1 -1
- package/app/assets/{period-BDS3oIgF.js → period-BVCCS0gi.js} +1 -1
- package/app/assets/{runs-DNJBxr_t.js → runs-DF40idw3.js} +1 -1
- package/app/assets/{settings-view-BcQahji5.js → settings-view-CVNbI43B.js} +1 -1
- package/app/assets/{status-CufZD7gm.js → status-U1ziVPrb.js} +1 -1
- package/app/assets/{styles-BVxnhMnQ.js → styles-BtyAt7f-.js} +1 -1
- package/app/assets/{weekly-view-B_7LFIay.js → weekly-view-COWF8G2Z.js} +1 -1
- package/app/index.html +1 -1
- package/dist/cli.mjs +210 -27
- package/package.json +1 -1
- package/app/assets/index-FKJ4jNss.js +0 -983
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as u,l as m,u as d,m as b,A as l,q as g,L as $,j as s,n as r,v as x,g as f}from"./index-
|
|
1
|
+
import{k as u,l as m,u as d,m as b,A as l,q as g,L as $,j as s,n as r,v as x,g as f}from"./index-BGc2KRte.js";import{e as v}from"./mount-8XXBMtod.js";const h=12;class y extends u{static{this.properties={model:{attribute:!1},ctx:{attribute:!1},expanded:{state:!0}}}constructor(){super(),this.expanded=new Set}goWeek(t){this.ctx.nav.go("weekly",t?{week:String(t)}:{})}cube(t){const e=t.run,n=this.ctx.settings,a=[`${m(e.started_at,n)} · ${e.branch??""}`,`${e.category??""} ${e.environment??""} ${e.tag??""}`,t.running?"Running":`Pass rate ${d(t.rate)} (passed ${e.passed}, failed ${e.failed}, flaky ${e.flaky}, skipped ${e.skipped})`,`Duration ${b(e.dur_ms)}`].join(`
|
|
2
2
|
`),i=s`<span class="t">${this.model.aiRuns.has(e.run_id)?"✨":""}${g(e.started_at,n)}</span>
|
|
3
3
|
<span class="n">${t.running?"◌":s`<span aria-hidden="true">${$[t.level]}</span> ${e.passed+e.flaky}/${e.total-e.skipped}`}</span>
|
|
4
4
|
${e.tag?s`<span class="suite-t">${e.tag}</span>`:l}`,c=`cube level-${t.level} ${t.running?"running":""}`;return s`<a class=${c} href=${this.ctx.nav.href("tests",{run:e.run_id})} title=${a}>${i}</a>`}cell(t,e,n){const a=`${t}/${e}`,i=this.expanded.has(a),c=i?n:n.slice(0,h),p=()=>{const o=new Set(this.expanded);i?o.delete(a):o.add(a),this.expanded=o};return s`<td>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as w,j as s,o as m,A as i,u as g,l as f,m as k,v as q,g as C}from"./index-
|
|
1
|
+
import{k as w,j as s,o as m,A as i,u as g,l as f,m as k,v as q,g as C}from"./index-BGc2KRte.js";import{e as S}from"./mount-8XXBMtod.js";import{b as v,S as x}from"./status-U1ziVPrb.js";import{u as _,c as z,r as T}from"./index-DKORV85a.js";import"./coverage-BPNr95uF.js";const y="qaily.heatmap.layout";function L(){try{return localStorage.getItem(y)==="grid"?"grid":"sheet"}catch{return"sheet"}}class D extends w{static{this.properties={model:{attribute:!1},ctx:{attribute:!1},collapsed:{state:!0},detail:{state:!0},full:{state:!0}}}constructor(){super(),this.collapsed=new Set,this.detail=null,this.full=!1}setFull(e){this.full=e,e&&this.updateComplete.then(()=>this.renderRoot.querySelector(".board")?.focus())}layoutToggle(){return s`<div class="layout" role="group" aria-label="Layout">
|
|
2
2
|
<button class=${this.layout==="sheet"?"on":""} aria-pressed=${this.layout==="sheet"} @click=${()=>this.setLayout("sheet")}>Sheet</button>
|
|
3
3
|
<button class=${this.layout==="grid"?"on":""} aria-pressed=${this.layout==="grid"} @click=${()=>this.setLayout("grid")}>Grid</button>
|
|
4
4
|
</div>`}params(e={}){const o={};return this.model.run&&(o.run=this.model.run.run_id),this.model.component&&(o.component=this.model.component),this.model.layout&&(o.layout=this.model.layout),{...o,...e}}get layout(){return this.model.layout??L()}setLayout(e){try{localStorage.setItem(y,e)}catch{}this.ctx.nav.go("heatmap",this.params({layout:e}))}async openCell(e,o,a,t,l=this.model.component){const r={component:l,scenario:a,feature:e,area:o};if(this.detail={cell:r,stat:t,rows:null},!t.hits){this.detail={cell:r,stat:t,rows:[]};return}const d=this.model.run?{from:new Date(Date.parse(this.model.run.started_at)),to:new Date(Date.parse(this.model.run.started_at)+1)}:{from:new Date(this.model.scope.fromMs),to:new Date(this.model.scope.toMs)};try{const{rules:n}=_(this.ctx.settings.coverage.rules),c=await this.ctx.data.query(z(n,this.model.scope,r),d);this.detail?.cell===r&&(this.detail={...this.detail,rows:c})}catch(n){this.detail?.cell===r&&(this.detail={...this.detail,rows:[],error:n instanceof Error?n.message:String(n)})}}cell(e,o,a,t,l=!1){if(!t)return s`<td class="empty" aria-label="Not planned, no hits"></td>`;const r=t.hits?`${this.model.levels[2]} ${e} › ${this.model.levels[3]} ${o} · ${a}: ${t.passed} of ${t.hits} passed${t.flaky?`, ${t.flaky} flaky`:""}${t.unplanned?" · not in the catalog":""}`:`${e} › ${o} · ${a}: planned, no hits`,d=t.hits>=5?1:.55+t.hits*.09,n=["cell",`level-${t.level}`,t.hits?"":"gap",t.unplanned?"unplanned":"",l?"total":""].join(" ");return s`<td>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{k as g,j as a,A as l,o as d,v as $,g as x,m as u,l as f,u as w}from"./index-
|
|
2
|
-
${e.status==="needs-approval"?"⚠ Waiting for your approval":`${t}…`} (show)</button>`;const
|
|
1
|
+
import{k as g,j as a,A as l,o as d,v as $,g as x,m as u,l as f,u as w}from"./index-BGc2KRte.js";import{e as I}from"./mount-8XXBMtod.js";import{b as h,S as p,s as S,c as T,a as F}from"./status-U1ziVPrb.js";import{a as z,A as C,c as E,s as v,b as m}from"./ai-labels-kOY7eKf_.js";function A(o,s){const t=o.trim();if(!t)return null;const e=new URL(t,s);return e.pathname.endsWith("/")?e.pathname+="index.html":/\.html?$/.test(e.pathname)||(e.pathname+="/index.html"),e}function j(o,s,t,{intervalMs:e=250,timeoutMs:n=3e4,crossOriginMs:i=4e3}={}){const r=Date.now();return new Promise(c=>{const b=()=>{if(o.closed)return c("closed");let y=!0;try{if(o.location.href.includes("trace=blob"))return c("loaded")}catch{y=!1}if(Date.now()-r>(y?n:i))return c("sent");try{o.postMessage({method:"load",params:{trace:s}},t)}catch{}setTimeout(b,e)};b()})}class R extends g{constructor(){super(),this.offs=[],this.loadedFor="",this.analysis=null,this.fix=null,this.busy=!1,this.tick=0}static{this.properties={ctx:{attribute:!1},runId:{},testId:{},analysis:{state:!0},fix:{state:!0},busy:{state:!0},tick:{state:!0}}}connectedCallback(){super.connectedCallback(),this.offs.push(this.ctx.ai.onResults(()=>this.load()),this.ctx.ai.subscribe(()=>this.tick++))}disconnectedCallback(){super.disconnectedCallback();for(const s of this.offs)s();this.offs=[]}willUpdate(s){(s.has("runId")||s.has("testId"))&&`${this.runId}/${this.testId}`!==this.loadedFor&&(this.analysis=null,this.fix=null,this.load())}async load(){const s=`${this.runId}/${this.testId}`;this.loadedFor=s;const{analysis:t,fix:e}=await this.ctx.ai.testResults(this.runId,this.testId);this.loadedFor===s&&(this.analysis=t,this.fix=e)}start(s){try{s==="test-fix"?this.ctx.ai.fixTest(this.runId,this.testId):this.ctx.ai.analyzeTest(this.runId,this.testId)}catch(t){this.ctx.notify(t instanceof Error?t.message:String(t),"error")}}async act(s,t){this.busy=!0;try{await s(),this.ctx.notify(t)}catch(e){this.ctx.notify(e instanceof Error?e.message:String(e),"error")}finally{this.busy=!1}}button(s,t){const e=this.ctx.ai.jobFor(s,this.runId,this.testId);if(e&&(e.status==="running"||e.status==="needs-approval"))return a`<button @click=${()=>this.ctx.ai.showJob(e.id)}>
|
|
2
|
+
${e.status==="needs-approval"?"⚠ Waiting for your approval":`${t}…`} (show)</button>`;const n=this.ctx.ai.canRun(s);return a`<button class=${s==="test-analysis"?"primary":""} ?disabled=${!n.ok} title=${n.reason??""}
|
|
3
3
|
@click=${()=>this.start(s)}>${s==="test-analysis"?"✨ ":""}${t}</button>`}footer(s){const t=this.ctx.ai.publishTarget();return a`<div class="foot">
|
|
4
4
|
<span class="muted small">${z(s.record,this.ctx.settings)}</span>
|
|
5
5
|
${s.draft?a`<span class="badge draft">Draft · only in this browser</span>
|
|
@@ -124,7 +124,7 @@ import{k as g,j as a,A as l,o as d,v as $,g as x,m as u,l as f,u as w}from"./ind
|
|
|
124
124
|
border-color: var(--q-warn);
|
|
125
125
|
color: var(--q-warn);
|
|
126
126
|
}
|
|
127
|
-
`]}}customElements.get("q-test-ai")||customElements.define("q-test-ai",R);const
|
|
127
|
+
`]}}customElements.get("q-test-ai")||customElements.define("q-test-ai",R);const U=/^(text\/|application\/(json|x-ndjson|xml))/,k=o=>`https://trace.playwright.dev/?trace=${encodeURIComponent(o)}`;function q(o){return o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/1024/1024).toFixed(1)} MB`}class L extends g{constructor(){super(),this.loadedFor="",this.urlsFor="",this.retried=new Set,this.attempt=-1,this.history=null,this.historyError="",this.viewer=null,this.showStack=!1,this.similar=[],this.urls=new Map,this.gone=null}static{this.properties={item:{attribute:!1},ctx:{attribute:!1},runId:{},suite:{attribute:!1},similar:{attribute:!1},attempt:{state:!0},history:{state:!0},historyError:{state:!0},viewer:{state:!0},showStack:{state:!0},urls:{state:!0},gone:{state:!0}}}willUpdate(s){if(s.has("item")&&this.item){const t=`${this.runId}/${this.item.summary.test_id}`;t!==this.loadedFor&&(this.loadedFor=t,this.attempt=this.item.attempts.length-1,this.showStack=!1,this.loadHistory())}(s.has("attempt")||s.has("item"))&&this.item&&this.attempt>=0&&this.resolveUrls()}async resolveUrls(){const s=this.item.attempts[this.attempt]?.attachments??[],t=`${this.runId}/${this.item.summary.test_id}/${this.attempt}`;this.urlsFor=t,this.retried.clear();const e=await Promise.all(s.map(async r=>[r.path,await(r.type.startsWith("image/")?this.ctx.artifacts.imageUrl(this.runId,r.path):this.ctx.artifacts.url(this.runId,r.path)).catch(()=>null)]));if(this.urlsFor!==t)return;this.urls=new Map(e),this.gone=null;const n=[...s].sort((r,c)=>r.size-c.size)[0];if(!n||!this.ctx.artifacts.status().ready)return;const i=await this.ctx.artifacts.check(this.runId,n.path);this.urlsFor===t&&(this.gone=i==="missing"||i==="denied"?i:null)}async retryImage(s){if(this.retried.has(s.path))return;this.retried.add(s.path);const t=this.urlsFor,e=await this.ctx.artifacts.imageUrl(this.runId,s.path,{fresh:!0}).catch(()=>null);e&&this.urlsFor===t&&e!==this.urls.get(s.path)&&(this.urls=new Map(this.urls).set(s.path,e))}async openFresh(s,t,e=n=>n){s.preventDefault();const n=await this.ctx.artifacts.url(this.runId,t.path).catch(()=>null);if(!n)return this.ctx.notify("Connect storage credentials in Settings → Tokens to open this file.","error");window.open(e(n),"_blank","noopener")}traceViewer(){try{return A(this.ctx.settings.connections.traceViewer,document.baseURI)}catch{return null}}async openTrace(s,t){const e=this.traceViewer();if(!e)return this.openFresh(s,t,k);s.preventDefault();const n=window.open(e.href,"_blank");if(!n)return this.ctx.notify("The browser blocked the trace viewer tab. Allow pop-ups for this site and try again.","error");try{const i=await this.ctx.artifacts.blob(this.runId,t.path);await j(n,i,e.origin)==="sent"&&e.origin===location.origin&&this.ctx.notify("The trace viewer did not take the trace. Download it and open it there with Select file.","error")}catch(i){n.close(),this.ctx.notify(i instanceof Error?i.message:String(i),"error")}}async download(s){const t=s.path.split("/").pop()??s.name,e=await this.ctx.artifacts.url(this.runId,s.path,{downloadName:t});if(!e)return this.ctx.notify("Connect storage credentials in Settings → Tokens to download this file.","error");const n=document.createElement("a");n.href=e,n.download=t,n.rel="noopener",n.click()}connectHint(){return a`<p class="connect">${this.ctx.artifacts.status().message}
|
|
128
128
|
<a href=${this.ctx.nav.href("settings",{section:"secrets"})}>Connect</a></p>`}async loadHistory(){const s=this.item.summary.test_id;this.history=null,this.historyError="";try{const t=this.ctx.now(),e=await this.ctx.data.query(`SELECT run_id, epoch_ms(started_at) AS started_at, status, dur_ms, suite FROM tests
|
|
129
129
|
WHERE test_id = '${s.replaceAll("'","''")}' ORDER BY started_at DESC LIMIT 30`,{from:new Date(t.getTime()-90*864e5),to:new Date(t.getTime()+1)});this.item.summary.test_id===s&&(this.history=e.reverse())}catch(t){this.historyError=t instanceof Error?t.message:String(t)}}copy(s){navigator.clipboard.writeText(s).then(()=>this.ctx.notify("Copied to clipboard"),()=>this.ctx.notify("Could not copy","error"))}async openText(s){this.viewer={kind:"text",att:s,text:null,truncated:!1};try{const{text:t,truncated:e}=await this.ctx.artifacts.text(this.runId,s.path);this.viewer={kind:"text",att:s,text:t,truncated:e}}catch(t){this.viewer={kind:"text",att:s,text:null,truncated:!1,error:t instanceof Error?t.message:String(t)}}}header(){const s=this.item.summary,t=s.status;return a`<div class="head">
|
|
130
130
|
<span class="pill" style=${d({background:p[t]})}>${h[t]} ${t}</span>
|
|
@@ -156,18 +156,18 @@ import{k as g,j as a,A as l,o as d,v as $,g as x,m as u,l as f,u as w}from"./ind
|
|
|
156
156
|
${t.snippet?a`<pre class="code">${m(t.snippet)}</pre>`:l}
|
|
157
157
|
${t.stack?a`<button class="small" @click=${()=>this.showStack=!this.showStack}>${this.showStack?"Hide":"Show"} stack trace</button>
|
|
158
158
|
${this.showStack?a`<pre class="code">${m(t.stack)}</pre>`:l}`:l}
|
|
159
|
-
</section>`)}`:l}stepsSection(){const s=this.item.attempts[this.attempt]?.detail?.steps??[];if(!s.length)return l;const t=Math.max(...s.map(i=>i.dur_ms),1),e=this.item.attempts[this.attempt]?.detail?.failed_step_idx,
|
|
159
|
+
</section>`)}`:l}stepsSection(){const s=this.item.attempts[this.attempt]?.detail?.steps??[];if(!s.length)return l;const t=Math.max(...s.map(i=>i.dur_ms),1),e=this.item.attempts[this.attempt]?.detail?.failed_step_idx,n=i=>a`<li class=${i.idx===e?"failed":""}>
|
|
160
160
|
<span class="glyph" style=${d({color:p[i.status]??"inherit"})}
|
|
161
161
|
title=${i.status}>${h[i.status]??"•"}</span>
|
|
162
162
|
<span class="title">${i.title}</span>
|
|
163
163
|
<span class="bar"><i style=${d({width:`${i.dur_ms/t*100}%`})}></i></span>
|
|
164
164
|
<span class="dur muted">${u(i.dur_ms)}</span>
|
|
165
|
-
</li>`;return a`<section class="card"><h3>Steps</h3><ol class="steps">${s.map(
|
|
165
|
+
</li>`;return a`<section class="card"><h3>Steps</h3><ol class="steps">${s.map(n)}</ol></section>`}attachmentsSection(){const s=this.item.attempts[this.attempt]?.attachments??[];if(!s.length)return l;const t=s.filter(r=>r.type.startsWith("image/")),e=s.filter(r=>!r.type.startsWith("image/")),n=r=>this.urls.get(r.path),i=!this.ctx.artifacts.status().ready;return this.gone==="missing"?a`<section class="card">
|
|
166
166
|
<h3>Attachments</h3>
|
|
167
167
|
<p class="muted">The screenshots and files of this run are no longer in storage: a retention rule on the bucket
|
|
168
168
|
removes them after a while. The error and steps above are kept.</p>
|
|
169
|
-
<ul class="files">${s.map(
|
|
170
|
-
<span class="muted">${
|
|
169
|
+
<ul class="files">${s.map(r=>a`<li><span class="name">${r.name}</span>
|
|
170
|
+
<span class="muted">${r.type} · ${q(r.size)}</span></li>`)}</ul>
|
|
171
171
|
</section>`:a`
|
|
172
172
|
${i?this.connectHint():l}
|
|
173
173
|
${this.gone==="denied"?a`<p class="connect">Storage refused the files of this run. A retention rule on the bucket may have removed
|
|
@@ -176,22 +176,22 @@ import{k as g,j as a,A as l,o as d,v as $,g as x,m as u,l as f,u as w}from"./ind
|
|
|
176
176
|
${t.length?a`<section class="card">
|
|
177
177
|
<h3>Screenshots</h3>
|
|
178
178
|
<div class="shots">
|
|
179
|
-
${t.map((
|
|
180
|
-
aria-label="Open screenshot ${c+1}"><img src=${r
|
|
181
|
-
@load=${()=>this.retried.delete(
|
|
179
|
+
${t.map((r,c)=>n(r)?a`<button class="shot" @click=${()=>this.viewer={kind:"image",list:t,index:c}}
|
|
180
|
+
aria-label="Open screenshot ${c+1}"><img src=${n(r)} alt=${r.name} loading="lazy"
|
|
181
|
+
@load=${()=>this.retried.delete(r.path)} @error=${()=>this.retryImage(r)} /></button>`:a`<div class="shot placeholder muted">${i?"Stored in S3":"…"}</div>`)}
|
|
182
182
|
</div>
|
|
183
183
|
</section>`:l}
|
|
184
184
|
${e.length?a`<section class="card">
|
|
185
185
|
<h3>Attachments</h3>
|
|
186
186
|
<ul class="files">
|
|
187
|
-
${e.map(
|
|
188
|
-
<span class="name">${
|
|
189
|
-
<span class="muted">${
|
|
187
|
+
${e.map(r=>a`<li>
|
|
188
|
+
<span class="name">${r.name}</span>
|
|
189
|
+
<span class="muted">${r.type} · ${q(r.size)}</span>
|
|
190
190
|
<span class="actions">
|
|
191
|
-
${
|
|
192
|
-
${
|
|
193
|
-
href=${this.traceViewer()?.href??k(r
|
|
194
|
-
<button class="small" ?disabled=${i} @click=${()=>this.download(
|
|
191
|
+
${U.test(r.type)?a`<button class="small" ?disabled=${i} @click=${()=>this.openText(r)}>View</button>`:l}
|
|
192
|
+
${r.name==="trace"&&n(r)?a`<a class="small button" target="_blank" rel="noopener"
|
|
193
|
+
href=${this.traceViewer()?.href??k(n(r))} @click=${c=>this.openTrace(c,r)}>Trace viewer</a>`:l}
|
|
194
|
+
<button class="small" ?disabled=${i} @click=${()=>this.download(r)}>Download</button>
|
|
195
195
|
</span>
|
|
196
196
|
</li>`)}
|
|
197
197
|
</ul>
|
|
@@ -207,7 +207,7 @@ import{k as g,j as a,A as l,o as d,v as $,g as x,m as u,l as f,u as w}from"./ind
|
|
|
207
207
|
</div>
|
|
208
208
|
${(()=>{const t=[...new Set(this.history.map(e=>e.suite).filter(e=>!!e))].sort();return t.length>1?a`<p class="muted small-text">Underline = suite: ${F(t)}</p>`:l})()}
|
|
209
209
|
<p class="muted small-text">
|
|
210
|
-
${(()=>{const t=this.history.filter(i=>i.status!=="skipped"),e=t.filter(i=>i.status==="passed"||i.status==="flaky").length,
|
|
210
|
+
${(()=>{const t=this.history.filter(i=>i.status!=="skipped"),e=t.filter(i=>i.status==="passed"||i.status==="flaky").length,n=t.filter(i=>i.status==="flaky").length;return t.length?`Passed ${e} of ${t.length} executed (${n} flaky).`:"Not executed in this period."})()}
|
|
211
211
|
</p>`:a`<p class="muted">Loading…</p>`}
|
|
212
212
|
</section>`}similarSection(){return this.similar.length?a`<section class="card">
|
|
213
213
|
<h3>Same failure in this run <span class="muted">(${this.similar.length})</span></h3>
|
|
@@ -221,13 +221,13 @@ import{k as g,j as a,A as l,o as d,v as $,g as x,m as u,l as f,u as w}from"./ind
|
|
|
221
221
|
<textarea rows="3" placeholder="Add a note about this test…" .value=${this.ctx.notes.get(`test:${s}`)}
|
|
222
222
|
@change=${t=>this.ctx.notes.set(`test:${s}`,t.target.value)}></textarea>
|
|
223
223
|
</section>`}annotations(){const s=this.item.attempts[this.attempt]?.detail?.annotations??[];return s.length?a`<section class="card"><h3>Annotations</h3>
|
|
224
|
-
<dl class="annotations">${s.map(t=>a`<dt>${t.type}</dt><dd>${t.description??""}</dd>`)}</dl></section>`:l}viewerModal(){const s=this.viewer;if(!s)return l;const t=()=>this.viewer=null;if(s.kind==="image"){const e=s.list[s.index],
|
|
224
|
+
<dl class="annotations">${s.map(t=>a`<dt>${t.type}</dt><dd>${t.description??""}</dd>`)}</dl></section>`:l}viewerModal(){const s=this.viewer;if(!s)return l;const t=()=>this.viewer=null;if(s.kind==="image"){const e=s.list[s.index],n=this.urls.get(e.path)??"",i=r=>this.viewer={...s,index:(s.index+r+s.list.length)%s.list.length};return a`<q-modal open heading="Screenshot ${s.index+1} of ${s.list.length}" @close=${t}>
|
|
225
225
|
<div class="viewer-nav">
|
|
226
226
|
<button ?disabled=${s.list.length<2} @click=${()=>i(-1)}>← Previous</button>
|
|
227
|
-
<a class="button" href=${
|
|
227
|
+
<a class="button" href=${n} target="_blank" rel="noopener" @click=${r=>this.openFresh(r,e)}>Open original</a>
|
|
228
228
|
<button ?disabled=${s.list.length<2} @click=${()=>i(1)}>Next →</button>
|
|
229
229
|
</div>
|
|
230
|
-
<img class="full" src=${
|
|
230
|
+
<img class="full" src=${n} alt=${e.name} @load=${()=>this.retried.delete(e.path)} @error=${()=>this.retryImage(e)} />
|
|
231
231
|
</q-modal>`}return a`<q-modal open heading=${s.att.name} @close=${t}>
|
|
232
232
|
${s.error?a`<q-state kind="error" message=${s.error}></q-state>`:s.text==null?a`<q-state kind="loading"></q-state>`:a`${s.truncated?a`<p class="muted">Showing the first 256 KB. Download the file for the rest.</p>`:l}
|
|
233
233
|
<pre class="code">${m(s.text)}</pre>`}
|
|
@@ -473,11 +473,11 @@ import{k as g,j as a,A as l,o as d,v as $,g as x,m as u,l as f,u as w}from"./ind
|
|
|
473
473
|
display: block;
|
|
474
474
|
margin: 0 auto;
|
|
475
475
|
}
|
|
476
|
-
`]}}customElements.get("q-test-detail")||customElements.define("q-test-detail",
|
|
476
|
+
`]}}customElements.get("q-test-detail")||customElements.define("q-test-detail",L);const _=["all","failed","flaky","passed","skipped"];class D extends g{constructor(){super(),this.initialisedFor="",this.status="all",this.search="",this.project="",this.open=new Set,this.selected=null}static{this.properties={model:{attribute:!1},ctx:{attribute:!1},status:{state:!0},search:{state:!0},project:{state:!0},open:{state:!0},selected:{state:!0}}}willUpdate(s){if(!s.has("model")||!this.model)return;const t=this.model.current?.run.run_id??"",e=new URLSearchParams(location.hash.split("?")[1]??"");if(t!==this.initialisedFor){this.initialisedFor=t;const n=e.get("status");this.status=n&&_.includes(n)?n:"all",this.search=e.get("q")??"",this.open=new Set(this.model.specs.filter(i=>i.counts.failed||i.counts.flaky).map(i=>i.spec))}this.selected=e.get("test")}syncUrl(){const s={};this.model.current&&(s.run=this.model.current.run.run_id),this.status!=="all"&&(s.status=this.status),this.search&&(s.q=this.search),this.selected&&(s.test=this.selected),this.ctx.nav.replaceParams(s)}select(s){this.selected=s,this.syncUrl()}passesFilters(s){if(this.status!=="all"&&s.summary.status!==this.status||this.project&&s.summary.project!==this.project)return!1;const t=this.search.trim().toLowerCase();if(!t)return!0;const e=s.summary;return e.title.toLowerCase().includes(t)||s.spec.toLowerCase().includes(t)||e.tags.some(n=>`@${n}`.toLowerCase().includes(t.replace(/^@?/,"@")))||(e.err_summary??"").toLowerCase().includes(t)||s.groups.some(n=>n.toLowerCase().includes(t))}runLabel(s){const t=s.run;return`${f(t.started_at,this.ctx.settings)} · ${t.tag?`${t.tag} · `:""}${s.lane??t.category??"?"} · ${t.branch??""} · ${s.run.ended_at?w(s.rate,0):"running"}`}runHeader(){const s=this.model,t=s.current,e=t.run;return a`<section class="card run">
|
|
477
477
|
<div class="run-pick">
|
|
478
478
|
<label>Run
|
|
479
|
-
<select @change=${
|
|
480
|
-
${s.runs.map(
|
|
479
|
+
<select @change=${n=>this.ctx.nav.go("tests",{run:n.target.value})}>
|
|
480
|
+
${s.runs.map(n=>a`<option value=${n.run.run_id} ?selected=${n===t}>${this.runLabel(n)}</option>`)}
|
|
481
481
|
</select>
|
|
482
482
|
</label>
|
|
483
483
|
<q-health level=${t.level} label=${t.run.ended_at?w(t.rate):"running"}></q-health>
|
|
@@ -521,20 +521,20 @@ import{k as g,j as a,A as l,o as d,v as $,g as x,m as u,l as f,u as w}from"./ind
|
|
|
521
521
|
${u(t.dur_ms)}
|
|
522
522
|
</span>
|
|
523
523
|
</button>
|
|
524
|
-
</li>`}spec(s,t){const
|
|
525
|
-
<button class="spec-head" aria-expanded=${
|
|
526
|
-
<span class="caret">${
|
|
524
|
+
</li>`}spec(s,t){const n=this.status!=="all"||this.search!==""||this.project!==""||this.open.has(s.spec);return a`<section class="card spec">
|
|
525
|
+
<button class="spec-head" aria-expanded=${n} @click=${()=>{const r=new Set(this.open);r.has(s.spec)?r.delete(s.spec):r.add(s.spec),this.open=r}}>
|
|
526
|
+
<span class="caret">${n?"▾":"▸"}</span>
|
|
527
527
|
<span class="mono name">${s.spec}</span>
|
|
528
528
|
<span class="counts">
|
|
529
|
-
${["failed","flaky","passed","skipped"].map(
|
|
529
|
+
${["failed","flaky","passed","skipped"].map(r=>s.counts[r]?a`<span style=${d({color:p[r]})} title=${r}>${h[r]} ${s.counts[r]}</span>`:l)}
|
|
530
530
|
</span>
|
|
531
531
|
</button>
|
|
532
|
-
${
|
|
533
|
-
</section>`}render(){const s=this.model;if(!s.current)return a`<q-state kind="empty" message="No runs in this range. Try a longer range or all branches."></q-state>`;const t=s.specs.map(i=>({node:i,tests:i.tests.filter(
|
|
532
|
+
${n?a`<ul class="tests">${t.map(r=>this.testRow(r))}</ul>`:l}
|
|
533
|
+
</section>`}render(){const s=this.model;if(!s.current)return a`<q-state kind="empty" message="No runs in this range. Try a longer range or all branches."></q-state>`;const t=s.specs.map(i=>({node:i,tests:i.tests.filter(r=>this.passesFilters(r))})).filter(i=>i.tests.length),e=this.selected?s.tests.find(i=>i.summary.test_id===this.selected)??null:null,n=e?.issueKey?s.tests.filter(i=>i!==e&&i.issueKey===e.issueKey):[];return a`
|
|
534
534
|
${this.runHeader()} ${this.toolbar()}
|
|
535
535
|
${t.length?t.map(i=>this.spec(i.node,i.tests)):a`<q-state kind="empty" message="No tests match these filters."></q-state>`}
|
|
536
536
|
<q-drawer ?open=${!!e} heading="Test details" @close=${()=>this.select(null)}>
|
|
537
|
-
${e?a`<q-test-detail .item=${e} .ctx=${this.ctx} .runId=${s.current.run.run_id} .suite=${s.current.run.tag} .similar=${
|
|
537
|
+
${e?a`<q-test-detail .item=${e} .ctx=${this.ctx} .runId=${s.current.run.run_id} .suite=${s.current.run.tag} .similar=${n}></q-test-detail>`:l}
|
|
538
538
|
</q-drawer>
|
|
539
539
|
`}static{this.styles=[$,x`
|
|
540
540
|
:host {
|
|
@@ -660,4 +660,4 @@ import{k as g,j as a,A as l,o as d,v as $,g as x,m as u,l as f,u as w}from"./ind
|
|
|
660
660
|
.glyph {
|
|
661
661
|
font-weight: 700;
|
|
662
662
|
}
|
|
663
|
-
`]}}const V=I("q-tests-classic",
|
|
663
|
+
`]}}const V=I("q-tests-classic",D);export{V as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as d,l as m,m as c,A as n,L as h,n as l,q as o,t as u,j as e,u as r,v as g,g as f}from"./index-
|
|
1
|
+
import{k as d,l as m,m as c,A as n,L as h,n as l,q as o,t as u,j as e,u as r,v as g,g as f}from"./index-BGc2KRte.js";import{e as $}from"./mount-8XXBMtod.js";import{s as x}from"./status-U1ziVPrb.js";class v extends d{static{this.properties={model:{attribute:!1},ctx:{attribute:!1}}}runTitle(a){const t=a.run;return[`${m(t.started_at,this.ctx.settings)} · ${t.branch??"unknown branch"}`,`${t.category??""} ${t.environment??""} ${t.tag??""}`.trim(),`Passed ${t.passed}, failed ${t.failed}, flaky ${t.flaky}, skipped ${t.skipped}`,`Duration ${c(t.dur_ms)}`].join(`
|
|
2
2
|
`)}latest(a){const t=a.run,s=this.ctx.settings,i=e`
|
|
3
3
|
<div class="when">
|
|
4
4
|
<strong>${l(t.started_at,s)} ${o(t.started_at,s)}</strong>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as $,A as o,j as s,n,u as l,L as v,S as p,x as m,m as g,v as x,g as b}from"./index-
|
|
1
|
+
import{k as $,A as o,j as s,n,u as l,L as v,S as p,x as m,m as g,v as x,g as b}from"./index-BGc2KRte.js";import{e as y}from"./mount-8XXBMtod.js";import{a as k}from"./status-U1ziVPrb.js";import{s as c}from"./index-Bx_mFI-E.js";import"./runs-DF40idw3.js";import"./lanes-Bb9_UFmn.js";import"./period-BVCCS0gi.js";const w={good:"var(--q-good)",warn:"var(--q-warn)",bad:"var(--q-bad)"};class q extends ${static{this.properties={model:{attribute:!1},ctx:{attribute:!1}}}goMonth(t){this.ctx.nav.go("monthly",t?{month:t}:{})}kpi(t,i,a){return s`<div class="card kpi"><span class="muted">${t}</span><b>${i}</b>${a?s`<span class="sub">${a}</span>`:o}</div>`}day(t){const i=this.ctx.settings;if(!t.inMonth)return s`<div class="day out" aria-hidden="true"></div>`;const a=`${n(t.date,i,{weekday:"long",month:"long",day:"numeric"})}: ${t.runs?`${l(t.rate)} over ${t.runs} runs`:"no runs"}`;return s`<a class="day level-${t.level} ${t.runs?"has":""} ${t.isFuture?"future":""}"
|
|
2
2
|
href=${this.ctx.nav.href("weekly",t.weekOffset?{week:String(t.weekOffset)}:{})} title=${a} aria-label=${a}>
|
|
3
3
|
<span class="num">${Number(t.key.slice(8))}</span>
|
|
4
4
|
${t.runs?s`<span class="rate">${v[t.level]} ${l(t.rate,0)}</span><span class="runs">${t.runs} runs</span>`:o}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as b,j as i,A as l,o as h,l as f,t as $,n as y,v,g as w}from"./index-
|
|
1
|
+
import{k as b,j as i,A as l,o as h,l as f,t as $,n as y,v,g as w}from"./index-BGc2KRte.js";import{e as k}from"./mount-8XXBMtod.js";import{a as S,s as m,b as _,A as q,c as A}from"./ai-labels-kOY7eKf_.js";import{S as x,b as T,a as C,s as F}from"./status-U1ziVPrb.js";const g={timeout:"Timeout",assertion:"Assertion",element_not_found:"Element not found",network:"Network",unknown:"Other"};class R extends b{constructor(){super(),this.shotsFor="",this.shotsRetried="",this.shotsGone="",this.freshShots=new Set,this.aiFor="",this.offs=[],this.type="",this.search="",this.expanded=new Set,this.shots=new Map,this.aiRun=null,this.aiTick=0}static{this.properties={model:{attribute:!1},ctx:{attribute:!1},type:{state:!0},search:{state:!0},expanded:{state:!0},shots:{state:!0},aiRun:{state:!0},aiTick:{state:!0}}}connectedCallback(){super.connectedCallback(),this.offs.push(this.ctx.ai.onResults(()=>this.loadAi()),this.ctx.ai.subscribe(()=>this.aiTick++))}disconnectedCallback(){super.disconnectedCallback();for(const t of this.offs)t();this.offs=[]}async loadAi(){const t=this.model?.run?.run_id??"";this.aiFor=t;const e=t?await this.ctx.ai.runResult(t):null;this.aiFor===t&&(this.aiRun=e)}aiPanel(){const t=this.model;if(!t.run)return i`<p class="muted ai-hint">✨ To have AI analyse all failures together, pick a single run in Scope.</p>`;const e=t.run.run_id,r=this.ctx.ai.jobFor("run-analysis",e),s=this.ctx.ai.canRun("run-analysis"),n=this.aiRun,o=n?.record.result,p=this.ctx.ai.publishTarget(),d=async(a,u)=>{try{await a(),this.ctx.notify(u)}catch(c){this.ctx.notify(c instanceof Error?c.message:String(c),"error")}};return i`<section class="card ai">
|
|
2
2
|
<div class="ai-head">
|
|
3
3
|
<h2>✨ AI summary</h2>
|
|
4
4
|
${r&&(r.status==="running"||r.status==="needs-approval")?i`<button @click=${()=>this.ctx.ai.showJob(r.id)}>
|
|
@@ -15,7 +15,7 @@ import{k as b,j as i,A as l,o as h,l as f,t as $,n as y,v,g as w}from"./index-FK
|
|
|
15
15
|
@click=${()=>d(()=>this.ctx.ai.publish(n),`Published to ${p.label}.`)}>Publish</button>
|
|
16
16
|
<button @click=${()=>d(()=>this.ctx.ai.discardDraft(n),"Draft discarded.")}>Discard</button>`:i`<span class="badge">Published</span>`}
|
|
17
17
|
</div>`:i`<p class="muted small">No AI summary for this run yet.${s.ok?"":` ${s.reason}`}</p>`}
|
|
18
|
-
</section>`}clusterFor(t){return this.aiRun?.record.result.clusters.find(e=>e.issueSigs.includes(t))}willUpdate(t){if(t.has("model")&&this.model){const e=this.model.run?.run_id??"";e?(e!==this.shotsFor&&(this.shots=new Map),this.shotsFor=e,e!==this.shotsGone&&this.loadShots(e)):this.shots=new Map,(e!==this.aiFor||!e)&&this.loadAi()}}retryShots(t){if(this.shotsRetried===this.shotsFor){this.freshShots.has(t)&&(this.shotsGone=this.shotsFor,this.shots=new Map);return}this.shotsRetried=this.shotsFor,this.shotsFor&&this.loadShots(this.shotsFor,!0)}async loadShots(t,e=!1){try{const r=await this.ctx.data.runDetail(t),s=new Map;for(const o of r.attachments)o.attempt===0&&o.type.startsWith("image/")&&!s.has(o.test_id)&&s.set(o.test_id,o.path);const n=new Map;if(await Promise.all([...s].map(async([o,p])=>{const d=await this.ctx.artifacts.
|
|
18
|
+
</section>`}clusterFor(t){return this.aiRun?.record.result.clusters.find(e=>e.issueSigs.includes(t))}willUpdate(t){if(t.has("model")&&this.model){const e=this.model.run?.run_id??"";e?(e!==this.shotsFor&&(this.shots=new Map),this.shotsFor=e,e!==this.shotsGone&&this.loadShots(e)):this.shots=new Map,(e!==this.aiFor||!e)&&this.loadAi()}}retryShots(t){if(this.shotsRetried===this.shotsFor){this.freshShots.has(t)&&(this.shotsGone=this.shotsFor,this.shots=new Map);return}this.shotsRetried=this.shotsFor,this.shotsFor&&this.loadShots(this.shotsFor,!0)}async loadShots(t,e=!1){try{const r=await this.ctx.data.runDetail(t),s=new Map;for(const o of r.attachments)o.attempt===0&&o.type.startsWith("image/")&&!s.has(o.test_id)&&s.set(o.test_id,o.path);const n=new Map;if(await Promise.all([...s].map(async([o,p])=>{const d=await this.ctx.artifacts.imageUrl(t,p,{fresh:e}).catch(()=>null);d&&n.set(o,d)})),this.shotsFor!==t)return;this.shots=n,e&&(this.freshShots=new Set(n.values()))}catch{}}toggle(t){const e=new Set(this.expanded);e.has(t)?e.delete(t):e.add(t),this.expanded=e}passesFilters(t){if(this.type&&t.errType!==this.type)return!1;const e=this.search.trim().toLowerCase();return e?t.message.toLowerCase().includes(e)||(t.failedStep??"").toLowerCase().includes(e)||t.occurrences.some(r=>r.title.toLowerCase().includes(e)):!0}copy(t){const e=[...new Map(t.occurrences.map(s=>[s.test_id,s.title])).values()],r=[m(t.message),t.failedStep?`Failed step: ${t.failedStep}`:"",t.location?`At: ${t.location}`:"",`Affected tests (${e.length}):`,...e.map(s=>`- ${s}`)].filter(Boolean).join(`
|
|
19
19
|
`);navigator.clipboard.writeText(r).then(()=>this.ctx.notify("Issue copied"),()=>this.ctx.notify("Could not copy","error"))}bars(t){if(!t.perDay.length)return l;const e=Math.max(...t.perDay,1);return i`<div class="bars" aria-label="Occurrences per day">
|
|
20
20
|
${t.perDay.map((r,s)=>i`<i style=${h({height:`${r?15+r/e*85:4}%`,opacity:r?"1":"0.25"})}
|
|
21
21
|
title="${this.model.days[s]}: ${r}"></i>`)}
|