Skip to content

Commit 9eae297

Browse files
committed
Embed issue screenshots in bug report
1 parent 4ebcf8b commit 9eae297

6 files changed

Lines changed: 34 additions & 14 deletions

File tree

.codex/skills/website-qa-agent/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ npm run agent:codex -- --task-file <task-file> --headed
3434
`Result: 1/5 lead conditions saved.`
3535
`Passed: 1. Tag/source/owner - saved and searchable.`
3636
`Failed: 1. Minimal contact fields - not searchable after Save. 2. Full address - not searchable after Save.`
37-
- Use this table shape for user-facing reports: `Module`, `Issue`, `Description`, `Priority`, `Status`.
37+
- Use this table shape for user-facing reports: `Module`, `Issue`, `Description`, `Priority`, `Status`, `Screenshot`.
3838
- Generate Excel only by default. Generate Markdown/JSON only when explicitly requested for debugging or automation.
3939
- Do not generate CSV.
4040
- Excel first sheet must be `Bug Report` with only user-facing bug rows.
4141
- Excel second sheet should be `Summary`; technical evidence sheets can follow after that.
4242
- Excel reports should be readable without manual fixing: set practical column widths, wrap text, use dynamic row heights, freeze/filter headers, and color header/priority/status cells.
4343
- Aggregate repeated duplicate bugs into one clear row. Do not repeat the same bug 10 times unless each row is materially different.
4444
- Excel reports must embed screenshots/images in the workbook when screenshots exist.
45+
- The first `Bug Report` sheet must include a `Screenshot` column. If an issue has screenshot evidence, place the image directly inside that row's screenshot cell, not only in a separate screenshots sheet.
4546
- Do not push reports, screenshots, logs, traces, or `.env` files to GitHub.
4647
- Use browser state indexes when selector guessing is uncertain.
4748
- Keep Codex/no-API and Groq/API modes working.

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ Professional QA runs must explore conditions, not stop at the first blocked path
6060

6161
## Report Style
6262

63-
User-facing issue table: `Module`, `Issue`, `Description`, `Priority`, `Status`.
63+
User-facing issue table: `Module`, `Issue`, `Description`, `Priority`, `Status`, `Screenshot`.
6464

65-
Excel is the default user-facing artifact. The first sheet must be `Bug Report` with the clean issue table only. The second sheet should be `Summary`. Technical evidence sheets can follow after that. Screenshots are embedded in the workbook when available. Excel must be readable without manual resizing: practical widths, wrapped text, dynamic row heights, frozen/filterable headers, and colored header/priority/status cells.
65+
Excel is the default user-facing artifact. The first sheet must be `Bug Report` with the clean issue table only. The second sheet should be `Summary`. Technical evidence sheets can follow after that. Screenshots are embedded in the workbook when available. The first `Bug Report` sheet must include a `Screenshot` column and embed each issue screenshot directly in that row's screenshot cell when evidence exists. Excel must be readable without manual resizing: practical widths, wrapped text, dynamic row heights, frozen/filterable headers, and colored header/priority/status cells.
6666

6767
Repeated duplicate bugs should be aggregated into one clear row. Keep raw evidence in the technical sheets instead of making the user-facing bug table noisy.
6868

agent/src/api-agent/groq-tool-loop.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export async function runGroqToolLoop(task: QaTask, headed: boolean, maxSteps: n
4747
"Inspect icon-only controls by SVG/title/aria/parent button metadata; delete may be an unlabeled trash icon in a detail drawer bottom action area.",
4848
"Ask before confirming a destructive alternative such as Archive when Delete is unavailable unless explicitly allowed.",
4949
"User-facing reports are Excel-only by default unless the task explicitly asks for Markdown or JSON.",
50-
"The first Excel sheet must be a clean bug report with Module, Issue, Description, Priority, Status.",
50+
"The first Excel sheet must be a clean bug report with Module, Issue, Description, Priority, Status, Screenshot.",
51+
"If an issue has screenshot evidence, embed the image directly in that issue row's Screenshot cell on the Bug Report sheet.",
5152
"Excel reports must be readable without manual resizing: wrapped text, useful widths/heights, frozen headers, and colored headers/priority/status cells.",
5253
"Do not generate CSV reports.",
5354
"Do not push reports, screenshots, logs, or local artifacts to GitHub.",

agent/src/reports/excel.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,39 @@ function issueMatrixRows(context: RunContext): Row[] {
6363
Issue: conciseText(issue.title),
6464
Description: clearText(issue.description),
6565
Priority: issue.severity,
66-
Status: context.finalStatus === "Fail" ? "Blocked" : "Open"
66+
Status: context.finalStatus === "Fail" ? "Blocked" : "Open",
67+
Screenshot: issue.screenshot ? "embedded" : ""
6768
}));
6869
if (!rows.length && context.coverage && context.finalStatus !== "Pass") {
6970
return [{
7071
Module: "Coverage",
7172
Issue: "Coverage incomplete",
7273
Description: clearText(`${context.coverage.notes.join(" ")} Not tested: ${context.coverage.notTested}. Needs verification: ${context.coverage.needsVerification}. Blocked: ${context.coverage.blocked}.`),
7374
Priority: context.coverage.blocked ? "High" : "Medium",
74-
Status: context.coverage.blocked ? "Blocked" : "Needs Verification"
75+
Status: context.coverage.blocked ? "Blocked" : "Needs Verification",
76+
Screenshot: ""
7577
}];
7678
}
7779
return rows.length ? rows : [{
7880
Module: "Lead Module",
7981
Issue: "No issue found",
8082
Description: "No bugs were detected during this run.",
8183
Priority: "Low",
82-
Status: "Pass"
84+
Status: "Pass",
85+
Screenshot: ""
8386
}];
8487
}
8588

