<#if subtitle != "">
-
+
#if>
<#nested>
diff --git a/plugin-code/src/main/resources/template/macros/scenario.ftl b/plugin-code/src/main/resources/template/macros/scenario.ftl
index 0e1187ea..103c72e1 100644
--- a/plugin-code/src/main/resources/template/macros/scenario.ftl
+++ b/plugin-code/src/main/resources/template/macros/scenario.ftl
@@ -41,13 +41,13 @@
<#list report.elements as element>
<#if (skippedRequested && element.skipped) || (failedRequested && element.failed) || (passedRequested && element.passed)>
- ${report.name?html}
+ | ${report.name?html}
|
-
+ |
${element.name?html}
|
-
${element.returnTotalDurationString()}
|
@@ -62,4 +62,66 @@
#if>
+#macro>
+
+<#macro attachments step>
+ <#if step.embeddings??>
+ <#list step.embeddings as attachment>
+
+
+
+ <#if attachment.image>
+
+
+
+ <#else>
+ ${attachment.data?html}
+ #if>
+
+
+
+ #list>
+ #if>
+#macro>
+
+<#macro status step>
+ <#if step.failed>
+ <#assign class = "text-danger" />
+ <#elseif step.skipped>
+ <#assign class = "text-warning" />
+ <#else>
+ <#assign class = "text-success" />
+ #if>
+ ${step.status.statusString}
+#macro>
+
+<#macro errorMessage step>
+ <#if step.result.hasErrorMessage()>
+
+
+
+ ${step.result.errorMessage?html}
+
+
+
+ #if>
+#macro>
+
+<#macro output step>
+ <#if step.output??>
+ <#list step.output as output>
+ <#if output?has_content>
+
+ #if>
+ #list>
+ #if>
#macro>
\ No newline at end of file
diff --git a/plugin-code/src/main/resources/template/scenario-detail.ftl b/plugin-code/src/main/resources/template/scenario-detail.ftl
index 7622830f..4d635c6a 100644
--- a/plugin-code/src/main/resources/template/scenario-detail.ftl
+++ b/plugin-code/src/main/resources/template/scenario-detail.ftl
@@ -1,5 +1,5 @@
<#import "macros/page.ftl"as page>
-<#import "macros/scenario.ftl" as scenarioMacros>
+<#import "macros/scenario.ftl" as scenario>
<#import "macros/navigation.ftl" as navigation>
<@page.page base="../.." links=["tag_summary", "suite_overview"]>
@@ -48,25 +48,12 @@
${before.result.returnDurationString()}
- <#if before.failed>
- <#assign class = "text-danger" />
- <#elseif before.skipped>
- <#assign class = "text-warning" />
- <#else>
- <#assign class = "text-success" />
- #if>
- ${before.status.statusString}
+ <@scenario.status step=before/>
- <#if before.result.hasErrorMessage()>
-
-
-
- ${before.result.errorMessage?html}
-
-
-
- #if>
+ <@scenario.errorMessage step=before/>
+ <@scenario.output step=before/>
+ <@scenario.attachments step=before/>
#list>
#if>
@@ -97,52 +84,12 @@
${step.result.returnDurationString()}
- <#if step.failed>
- <#assign class = "text-danger" />
- <#elseif step.skipped>
- <#assign class = "text-warning" />
- <#else>
- <#assign class = "text-success" />
- #if>
- ${step.status.statusString}
+ <@scenario.status step=step/>
- <#if step.result.hasErrorMessage()>
-
-
-
- ${step.result.errorMessage?html}
-
-
-
- #if>
- <#list step.output as output>
-
- #list>
- <#list step.embeddings as embedding>
-
-
-
- <#if embedding.image>
-
-
-
- <#else>
- ${embedding.data?html}
- #if>
-
-
-
- #list>
+ <@scenario.errorMessage step=step/>
+ <@scenario.output step=step/>
+ <@scenario.attachments step=step/>
#list>
#if>
@@ -161,42 +108,12 @@
${after.result.returnDurationString()}
- <#if after.failed>
- <#assign class = "text-danger" />
- <#elseif after.skipped>
- <#assign class = "text-warning" />
- <#else>
- <#assign class = "text-success" />
- #if>
- ${after.status.statusString}
+ <@scenario.status step=after/>
- <#if after.result.hasErrorMessage()>
-
-
-
- ${after.result.errorMessage?html}
-
-
-
- #if>
- <#list after.embeddings as embedding>
-
-
-
- <#if embedding.image>
-
-
-
- <#else>
- ${embedding.data?html}
- #if>
-
-
-
- #list>
+ <@scenario.errorMessage step=after/>
+ <@scenario.output step=after/>
+ <@scenario.attachments step=after/>
#list>
#if>
diff --git a/plugin-code/src/test/java/com/trivago/rta/json/JsonPojoConverterTest.java b/plugin-code/src/test/java/com/trivago/rta/json/JsonPojoConverterTest.java
index 5d3b7f89..93a89ce7 100644
--- a/plugin-code/src/test/java/com/trivago/rta/json/JsonPojoConverterTest.java
+++ b/plugin-code/src/test/java/com/trivago/rta/json/JsonPojoConverterTest.java
@@ -114,7 +114,7 @@ public void convertJsonToReportPojosTest() throws CluecumberPluginException {
Report report = reports[0];
assertThat(report.getName(), is("Test"));
assertThat(report.getId(), is("test"));
- assertThat(report.toString(), is("Report{line=1, elements=[Element{before=[ResultMatch{result=Result{duration=5554929, status='passed', errorMessage=''}, match=Match{location='BeforeAfterScenario.before(Scenario)', arguments=[]}}], line=5, name='Test feature', description='', id='test;id', after=[ResultMatch{result=Result{duration=153270, status='passed', errorMessage=''}, match=Match{location='BeforeAfterScenario.after(Scenario)', arguments=[]}}], type='scenario', keyword='Scenario', steps=[Step{line=7, name='the start page is opened', keyword='Given ', output=[], rows=[], embeddings=[]}, Step{line=8, name='I see something', keyword='Then ', output=[], rows=[], embeddings=[]}], tags=[Tag{name='@sometag'}, Tag{name='@someothertag'}], scenarioIndex=-1}], name='Test', description='', id='test', keyword='Feature', uri='parallel/features/Test.feature'}"));
+ assertThat(report.toString(), is("Report{line=1, elements=[Element{before=[ResultMatch{result=Result{duration=5554929, status='passed', errorMessage=''}, match=Match{location='BeforeAfterScenario.before(Scenario)', arguments=[]}, output=[], embeddings=[]}], line=5, name='Test feature', description='', id='test;id', after=[ResultMatch{result=Result{duration=153270, status='passed', errorMessage=''}, match=Match{location='BeforeAfterScenario.after(Scenario)', arguments=[]}, output=[], embeddings=[]}], type='scenario', keyword='Scenario', steps=[Step{line=7, name='the start page is opened', keyword='Given ', rows=[]}, Step{line=8, name='I see something', keyword='Then ', rows=[]}], tags=[Tag{name='@sometag'}, Tag{name='@someothertag'}], scenarioIndex=-1}], name='Test', description='', id='test', keyword='Feature', uri='parallel/features/Test.feature'}"));
}
@Test(expected = CluecumberPluginException.class)
diff --git a/plugin-code/src/test/java/com/trivago/rta/rendering/ReportGeneratorTest.java b/plugin-code/src/test/java/com/trivago/rta/rendering/ReportGeneratorTest.java
index cf51ee47..de74382b 100644
--- a/plugin-code/src/test/java/com/trivago/rta/rendering/ReportGeneratorTest.java
+++ b/plugin-code/src/test/java/com/trivago/rta/rendering/ReportGeneratorTest.java
@@ -68,7 +68,7 @@ public void fileOperationsTest() throws Exception {
reportGenerator.generateReport(startPageCollection);
- verify(fileSystemManager, times(4)).createDirectory(anyString());
+ verify(fileSystemManager, times(3)).createDirectory(anyString());
verify(fileSystemManager, times(11)).exportResource(any(Class.class), anyString(), anyString());
verify(fileIO, times(1)).writeContentToFile(eq("RENDERED_START_PAGE_CONTENT"), anyString());
verify(fileIO, times(2)).writeContentToFile(eq("RENDERED_DETAIL_PAGE_CONTENT"), anyString());
diff --git a/plugin-code/src/test/java/com/trivago/rta/rendering/TemplateEngineTest.java b/plugin-code/src/test/java/com/trivago/rta/rendering/TemplateEngineTest.java
index 81f6857c..3d333484 100644
--- a/plugin-code/src/test/java/com/trivago/rta/rendering/TemplateEngineTest.java
+++ b/plugin-code/src/test/java/com/trivago/rta/rendering/TemplateEngineTest.java
@@ -43,7 +43,7 @@ public void getRenderedStartPageTest() throws CluecumberPluginException {
when(templateConfiguration.getTemplate("index")).thenReturn(template);
when(startPageRenderer.getRenderedContent(startPageCollection, template)).thenReturn("START_PAGE_CONTENT");
String renderedStartPage = templateEngine.getRenderedStartPageContent(startPageCollection);
- assertThat(renderedStartPage, is("START_PAGE_CONTENT"));
+ assertThat(renderedStartPage, is("\n \n \n START_PAGE_CONTENT\n \n"));
}
@Test
@@ -53,7 +53,7 @@ public void getRenderedDetailPageTest() throws CluecumberPluginException {
when(templateConfiguration.getTemplate("scenario-detail")).thenReturn(template);
when(scenarioDetailPageRenderer.getRenderedContent(detailPageCollection, template)).thenReturn("DETAIL_PAGE_CONTENT");
String renderedDetailPage = templateEngine.getRenderedDetailPageContent(detailPageCollection);
- assertThat(renderedDetailPage, is("DETAIL_PAGE_CONTENT"));
+ assertThat(renderedDetailPage, is("\n \n \n DETAIL_PAGE_CONTENT\n \n"));
}
@Test
@@ -63,6 +63,6 @@ public void getRenderedTagPageTest() throws CluecumberPluginException {
when(templateConfiguration.getTemplate("tag-summary")).thenReturn(template);
when(tagSummaryPageRenderer.getRenderedContent(tagSummaryPageCollection, template)).thenReturn("TAG_PAGE_CONTENT");
String renderedTagSummaryPage = templateEngine.getRenderedTagSummaryPageContent(tagSummaryPageCollection);
- assertThat(renderedTagSummaryPage, is("TAG_PAGE_CONTENT"));
+ assertThat(renderedTagSummaryPage, is("\n \n \n TAG_PAGE_CONTENT\n \n"));
}
}