Skip to content

Commit

Permalink
Merge pull request #19 from antoine-aumjaud/features/FITNESSE-PLUGIN-…
Browse files Browse the repository at this point in the history
…ImproveResultGUI

Improve result summary and captured details gui
  • Loading branch information
antoine-aumjaud committed Nov 5, 2014
2 parents fead311 + 01e30d7 commit 11d4675
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 41 deletions.
15 changes: 7 additions & 8 deletions src/main/java/hudson/plugins/fitnesse/FitnesseResults.java
@@ -1,28 +1,28 @@
package hudson.plugins.fitnesse;

import hudson.model.AbstractBuild;
import hudson.model.Hudson;
import hudson.model.ModelObject;
import hudson.model.Result;
import hudson.model.AbstractBuild;
import hudson.model.Hudson;
import hudson.plugins.fitnesse.NativePageCounts.Counts;
import hudson.tasks.test.TabulatedResult;
import hudson.tasks.test.TestObject;
import hudson.tasks.test.TestResult;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;

import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.logging.Logger;

import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;

public class FitnesseResults extends TabulatedResult implements Comparable<FitnesseResults>{
private static final String DETAILS = "Details";

private static final Logger log = Logger.getLogger("FitNesse");
// private static final Logger log = Logger.getLogger("FitNesse");

private static final long serialVersionUID = 1L;
private transient List<FitnesseResults> failed = null;
Expand Down Expand Up @@ -163,7 +163,6 @@ public boolean isPassed() {

public boolean isSkippedOverall() {
if (isFailedOverall()) return false;
if (getExceptionCount() > 0) return true;
return getPassCount() == 0;
}

Expand Down
Expand Up @@ -5,9 +5,9 @@
<j:if test="${it.hasChildren()}">
<tr><td><strong>Suites: ${it.getChildren().size()}</strong></td></tr>
<tr><th>Name</th><th>Pages</th><th>Right</th><th>Wrong</th><th>Ignored</th><th>Exceptions</th><th>Duration</th></tr>
<j:forEach var="r" items="${it.getChildren()}">
<j:forEach var="r" items="${it.getChildren()}">
<tr><td><a href="${r.name}">${r.name}</a></td><td>${r.totalCount}</td><td>${r.passCount}</td><td>${r.failOnlyCount}</td><td>${r.ignoredCount}</td><td>${r.exceptionCount}</td><td>${r.duration}</td></tr>
</j:forEach>
</j:forEach>
</j:if>
</table>
</j:jelly>
@@ -1,27 +1,72 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<table>
<j:if test="${it.failCount > 0}">
<tr class="result-failed"><td><strong>Wrong and Exceptions: ${it.failCount}</strong></td></tr>
<tr><th>Name</th><th>Right</th><th>Wrong</th><th>Ignored</th><th>Exceptions</th><th>Duration</th><th>Details-Captured</th><th>Details-Remote</th></tr>
<j:forEach var="r" items="${it.failedTests}">
<tr><td>${it.toHtml(r)}</td><td>${r.passCount}</td><td>${r.failOnlyCount}</td><td>${r.ignoredCount}</td><td>${r.exceptionCount}</td><td>${r.duration}</td><td>${r.getDetailsLink()}</td><td>${r.getDetailRemoteLink()}</td></tr>
</j:forEach>
<div class="result-failed"><strong>Wrong and Exceptions: ${it.failCount}</strong>
<table class="pane bigtable">
<tr>
<td class="pane-header">Name</td>
<td class="pane-header">Right</td>
<td class="pane-header">Wrong</td>
<td class="pane-header">Ignored</td>
<td class="pane-header">Exceptions</td>
<td class="pane-header">Duration</td>
<td class="pane-header">Details-Captured</td>
<td class="pane-header">Details-Remote</td>
</tr>
<j:forEach var="r" items="${it.failedTests}">
<tr>
<td>${it.toHtml(r)}</td>
<td>${r.passCount}</td><td>${r.failOnlyCount}</td><td>${r.ignoredCount}</td><td>${r.exceptionCount}</td>
<td>${r.duration}</td>
<td>${r.getDetailsLink()}</td><td>${r.getDetailRemoteLink()}</td>
</tr>
</j:forEach>
</table>
</div>
</j:if>
<j:if test="${it.skipCount > 0}">
<tr class="result-skipped"><td><strong>Ignored: ${it.skipCount}</strong></td></tr>
<tr><th>Name</th><th>Right</th><th>Wrong</th><th>Ignored</th><th>Exceptions</th><th>Duration</th><th>Details-Captured</th><th>Details-Remote</th></tr>
<j:forEach var="r" items="${it.skippedTests}">
<tr><td>${it.toHtml(r)}</td><td>${r.passCount}</td><td>${r.failOnlyCount}</td><td>${r.ignoredCount}</td><td>${r.exceptionCount}</td><td>${r.duration}</td><td>${r.getDetailsLink()}</td><td>${r.getDetailRemoteLink()}</td></tr>
</j:forEach>
<div class="result-skipped"><strong>Ignored: ${it.skipCount}</strong>
<table class="pane bigtable">
<tr>
<td class="pane-header">Name</td>
<td class="pane-header">Ignored</td>
<td class="pane-header">Duration</td>
<td class="pane-header">Details-Captured</td>
<td class="pane-header">Details-Remote</td>
</tr>
<j:forEach var="r" items="${it.skippedTests}">
<tr>
<td>${it.toHtml(r)}</td>
<td>${r.ignoredCount}</td>
<td>${r.duration}</td>
<td>${r.getDetailsLink()}</td><td>${r.getDetailRemoteLink()}</td>
</tr>
</j:forEach>
</table>
</div>
</j:if>
<j:if test="${it.passCount > 0}">
<tr class="result-passed"><td><strong>Right: ${it.passCount}</strong></td></tr>
<tr><th>Name</th><th>Right</th><th>Wrong</th><th>Ignored</th><th>Exceptions</th><th>Duration</th><th>Details-Captured</th><th>Details-Remote</th></tr>
<j:forEach var="r" items="${it.passedTests}">
<tr><td>${it.toHtml(r)}</td><td>${r.passCount}</td><td>${r.failOnlyCount}</td><td>${r.ignoredCount}</td><td>${r.exceptionCount}</td><td>${r.duration}</td><td>${r.getDetailsLink()}</td><td>${r.getDetailRemoteLink()}</td></tr>
</j:forEach>
<div class="result-passed"><strong>Right: ${it.passCount}</strong>
<table class="pane bigtable">
<tr>
<td class="pane-header">Name</td>
<td class="pane-header">Right</td>
<td class="pane-header">Ignored</td>
<td class="pane-header">Duration</td>
<td class="pane-header">Details-Captured</td>
<td class="pane-header">Details-Remote</td>
</tr>
<j:forEach var="r" items="${it.passedTests}">
<tr>
<td>${it.toHtml(r)}</td>
<td>${r.passCount}</td>
<td>${r.ignoredCount}</td>
<td>${r.duration}</td>
<td>${r.getDetailsLink()}</td><td>${r.getDetailRemoteLink()}</td>
</tr>
</j:forEach>
</table>
</div>
</j:if>
</table>
</j:jelly>
Expand Up @@ -2,5 +2,5 @@
xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<link rel="stylesheet" href="/plugin/fitnesse/css/fitnesse_results.css" type="text/css"/>
<div>${it.getDetailsHtml()}</div>
<div id="fitnesse_results">${it.getDetailsHtml()}</div>
</j:jelly>
32 changes: 19 additions & 13 deletions src/main/webapp/css/fitnesse_results.css
@@ -1,60 +1,66 @@
/**
* css for displaying fitnesse test results
*/
#fitnesse_results table, #fitnesse_results td {
border-color: rgb(119, 119, 119);
border-style: solid;
border-width: thin;
border-collapse:collapse;
}

.header a:link {
#fitnesse_results .header a:link {
font-weight: bold;
}

.centered {
#fitnesse_results .centered {
margin: 5px;
text-align: center;
}

.right {
#fitnesse_results .right {
float: right;
}

.left {
#fitnesse_results .left {
float: left;
}

.strike {
#fitnesse_results .strike {
text-decoration: line-through;
}

.code {
#fitnesse_results .code {
font-family: courier, 'Lucida Sans Typewriter', monospace;
font-size: 16px;
color: #004000;
font-weight: bold;
}

.pass {
#fitnesse_results .pass {
background-color: #AAFFAA;
}

.fail {
#fitnesse_results .fail {
background-color: #FFAAAA;
}

.error {
#fitnesse_results .error {
background-color: #FFFFAA;
}

.ignore {
#fitnesse_results .ignore {
background-color: #CCCCCC;
}

.fit_stacktrace {
#fitnesse_results .fit_stacktrace {
font-size: 0.7em;
}

.fit_label {
#fitnesse_results .fit_label {
font-style: italic;
color: #C08080;
}

.fit_grey {
#fitnesse_results .fit_grey {
color: #808080;
}

0 comments on commit 11d4675

Please sign in to comment.