Trace Timeline
' + renderSpanRows(sp, 't-' + rootSpanId) + '
';
}
@@ -1719,12 +1735,7 @@ function renderSuiteTrace(className) {
if (!suite) return '';
const allSpans = spansByTrace[suite.traceId];
if (!allSpans) return '';
- const all = getDescendants(allSpans, suite.spanId);
- const testCaseIds = new Set();
- all.forEach(s => { if (s.spanType === 'test case') testCaseIds.add(s.spanId); });
- const tcDescendants = new Set();
- testCaseIds.forEach(id => { getDescendants(all, id).forEach(s => { if (s.spanId !== id) tcDescendants.add(s.spanId); }); });
- const filtered = all.filter(s => !tcDescendants.has(s.spanId) && !testCaseIds.has(s.spanId));
+ const filtered = collapseTestBodySpans(getDescendants(allSpans, suite.spanId));
// Include parent spans (assembly, session) for context
let ancestor = suite.parentSpanId ? bySpanId[suite.parentSpanId] : null;
while (ancestor) {
diff --git a/TUnit.Engine/Reporters/Html/HtmlReporter.cs b/TUnit.Engine/Reporters/Html/HtmlReporter.cs
index 5c3213503f..7efe9b4dca 100644
--- a/TUnit.Engine/Reporters/Html/HtmlReporter.cs
+++ b/TUnit.Engine/Reporters/Html/HtmlReporter.cs
@@ -336,7 +336,7 @@ private ReportData BuildReportData()
ClassName = kvp.Key,
Namespace = groupNamespaces.GetValueOrDefault(kvp.Key, ""),
Summary = groupSummary,
- Tests = kvp.Value.ToArray()
+ Tests = OrderTestsForDisplay(kvp.Value)
};
}
@@ -465,6 +465,15 @@ internal static string[] FilterAdditionalTraceIds(string[] allTraceIds, string?
}
#endif
+ internal static ReportTestResult[] OrderTestsForDisplay(IEnumerable