From 55e14541a0ccf5800a1df0e03b258de5c345d980 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Gupta Date: Sat, 13 Jun 2026 14:41:04 +0530 Subject: [PATCH 1/2] fix(html-reporter): use selected run for TraceLink instead of first run --- packages/html-reporter/src/links.tsx | 5 +++-- packages/html-reporter/src/testCaseView.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/html-reporter/src/links.tsx b/packages/html-reporter/src/links.tsx index 4ef431b840c37..018de31c4f066 100644 --- a/packages/html-reporter/src/links.tsx +++ b/packages/html-reporter/src/links.tsx @@ -132,8 +132,9 @@ export const AttachmentLink: React.FunctionComponent<{ ); }; -export const TraceLink: React.FC<{ test: TestCaseSummary, trailingSeparator?: boolean, dim?: boolean }> = ({ test, trailingSeparator, dim }) => { - const firstTraces = test.results.map(result => result.attachments.filter(attachment => attachment.name === 'trace')).filter(traces => traces.length > 0)[0]; +export const TraceLink: React.FC<{ test: TestCaseSummary, run?: number, trailingSeparator?: boolean, dim?: boolean }> = ({ test, run, trailingSeparator, dim }) => { + const resultsToCheck = run !== undefined ? [test.results[run]] : test.results; + const firstTraces = resultsToCheck.map(result => result.attachments.filter(attachment => attachment.name === 'trace')).filter(traces => traces.length > 0)[0]; if (!firstTraces) return undefined; diff --git a/packages/html-reporter/src/testCaseView.tsx b/packages/html-reporter/src/testCaseView.tsx index 11a031fb365f8..4e03ea2534b43 100644 --- a/packages/html-reporter/src/testCaseView.tsx +++ b/packages/html-reporter/src/testCaseView.tsx @@ -62,7 +62,7 @@ export const TestCaseView: React.FC<{
- +
{msToString(test.duration)}
From 20d81712dcac7d1dcdadf33777f72ce6ca48bf6a Mon Sep 17 00:00:00 2001 From: Aditya Kumar Gupta Date: Mon, 15 Jun 2026 20:19:32 +0530 Subject: [PATCH 2/2] fix: guard against empty results in TraceLink --- packages/html-reporter/src/links.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/html-reporter/src/links.tsx b/packages/html-reporter/src/links.tsx index 018de31c4f066..d2d0a905ff7ca 100644 --- a/packages/html-reporter/src/links.tsx +++ b/packages/html-reporter/src/links.tsx @@ -133,7 +133,7 @@ export const AttachmentLink: React.FunctionComponent<{ }; export const TraceLink: React.FC<{ test: TestCaseSummary, run?: number, trailingSeparator?: boolean, dim?: boolean }> = ({ test, run, trailingSeparator, dim }) => { - const resultsToCheck = run !== undefined ? [test.results[run]] : test.results; + const resultsToCheck = run !== undefined && test.results[run] ? [test.results[run]] : test.results; const firstTraces = resultsToCheck.map(result => result.attachments.filter(attachment => attachment.name === 'trace')).filter(traces => traces.length > 0)[0]; if (!firstTraces) return undefined;