All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ftl.jbehave-html-output.ftl Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
<#ftl strip_whitespace=true>
<#macro renderMultiline text>${text?html?replace("\n", "
")} <#macro renderMeta meta>
${keywords.meta}
<#assign metaProperties=meta.getProperties()> <#list metaProperties.keySet() as name> <#assign property = metaProperties.get(name)>
${keywords.metaProperty}${name?html} ${property?html}
<#macro renderNarrative narrative>

${keywords.narrative}

<#assign isAlternative=narrative.isAlternative()?string> <#if isAlternative == "true">
${keywords.asA} ${narrative.asA}
${keywords.iWantTo} ${narrative.iWantTo}
${keywords.soThat} ${narrative.soThat}
<#else>
${keywords.inOrderTo} ${narrative.inOrderTo}
${keywords.asA} ${narrative.asA}
${keywords.iWantTo} ${narrative.iWantTo}
<#macro renderGivenStories givenStories>
${keywords.givenStories}
<#list givenStories.getStories() as givenStory>
${givenStory.path}
<#macro renderLifecycle lifecycle>

${keywords.lifecycle}

<#if !lifecycle.getBeforeSteps().isEmpty()>

${keywords.before}

<#list lifecycle.getBeforeSteps() as step>
${step?html}
<#if !lifecycle.getAfterSteps().isEmpty()>

${keywords.after}

<#list lifecycle.getOutcomes() as outcome>
${keywords.outcome} ${outcome} <#assign metaFilter=lifecycle.getMetaFilter(outcome)> <#if !metaFilter.isEmpty()><#assign metaFilterAsString=metaFilter.asString()>
${keywords.metaFilter} ${metaFilterAsString}
<#list lifecycle.getAfterSteps(outcome) as step>
${step?html}
<#macro renderTable table> <#assign rows=table.getRows()> <#assign headers=table.getHeaders()> <#list headers as header> <#list rows as row> <#list headers as header> <#assign cell=row.get(header)>
${header?html}
${cell?html}
<#macro renderOutcomes table> <#assign outcomes=table.getOutcomes()> <#assign fields=table.getOutcomeFields()> <#list fields as field> <#list outcomes as outcome> <#assign isVerified=outcome.isVerified()?string> <#if isVerified == "true"> <#assign verified="verified"><#else><#assign verified="notVerified">
${field?html}
${outcome.description?html}<@renderOutcomeValue outcome.getValue() table.getDateFormat()/>${outcome.matcher?html}<#if isVerified == "true">${keywords.yes}<#else>${keywords.no}
<#macro renderOutcomeValue value dateFormat><#if value?is_date>${value?string(dateFormat)}<#else>${value?html} <#macro renderStep step> <#assign formattedStep = step.getFormattedStep(EscapeMode.HTML, "{0}")>
${formattedStep}<#if step.getTable()??> <@renderTable step.getTable()/> <@renderStepOutcome step.getOutcome()/>
<#if step.getFailure()??>
${step.failureCause?html}
<#if step.getOutcomes()??>
<@renderOutcomes step.getOutcomes()/> <#if step.getOutcomesFailureCause()??>
${step.outcomesFailureCause?html}
<#macro renderStepOutcome outcome><#if outcome=="pending">(${keywords.pending})<#if outcome=="failed">(${keywords.failed})<#if outcome=="notPerformed">(${keywords.notPerformed})

<@renderMultiline story.getDescription()/>

${story.path}
<#if story.getMeta()??><@renderMeta story.getMeta()/> <#if story.getNarrative()??><@renderNarrative story.getNarrative()/> <#if story.getLifecycle()??><@renderLifecycle story.getLifecycle()/> <#assign scenarios = story.getScenarios()> <#list scenarios as scenario>

${keywords.scenario} <@renderMultiline scenario.getTitle()/>

<#if scenario.getMeta()??><@renderMeta scenario.getMeta()/> <#if scenario.getGivenStories()??><@renderGivenStories scenario.getGivenStories()/> <#if scenario.getExamplesTable()??>

${keywords.examplesTable}

<#list scenario.getExamplesSteps() as step>
${step?html}
<@renderTable scenario.getExamplesTable()/>
<#if scenario.getExamples()??> <#list scenario.getExamples() as example>

${keywords.examplesTableRow} ${example?html}

<#assign steps = scenario.getStepsByExample(example)> <#list steps as step> <@renderStep step/> <#else> <#assign steps = scenario.getSteps()> <#list steps as step> <@renderStep step/>
<#if story.isCancelled()?string == 'true'>
${keywords.storyCancelled} (${keywords.duration} ${story.storyDuration.durationInSecs} s)
<#if story.getPendingMethods()??> <#list story.getPendingMethods() as method>
${method?html}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy