【发布时间】:2018-05-11 15:37:24
【问题描述】:
我将 athaydes 报告用于我的 geb spock html 报告。我正在尝试修改 html 报告以获取测试用例的状态。为此,我添加了新列作为“最后一列” 以下是我正在使用的html:
<table class="summary-table">
<thead>
<tr>
<th>Name</th>
<th>Features</th>
<th>Failed</th>
<th>Errors</th>
<th>Skipped</th>
<th>Time</th>
<th>Final Status</th>
</tr>
</thead>
<tbody>
<% data.each { name, map ->
def s = map.stats%>
<tr class="${s.errors ? 'error' : ''} ${s.failures ? 'failure' : ''} ">
<td><a href="${name}.html">$name</a></td>
<td>${s.totalRuns}</td>
<td>${s.failures}</td>
<td>${s.errors}</td>
<td>${s.skipped}</td>
<td>${fmt.toTimeDuration(s.time)}</td>
<td if="${s.totalRuns} != 0" ? 'PASS' : 'FAILED >${s.totalRuns = 0 ? 'PASS' : 'FAILED' }</td>
</tr>
<% } %>
</tbody>
</table>
现在我的要求是,如果“${s.failures}”和“${s.errors}”和“${s.skipped}”等于零,那么只有列的值应该是“PASS”,否则它应该是“FAILED” .
我尝试了<td if="${s.totalRuns} != 0" ? 'PASS' : 'FAILED >${s.totalRuns = 0 ? 'PASS' : 'FAILED' }</td> 之类的方法,但是这个解决方案不起作用,因为我对 html 很陌生。
你能在这方面帮助我吗?谢谢!
【问题讨论】:
标签: html spock-reports