Skip to content

Commit 7ab2f04

Browse files
committed
html report improvements for dashboard sizing, maintain integrity of markup in code blocks
1 parent 42ad279 commit 7ab2f04

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

src/main/resources/com/aventstack/extentreports/view/commons/commons-macros.ftl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@
3030
</#macro>
3131

3232
<#macro row test level>
33-
<tr class="s-${test.status}">
33+
<#assign n=test level=n.level>
34+
<#if level!=0><#assign n=test.parent><#if n.level!=0><#assign n=n.parent><#if n.level!=0><#assign n=n.parent></#if></#if></#if>
35+
36+
<tr class="s-${test.status}" test-id="${test.getID()}" parent-id="${n.getID()}">
3437
<td><span class="w-32 avatar circle ${test.status}"><span class="badge">${test.status}</span></span></td>
35-
<td class="_600">${test.name} <#if test.level!=0><br/><span class="text-muted text-sm">${test.parent.name}</span></#if></td>
38+
<td class="_600">${test.name} <#if level!=0><br/><span class="text-muted text-sm">${test.parent.name}</span></#if></td>
3639
<td>${test.runDuration}c</td>
3740
<td><@attributes test=test /></td>
3841
<td>
@@ -41,13 +44,14 @@
4144
<@media el=log />
4245
</#list>
4346
</td>
47+
<td class="static"><i class="static fa fa-external-link"></i></td>
4448
</tr>
4549
<#if test.status==Status.FAIL || test.status==Status.SKIP>
4650
<tr class="details">
4751
<td colspan="5">
4852
<#list test.logContext.all as log>
49-
<#if log.details??><pre>${log.details}</pre></#if>
50-
<#if log.exceptionInfo??><pre>${log.exceptionInfo.stackTrace}</pre></#if>
53+
<#if log.details??><textarea disabled class="code-block">${log.details}</textarea></#if>
54+
<#if log.exceptionInfo??><textarea disabled class="code-block">${log.exceptionInfo.stackTrace}</textarea></#if>
5155
</#list>
5256
</td>
5357
</tr>

src/main/resources/com/aventstack/extentreports/view/v3html/exception-view/v3-html-exception-view.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<td>${ test.startTime?datetime?string["${timeStampFormat}"] }</td>
4242
<td class='linked' test-id='${ test.getID() }'>${ test.hierarchicalName }</td>
4343
<td>
44-
<pre>${ testException.getStackTrace() }</pre>
44+
<textarea disabled class="code-block">${ testException.getStackTrace() }</textarea>
4545
</td>
4646
</tr>
4747
</#if>

src/main/resources/com/aventstack/extentreports/view/v3html/test-view/v3-html-test-view-charts.ftl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
<#assign sizeLarge='s12 m6 l6'>
1+
<#assign sizeLarge='s12 m12 l12'>
22
<#if bddReport || (report.reportStatusStats.childCount != 0 && report.reportStatusStats.grandChildCount != 0)>
3-
<#assign sizeLarge='s12 m4 l4'>
3+
<#assign sizeLarge='s12 m4 l4'>
4+
</#if>
5+
<#if report.reportStatusStats.childCount!=0>
6+
<#assign sizeLarge='s12 m6 l6'>
47
</#if>
58
<div id='test-view-charts' class='subview-full'>
69
<div id='charts-row' class='row nm-v nm-h'>

src/main/resources/com/aventstack/extentreports/view/v3html/v3-html-index.ftl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@
6363
<!-- container -->
6464
<script>
6565
var statusGroup = {
66+
parentCount: ${ report.reportStatusStats.parentCount?c },
6667
passParent: ${ report.reportStatusStats.parentCountPass?c },
6768
failParent: ${ report.reportStatusStats.parentCountFail?c },
6869
fatalParent: ${ report.reportStatusStats.parentCountFatal?c },
6970
errorParent: ${ report.reportStatusStats.parentCountError?c },
7071
warningParent: ${ report.reportStatusStats.parentCountWarning?c },
7172
skipParent: ${ report.reportStatusStats.parentCountSkip?c },
7273
exceptionsParent: ${ report.reportStatusStats.parentCountExceptions?c },
73-
74+
childCount: ${ report.reportStatusStats.childCount?c },
7475
passChild: ${ report.reportStatusStats.childCountPass?c },
7576
failChild: ${ report.reportStatusStats.childCountFail?c },
7677
fatalChild: ${ report.reportStatusStats.childCountFatal?c },
@@ -80,7 +81,7 @@
8081
infoChild: ${ report.reportStatusStats.childCountInfo?c },
8182
debugChild: ${ report.reportStatusStats.childCountDebug?c },
8283
exceptionsChild: ${ report.reportStatusStats.childCountExceptions?c },
83-
84+
grandChildCount: ${ report.reportStatusStats.grandChildCount?c },
8485
passGrandChild: ${ report.reportStatusStats.grandChildCountPass?c },
8586
failGrandChild: ${ report.reportStatusStats.grandChildCountFail?c },
8687
fatalGrandChild: ${ report.reportStatusStats.grandChildCountFatal?c },

0 commit comments

Comments
 (0)