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

Report for ${utils.getSpecClassName(data)}


<% // spec title and narrative def specTitle = utils.specAnnotation(data, spock.lang.Title)?.value() ?: '' def narrative = (data.info.narrative ?: '') 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') %>

Summary:

Created on ${new Date()} by ${System.properties['user.name']}

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

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 %> <% blocks.forEach { block -> %> <% } %> <% if (params && failedIterations) { %> <% def failCount = iterations.findAll { it.failures || it.errors }.size() def passedCount = iterations.size() - failCount %> <% } %> <% if (gebArtifacts) { %> <% } %> <% if (problems) { %> <% } %> <% } %>
$name To top <% def ignoreReason = description.getAnnotation(spock.lang.Ignore)?.value() if (ignoreReason) { %>
$ignoreReason
<% } writeIssuesOrSees(description.getAnnotation(spock.lang.Issue), 'Issues') writeIssuesOrSees(description.getAnnotation(spock.lang.See), 'See') %>

$block.kind

$block.text

Params:
<% params.forEach { param -> %> <% }%> <% failedIterations.forEach { iteration -> %> <% iteration.dataValues.each { dataValue -> %> <% } %> <% }%>
$param
$dataValue${iteration.errors ? 'FAIL' : 'OK'}

$passedCount/${iterations.size()} passed

Geb artifacts

<% gebArtifacts.sort { it.number }.each { artifact -> def label = artifact.label?.replaceFirst(name+"-", '') def trCssClass = label == '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}
The following problems occurred:
    <% problems.forEach { problem -> if (problem.dataValues) { %>
  • $problem.dataValues
    • <% problem.errors.forEach { error -> %>
    • $error
    • <% } %>
    <% } else { problems.errors.forEach { error -> %>
  • ${error[0]}
  • <% } } } %>