diff --git a/README.md b/README.md
index cfc8b75..916c6f6 100644
--- a/README.md
+++ b/README.md
@@ -146,6 +146,16 @@ Options are specified on the [`with` map](https://docs.github.com/en/actions/usi
show: "fail, skip"
```
+* **`folded`: display test details in a folded details block** (optional)
+ When enabled the details for each test result will be nested in a details blocks which can be expanded by clicking on the test name. This option can be `true` or `false` (The default).
+
+ ```yaml
+ - uses: test-summary/action@v2
+ with:
+ paths: "test/results/**/TEST-*.xml"
+ folded: true
+ ```
+
FAQ
---
* **How is the summary graphic generated? Does any of my data ever leave GitHub?**
diff --git a/action.yml b/action.yml
index 5613916..f66a8ed 100644
--- a/action.yml
+++ b/action.yml
@@ -9,6 +9,8 @@ inputs:
description: File to write with rendered output
show:
description: Types of tests to show in the results table
+ folded:
+ description: Show each result in a folded details block
runs:
using: 'node20'
main: 'index.js'
diff --git a/src/dashboard.ts b/src/dashboard.ts
index 24fcb0b..c949a40 100644
--- a/src/dashboard.ts
+++ b/src/dashboard.ts
@@ -28,7 +28,7 @@ export function dashboardSummary(result: TestResult): string {
return ``
}
-export function dashboardResults(result: TestResult, show: number): string {
+export function dashboardResults(result: TestResult, show: number, folded: boolean): string {
let table = "
"
+ if (folded) {
+ table += "" + } const icon = statusIcon(testcase.status) if (icon) { @@ -55,6 +58,10 @@ export function dashboardResults(result: TestResult, show: number): string { table += escapeHTML(testcase.description) } + if (folded) { + table += "" + } + if (testcase.message || testcase.details) { table += "\n" @@ -71,6 +78,10 @@ export function dashboardResults(result: TestResult, show: number): string { } } + if (folded) { + table += " |