Skip to content

Commit

Permalink
Added Evidence section to the home page Test Results
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Oct 13, 2018
1 parent 283382e commit c4361e5
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 6 deletions.
43 changes: 40 additions & 3 deletions serenity-report-resources/src/main/resources/freemarker/home.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
$('.scenario-result-table').DataTable({
"order": [[0, "asc",], [3, "asc",]],
"pageLength": 25,
"pageLength": 10,
"language": {
searchPlaceholder: "Filter",
search: ""
Expand All @@ -47,10 +47,19 @@
// Results table
$('#test-results-table').DataTable({
"order": [[0, "asc",], [3, "asc",]],
"pageLength": 100,
"lengthMenu": [[25, 50, 100, 200, -1], [25, 50, 100, 200, "All"]]
"pageLength": 10,
"lengthMenu": [[10, 25, 50, 100, 200, -1], [10, 25, 50, 100, 200, "All"]]
});
$('#evidence-table').DataTable(
<#if evidence?size <= 10 >
{
searching: false,
paging: false,
info: false
}
</#if>
);
})
;
</script>
Expand Down Expand Up @@ -603,6 +612,34 @@
</div>
</div>
<#if evidence?has_content>
<div class="row">
<div class="col-sm-12">
<h3><i class="far fa-file"></i> Evidence</h3>
<table id="evidence-table" class="table table-bordered">
<thead>
<tr>
<th>Scenario</th>
<th>Title</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<#list evidence as evidenceRecord>
<tr>
<td>${evidenceRecord.scenario}</td>
<td>${evidenceRecord.title}</td>
<td>${evidenceRecord.detailsLink}</td>
</tr>
</#list>
</tbody>
</table>
</div>
</div>
</#if>
</div>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@
info: false
});
$('#evidence-table').DataTable(
<#if evidence?size <= 10 >
{
searching: false,
ordering: false,
paging: false,
info: false
}
</#if>
);
$(".scenario-docs .card-body table").wrap("<div class='table-responsive'></div>");
$("#requirements-tabs").tabs();
Expand Down Expand Up @@ -703,7 +715,7 @@
<div class="row">
<div class="col-sm-12">
<h3><i class="far fa-file"></i> Evidence</h3>
<table class="table table-bordered">
<table id="evidence-table" class="table table-bordered">
<thead>
<tr>
<th>Scenario</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ private static String detailsLinkFor(TestOutcome testOutcome, ReportData reportD
+ "'><i class='fas fa-download'></i>&nbsp;Download Evidence</a>";
} else {
String report = ReportNamer.forReportType(ReportType.HTML).getNormalizedTestNameFor(testOutcome);
return "<a role='button' target='_blank' class='btn btn-success btn-sm' href='"
return "<a role='button' class='btn btn-success btn-sm' href='"
+ report
+ "'><i class='fas fa-download'></i>&nbsp;Details</a>";
+ "'><i class=\"fas fa-external-link-alt\"></i>&nbsp;Details</a>";
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public Map<String, Object> getBuildContext(TestOutcomes testOutcomes,
context.put("testCases", executedScenariosIn(testOutcomes));
context.put("automatedTestCases", automated(executedScenariosIn(testOutcomes)));
context.put("manualTestCases", manual(executedScenariosIn(testOutcomes)));
context.put("evidence", EvidenceData.from(testOutcomes));

context.put("frequentFailures", FrequentFailures.from(testOutcomes).withMaxOf(5));
context.put("unstableFeatures", UnstableFeatures.from(testOutcomes)
Expand Down

0 comments on commit c4361e5

Please sign in to comment.