<% def stats = utils.stats( data ) def config = com.aoe.gebspockreports.GebReportConfigLoader.instance.config def gebUtils = new com.aoe.gebspockreports.GebReportUtils() def gebReport = gebUtils.readGebReport() def specReport = gebReport.findSpecByLabel(utils.getSpecClassName(data)) %> <% if (config.customCssFile != null) { %> <% } %> <% def writeIssuesOrSees = { issues, description -> if ( issues?.value() ) { %>

$description:

<% } } def writeStackTrace = { error, index, featureName -> def uniqueId = "${featureName.hashCode()}-${index}" %>
$error
<% gebUtils.writeStacktrace(error, out) %>
<% } def writeReportInfo = { reportInfo -> if (reportInfo) { %>

Report Info:

<% } } %>

Report for ${utils.getSpecClassName(data)}


Created on ${new Date()} by ${System.properties['user.name']} Back to index <% // spec title and narrative def specTitle = utils.specAnnotation(data, spock.lang.Title)?.value() ?: '' def narrative = (data.info.narrative ?: '') def reportHeader = utils.specHeaders(data) if (specTitle) { %>

$specTitle

<% } if (narrative) { %>
$narrative
<% } // issues/see annotations writeIssuesOrSees(utils.specAnnotation(data, spock.lang.Issue), 'Issues') writeIssuesOrSees(utils.specAnnotation(data, spock.lang.See), 'See') def summaryCssClass = stats.successRate < 1 ? 'failure' : 'passed' %>

Summary

Executed features Failures Errors Skipped Success rate Time
${stats.totalRuns} ${stats.failures} ${stats.errors} ${stats.skipped} ${fmt.toPercentage(stats.successRate)} ${fmt.toTimeDuration(stats.time)}
<% if (reportHeader) { %>

Report Header

<% } %>

Features


<% def featureCount = 0 features.eachFeature { name, result, blocks, iterations, params -> def failedIterations = iterations.findAll { it.dataValues || it.errors } def problems = iterations.findAll { it.errors } def isFailure = result in ['FAIL', 'FAILURE'] def isError = result == 'ERROR' def isIgnored = result == 'IGNORED' def cssClass = isIgnored ? 'ignored' : (isError ? 'error' : (isFailure ? 'failure' : '')) featureCount += isIgnored ? 0 : 1 def gebFeatureReport = specReport?.findFeatureByNumberAndName(featureCount, name) def gebArtifacts = gebFeatureReport?.artifacts %>
$name <% def ignoreReason = description.getAnnotation(spock.lang.Ignore)?.value() if (ignoreReason) { %>

$ignoreReason

<% } %>
<% if (!isIgnored) { if (utils.isUnrolled(delegate)) { writeReportInfo(utils.nextSpecExtraInfo(data)) } else { (1..iterations.size()).each { writeReportInfo(utils.nextSpecExtraInfo(data)) } } } %> <% writeIssuesOrSees(description.getAnnotation(spock.lang.Issue), 'Issues') writeIssuesOrSees(description.getAnnotation(spock.lang.See), 'See') %>

Code Blocks:

<% blocks.forEach { block -> %> <% } %>

$block.kind

$block.text

<% if (block.sourceCode) { %>
<%
                block.sourceCode.each { out << it << System.getProperty("line.separator") }
                %>
<% } %>
<% if (params && failedIterations) { def failCount = iterations.findAll { it.failures || it.errors }.size() def passedCount = iterations.size() - failCount %>

Data Table ($passedCount/${iterations.size()} passed):

<% params.forEach { param -> %> <% }%> <% failedIterations.forEach { iteration -> %> <% iteration.dataValues.each { dataValue -> %> <% } %> <% }%>
$paramResult
$dataValue${iteration.errors ? 'FAIL' : 'OK'}
<% } %> <% if (gebArtifacts) { %>

Geb Artifacts:

<% gebArtifacts.sort { it.number }.each { artifact -> def label = artifact.label?.replaceFirst(name+"-", '') def trCssClass = label.endsWith('-failure') ? 'geb-failure' : '' def imageFile = "./" + artifact.files.find { it.endsWith('png') } def domSnapshotFile = "./" + artifact.files.find { it.endsWith('html') } %> <% } %>
Label Image Html Page object
$label png html ${artifact.pageObject}
<% } %> <% if (problems) { %>
The following problems occurred:
    <% problems.eachWithIndex { problem, index -> if (problem.dataValues) { %>
  • Input: $problem.dataValues
    • <% problem.errors.each { error -> %>
    • <% writeStackTrace(error, index, name) %>
    • <% } %>
    <% } else { problems.errors.forEach { error -> %>
  • <% writeStackTrace(error[0], index, name) %>
  • <% } } } %>
<% } %>
<% gebFeatureReport?.addedToReport = true } %> <% def unassignedArtifacts = specReport?.getUnassignedGebArtifacts() if (unassignedArtifacts) { %>

Unassigned Geb Artifacts

The following artifacts could not be mapped to a feature.
<% unassignedArtifacts.forEach { artifact -> def label = artifact.label def imageFile = "./" + artifact.files.find { it.endsWith('png') } def domSnapshotFile = "./" + artifact.files.find { it.endsWith('html') } %> <% } %>
Label Image Html Page object
$label png html ${artifact.pageObject}
<% } %>