Skip to content

Commit 2046242

Browse files
authored
Added new community report failed-detailed.hbs
The **failed-detailed** report focuses exclusively on failed test cases, providing a clear and detailed summary of each failure. For every failed test, the report includes the test name, the failure message, stack trace, code snippet, standard output, and standard error if available. This report is designed to help developers quickly diagnose and address issues providing the exact place where the failure occured. If there are no failing tests, the template will render **No failed tests 🎉** instead of the failed tests table.
1 parent 740c027 commit 2046242

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{{#if ctrf.summary.failed}}
2+
<table>
3+
<thead>
4+
<tr>
5+
<th>Failed Tests {{getCtrfEmoji "failed"}}</th>
6+
<th>Fail Message</th>
7+
</tr>
8+
</thead>
9+
<tbody>
10+
{{#each ctrf.tests}}
11+
{{#if (eq status "failed")}}
12+
<tr>
13+
<td>{{getCtrfEmoji "failed"}} {{name}}</td>
14+
<td>
15+
<details>
16+
<summary>{{#if message}}{{formatTestMessagePreCode message true}}{{else}}No message available{{/if}}</summary>
17+
<p><strong>Trace:</strong></p>
18+
<pre><code>{{#if trace}}{{formatTestMessagePreCode trace true}}{{else}}No trace available{{/if}}</code></pre>
19+
<p><strong>Snippet:</strong></p>
20+
<pre><code>{{#if snippet}}{{formatTestMessagePreCode snippet true}}{{else}}No snippet available{{/if}}</code></pre>
21+
<p><strong>Standard Output:</strong></p>
22+
<pre><code>{{#if stdout}}{{formatTestMessagePreCode (join stdout "\n") true}}{{else}}No standard output available{{/if}}</code></pre>
23+
<p><strong>Standard Error:</strong></p>
24+
<pre><code>{{#if stderr}}{{formatTestMessagePreCode (join stderr "\n") true}}{{else}}No standard error available{{/if}}</code></pre>
25+
</details>
26+
</td>
27+
</tr>
28+
{{/if}}
29+
{{/each}}
30+
</tbody>
31+
</table>
32+
{{else}}
33+
<p>No failed tests ✨</p>
34+
{{/if}}

0 commit comments

Comments
 (0)