templates.default.feature_map.ftlh Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cucumber-report-generator Show documentation
Show all versions of cucumber-report-generator Show documentation
The part of the Cucumber Reports library directly responsible for
reports generation.
${refreshData}
${title}
${title}
<#include "pie_chart">
<#assign colOffset = table.getRows().depth() >
<#assign rowOffset = table.getCols().depth() >
<#list 0..(rowOffset-1) as i>
<#assign line = table.getCols().getRow(i) >
<#list line as item>
<#if item.depth() == 1>
${item.getAlias()}
<#else>
${item.getAlias()}
#if>
#list>
#list>
<#macro drawCell scenarios>
<#assign index = 0>
<#assign prevFeature = "">
<#assign first = true>
<#list scenarios as scenario>
<#if scenario.getFeature().getName() != prevFeature>
<#if first>
<#assign first=false>
<#else>
#if>
Feature: ${scenario.getFeature().getName()}
#if>
-
Scenario: ${scenario.getName()}
<#assign prevFeature = scenario.getFeature().getName() >
<#assign index++ >
#list>
<#if !first>
#if>
#macro>
<#macro drawScenario scenario>
${scenario.getDescription()}
<#list scenario.getSteps() as step>
${step.getKeyword()} ${step.getName()}
<#if step.getDocString()?has_content>
${step.getDocString()}
#if>
<#if step.getRows()?has_content>
<#list step.getRows() as row>
<#list row as cell >
${cell}
#list>
#list>
#if>
#list>
#macro>
<#function generateRowHeading data maxDepth level>
<#assign cellDepth = 1 >
<#assign aliasText = data.getAlias() >
<#if data.depth() == 1>
<#assign cellDepth = maxDepth - level + 1 >
#if>
<#assign content = "${aliasText} " >
<#if data.hasSubElements()>
<#list data.getSubElements() as item >
<#assign content = content + generateRowHeading(item, maxDepth, level + 1) >
#list>
<#else>
<#assign content = content + "" >
#if>
<#return content>
#function>
<#function generateRowHeadingFromTable table>
<#assign rows = table.getRows() >
<#return " " + generateRowHeading(rows, rows.depth(), 1) + " ">
#function>
<#assign rowHeadings = generateRowHeadingFromTable(table) >
<#assign headingRows = rowHeadings?split("") >
<#list 0..(scenarios?size - 1) as i>
<#assign row = headingRows[i]>
${row}
<#list 0..(scenarios[i]?size - 1) as j>
<@drawCell scenarios=scenarios[i][j] />
#list>
#list>