89+
function issueMatrixImages(context: RunContext): SheetImage[] {
90+
return userFacingIssues(context)
91+
.map((issue, index) => issue.screenshot ? {
92+
path: issue.screenshot,
93+
rowIndex: index + 1,
94+
columnIndex: 5
95+
} : undefined)
96+
.filter((image): image is SheetImage => Boolean(image));
97+
}
98+
8699
function summaryRows(context: RunContext): Row[] {
87100
const issues = userFacingIssues(context);
88101
const byPriority = ["Critical", "High", "Medium", "Low"].map((priority) => ({
@@ -213,7 +226,7 @@ function browserStateRows(context: RunContext): Row[] {
213226

214227
export function writeExcelReport(context: RunContext, filePath: string): void {
215228
const sheets: Sheet[] = [
216-
{ name: "Bug Report", rows: issueMatrixRows(context) },
229+
{ name: "Bug Report", rows: issueMatrixRows(context), images: issueMatrixImages(context) },
217230
{ name: "Summary", rows: summaryRows(context) },
218231
{
219232
name: "Run Details",
@@ -385,10 +398,11 @@ ${drawing}
385398
}
386399

387400
function columnWidths(headers: string[], rows: Row[], hasDrawing: boolean): string {
401+
const isScreenshotGallery = hasDrawing && headers.includes("path") && headers.includes("image");
388402
const widths = headers.map((header, index) => {
389-
if (hasDrawing && index === 0) return 10;
390-
if (hasDrawing && index === 1) return 70;
391-
if (hasDrawing && index === 2) return 36;
403+
if (isScreenshotGallery && index === 0) return 10;
404+
if (isScreenshotGallery && index === 1) return 70;
405+
if (isScreenshotGallery && index === 2) return 36;
392406
const preferred = preferredColumnWidth(header);
393407
if (preferred) return preferred;
394408
const longest = Math.max(header.length, ...rows.map((row) => String(row[header] ?? "").split("\n").reduce((max, line) => Math.max(max, line.length), 0)));

agent/tests/smoke.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,22 @@ async function main(): Promise<void> {
6868
title: "Some lead conditions do not persist",
6969
severity: "High",
7070
area: "Lead Module",
71-
description: "Result: 1/5 lead conditions saved.\nPassed:\n1. Tag/source/owner - saved and searchable.\nFailed:\n1. Minimal contact fields - not searchable after Save."
71+
description: "Result: 1/5 lead conditions saved.\nPassed:\n1. Tag/source/owner - saved and searchable.\nFailed:\n1. Minimal contact fields - not searchable after Save.",
72+
screenshot: result.context.screenshots[0]
7273
}],
7374
uxIssues: [],
7475
missingValidations: [],
7576
consoleErrors: [],
7677
networkErrors: [],
77-
screenshots: [],
78+
screenshots: [result.context.screenshots[0]],
7879
loginResult: "Not required",
7980
finalStatus: "Partial Pass"
8081
};
8182
writeExcelReport(multilineContext, multilineExcelPath);
8283
const multilineExcelBytes = fs.readFileSync(multilineExcelPath, "utf8");
8384
assert.ok(multilineExcelBytes.includes("Result: 1/5 lead conditions saved.\nPassed:"), "multiline descriptions must keep line breaks");
85+
assert.ok(multilineExcelBytes.includes("Screenshot"), "bug report screenshot column missing");
86+
assert.ok(multilineExcelBytes.includes("xl/worksheets/_rels/sheet1.xml.rels"), "bug report sheet image relationship missing");
8487

8588
const excelOnlyTask: QaTask = {
8689
...task,

plugins/qa-agent/skills/qa-agent/SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ npm run agent:codex -- --task-file <task-file> --headed
3939
`Result: 1/5 lead conditions saved.`
4040
`Passed: 1. Tag/source/owner - saved and searchable.`
4141
`Failed: 1. Minimal contact fields - not searchable after Save. 2. Full address - not searchable after Save.`
42-
- Use this table shape for user-facing reports: `Module`, `Issue`, `Description`, `Priority`, `Status`.
42+
- Use this table shape for user-facing reports: `Module`, `Issue`, `Description`, `Priority`, `Status`, `Screenshot`.
4343
- Generate Excel only by default. Generate Markdown/JSON only when explicitly requested for debugging or automation.
4444
- Do not generate CSV.
4545
- Excel first sheet must be `Bug Report` with only user-facing bug rows.
4646
- Excel second sheet should be `Summary`; technical evidence and coverage sheets can follow after that.
4747
- Excel reports should be readable without manual fixing: practical column widths, wrapped text, dynamic row heights, frozen/filter headers, and colored header/priority/status cells.
4848
- Aggregate repeated duplicate bugs into one clear row. Do not repeat the same bug many times unless each row is materially different.
4949
- Excel reports must embed screenshots/images in the workbook when screenshots exist.
50+
- The first `Bug Report` sheet must include a `Screenshot` column. If an issue has screenshot evidence, place the image directly inside that row's screenshot cell, not only in a separate screenshots sheet.
5051
- Reports must include coverage truth: modules/scopes tested, actions attempted, evidence, status, blockers, and confidence.
5152
- Do not push reports, screenshots, logs, traces, browser state, or `.env` files to GitHub.
5253

0 commit comments

Comments
 (0)