- <#if TestService.testHasCategory(node)>
-
- <#list node.categoryContext.all as category>
- ${category.name}
- #list>
-
- #if>
-
${TestService.getRunDuration(node)}
-
-
${MaterialIcon.getIcon(node.status)} ${node.behaviorDrivenTypeName}: ${node.name}
- <#if TestService.testHasScreenCapture(node)>
-
- <#list node.screenCaptureContext.all as sc>
- - panorama
- #list>
-
- #if>
- <#if node.description?? && node.description?has_content>
- ${node.description}
- #if>
-
- <#if TestService.testHasChildren(node)>
-
- #if>
+ <#if TestService.testHasCategory(node)>
+
+ <#list node.categoryContext.all as category>
+ ${category.name}
+ #list>
+
+ #if>
+
${TestService.getRunDuration(node)}
+
+
${MaterialIcon.getIcon(node.status)} ${node.behaviorDrivenTypeName}: ${node.name}
+ <#if TestService.testHasScreenCapture(node)>
+
+ <#list node.screenCaptureContext.all as sc>
+ <#if sc.path??>
+ - panorama
+ <#elseif sc.isBase64()>
+ - panorama
+ #if>
+ #list>
+
+ #if>
+ <#if node.description?? && node.description?has_content>
+ ${node.description}
+ #if>
+
+ <#if TestService.testHasChildren(node)>
+
+ #if>
#list>
\ No newline at end of file
diff --git a/src/test/java/com/aventstack/extentreports/reporter/Base64Tests.java b/src/test/java/com/aventstack/extentreports/reporter/Base64Tests.java
new file mode 100644
index 0000000..c86fa3f
--- /dev/null
+++ b/src/test/java/com/aventstack/extentreports/reporter/Base64Tests.java
@@ -0,0 +1,50 @@
+package com.aventstack.extentreports.reporter;
+
+import org.testng.annotations.Test;
+
+import com.aventstack.extentreports.ExtentReports;
+import com.aventstack.extentreports.gherkin.model.Feature;
+import com.aventstack.extentreports.gherkin.model.Given;
+import com.aventstack.extentreports.gherkin.model.Scenario;
+
+public class Base64Tests {
+
+ private final static String BASE64 = "";
+
+ @Test
+ public void testBase64BDDAtFeature() {
+ ExtentReports extent = new ExtentReports();
+ ExtentHtmlReporter html = new ExtentHtmlReporter("html/index.html");
+ ExtentSparkReporter spark = new ExtentSparkReporter("spark/index.html");
+ extent.attachReporter(html, spark);
+ extent.createTest(Feature.class, "Feature")
+ .addScreenCaptureFromBase64String(BASE64);
+ extent.flush();
+ }
+
+ @Test
+ public void testBase64BDDAtScenario() {
+ ExtentReports extent = new ExtentReports();
+ ExtentHtmlReporter html = new ExtentHtmlReporter("html/index.html");
+ ExtentSparkReporter spark = new ExtentSparkReporter("spark/index.html");
+ extent.attachReporter(html, spark);
+ extent.createTest(Feature.class, "Feature")
+ .createNode(Scenario.class, "Scenario")
+ .addScreenCaptureFromBase64String(BASE64);
+ extent.flush();
+ }
+
+ @Test
+ public void testBase64BDDAtStep() {
+ ExtentReports extent = new ExtentReports();
+ ExtentHtmlReporter html = new ExtentHtmlReporter("html/index.html");
+ ExtentSparkReporter spark = new ExtentSparkReporter("spark/index.html");
+ extent.attachReporter(html, spark);
+ extent.createTest(Feature.class, "Feature")
+ .createNode(Scenario.class, "Scenario")
+ .createNode(Given.class, "Given")
+ .addScreenCaptureFromBase64String(BASE64);
+ extent.flush();
+ }
+
+}
diff --git a/src/test/java/com/aventstack/extentreports/reporter/HtmlBasicFileReporterConfigurationTest.java b/src/test/java/com/aventstack/extentreports/reporter/HtmlBasicFileReporterConfigurationTest.java
index 6a18c37..9d9b6a7 100644
--- a/src/test/java/com/aventstack/extentreports/reporter/HtmlBasicFileReporterConfigurationTest.java
+++ b/src/test/java/com/aventstack/extentreports/reporter/HtmlBasicFileReporterConfigurationTest.java
@@ -11,20 +11,20 @@ public class HtmlBasicFileReporterConfigurationTest extends Base {
@Test
public void htmlReporterHasInitialConfig(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
Assert.assertFalse(html.getConfigurationStore().isEmpty());
}
@Test
public void testHtmlReporterUserConfigInitialCSSNull(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
String v = (String) html.getConfigurationStore().getConfig("css");
Assert.assertNull(v);
}
@Test
public void testHtmlReporterUserConfigCSSHasValue(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
String css = ".dark{background:black;}";
html.config().setCSS(css);
String v = (String) html.getConfigurationStore().getConfig("css");
@@ -33,7 +33,7 @@ public void testHtmlReporterUserConfigCSSHasValue(Method method) {
@Test
public void testHtmlReporterUserConfigCSSValue(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
String css = ".dark{background:black;}";
html.config().setCSS(css);
String v = (String) html.getConfigurationStore().getConfig("css");
@@ -42,14 +42,14 @@ public void testHtmlReporterUserConfigCSSValue(Method method) {
@Test
public void testHtmlReporterUserConfigInitialJSNull(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
String v = (String) html.getConfigurationStore().getConfig("js");
Assert.assertNull(v);
}
@Test
public void testHtmlReporterUserConfigJSHasValue(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
html.config().setJS("alert('');");
String v = (String) html.getConfigurationStore().getConfig("js");
Assert.assertFalse(v.isEmpty());
@@ -57,7 +57,7 @@ public void testHtmlReporterUserConfigJSHasValue(Method method) {
@Test
public void testHtmlReporterUserConfigJSValue(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
String js = "alert('');";
html.config().setJS(js);
String v = (String) html.getConfigurationStore().getConfig("js");
@@ -66,20 +66,20 @@ public void testHtmlReporterUserConfigJSValue(Method method) {
@Test
public void documentTitleInitialValueTest(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
Assert.assertFalse(html.getConfigurationStore().getConfig("documentTitle").toString().isEmpty());
}
@Test
public void documentTitleInitialUserValueTest(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
String v = (String) html.getConfigurationStore().getConfig("documentTitle");
Assert.assertNotNull(v);
}
@Test
public void documentTitleUserValueTest(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
String docTitle = "test";
html.config().setDocumentTitle(docTitle);
String v = (String) html.getConfigurationStore().getConfig("documentTitle");
@@ -88,20 +88,20 @@ public void documentTitleUserValueTest(Method method) {
@Test
public void encodingInitialValueTest(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
Assert.assertTrue(html.getConfigurationStore().getConfig("encoding").toString().equalsIgnoreCase("utf-8"));
}
@Test
public void encodingInitialUserValueTest(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
String v = (String) html.getConfigurationStore().getConfig("encoding");
Assert.assertNotNull(v);
}
@Test
public void encodingUserValueTest(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
+ ExtentSparkReporter html = new ExtentSparkReporter(method.getName() + ".html");
String encoding = "utf-16";
html.config().setEncoding(encoding);
String v = (String) html.getConfigurationStore().getConfig("encoding");
diff --git a/src/test/java/com/aventstack/extentreports/reporter/HtmlConfigurableReporterTest.java b/src/test/java/com/aventstack/extentreports/reporter/HtmlConfigurableReporterTest.java
index 7c2bca2..73c6aa7 100644
--- a/src/test/java/com/aventstack/extentreports/reporter/HtmlConfigurableReporterTest.java
+++ b/src/test/java/com/aventstack/extentreports/reporter/HtmlConfigurableReporterTest.java
@@ -19,47 +19,47 @@ public class HtmlConfigurableReporterTest extends Base {
private static final String CSS = ".test.active { border: 1px solid #ccc; }";
private static final String JS = "$('.test').click(function() { console.log('test'); });";
- private ExtentHtmlReporter html;
+ private ExtentSparkReporter spark;
@BeforeClass
public void beforeClass() {
- html = new ExtentHtmlReporter("Extent.html");
- html.loadXMLConfig(CONFIG_PATH);
+ spark = new ExtentSparkReporter("Extent.html");
+ spark.loadXMLConfig(CONFIG_PATH);
}
@Test
public void testTheme(Method method) {
- Assert.assertEquals(html.getConfigurationStore().getConfig("theme"), THEME);
+ Assert.assertEquals(spark.getConfigurationStore().getConfig("theme"), THEME);
}
@Test
public void testEncoding(Method method) {
- Assert.assertTrue(String.valueOf(html.getConfigurationStore().getConfig("encoding")).equalsIgnoreCase(ENCODING));
+ Assert.assertTrue(String.valueOf(spark.getConfigurationStore().getConfig("encoding")).equalsIgnoreCase(ENCODING));
}
@Test
public void testDocumentTitle(Method method) {
- Assert.assertEquals(html.getConfigurationStore().getConfig("documentTitle"), DOCUMENT_TITLE);
+ Assert.assertEquals(spark.getConfigurationStore().getConfig("documentTitle"), DOCUMENT_TITLE);
}
@Test
public void testReportName(Method method) {
- Assert.assertEquals(html.getConfigurationStore().getConfig("reportName"), REPORT_NAME);
+ Assert.assertEquals(spark.getConfigurationStore().getConfig("reportName"), REPORT_NAME);
}
@Test
public void testTimestampFormat(Method method) {
- Assert.assertEquals(html.getConfigurationStore().getConfig("timeStampFormat"), TIMESTAMP_FORMAT);
+ Assert.assertEquals(spark.getConfigurationStore().getConfig("timeStampFormat"), TIMESTAMP_FORMAT);
}
@Test
public void testCSS(Method method) {
- Assert.assertTrue(html.getConfigurationStore().getConfig("styles").toString().contains(CSS));
+ Assert.assertTrue(spark.getConfigurationStore().getConfig("styles").toString().contains(CSS));
}
@Test
public void testJS(Method method) {
- Assert.assertTrue(html.getConfigurationStore().getConfig("scripts").toString().contains(JS));
+ Assert.assertTrue(spark.getConfigurationStore().getConfig("scripts").toString().contains(JS));
}
}
diff --git a/src/test/java/com/aventstack/extentreports/reporter/HtmlRichViewReporterConfigurationTest.java b/src/test/java/com/aventstack/extentreports/reporter/HtmlRichViewReporterConfigurationTest.java
index 566c560..6ddbde5 100644
--- a/src/test/java/com/aventstack/extentreports/reporter/HtmlRichViewReporterConfigurationTest.java
+++ b/src/test/java/com/aventstack/extentreports/reporter/HtmlRichViewReporterConfigurationTest.java
@@ -12,65 +12,49 @@ public class HtmlRichViewReporterConfigurationTest {
@Test
public void testHtmlReporterUserConfigEnableTimelineEnabled(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
- html.config().enableTimeline(true);
- String v = (String) html.getConfigurationStore().getConfig("enableTimeline");
+ ExtentSparkReporter spark = new ExtentSparkReporter(method.getName() + ".html");
+ spark.config().enableTimeline(true);
+ String v = (String) spark.getConfigurationStore().getConfig("enableTimeline");
Assert.assertEquals(v, String.valueOf(true));
}
@Test
public void testHtmlReporterUserConfigEnableTimelineDisabled(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
- html.config().enableTimeline(false);
- String v = (String) html.getConfigurationStore().getConfig("enableTimeline");
+ ExtentSparkReporter spark = new ExtentSparkReporter(method.getName() + ".html");
+ spark.config().enableTimeline(false);
+ String v = (String) spark.getConfigurationStore().getConfig("enableTimeline");
Assert.assertEquals(v, String.valueOf(false));
}
- /*
- @Test
- public void testHtmlReporterUserConfigAutoConfigMediaEnabled(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
- html.config().setAutoCreateRelativePathMedia(true);
- String v = (String) html.getConfigurationStore().getConfig("autoCreateRelativePathMedia");
- Assert.assertEquals(v, String.valueOf(true));
- }
- @Test
- public void testHtmlReporterUserConfigAutoConfigMediaDisabled(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
- html.config().setAutoCreateRelativePathMedia(false);
- String v = (String) html.getConfigurationStore().getConfig("autoCreateRelativePathMedia");
- Assert.assertEquals(v, String.valueOf(false));
- }
- */
@Test
public void testHtmlReporterUserConfigDetaultProtocol(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
- String v = (String) html.getConfigurationStore().getConfig("protocol");
+ ExtentSparkReporter spark = new ExtentSparkReporter(method.getName() + ".html");
+ String v = (String) spark.getConfigurationStore().getConfig("protocol");
Assert.assertEquals(Enum.valueOf(Protocol.class, v.toUpperCase()), Protocol.HTTPS);
}
@Test
public void testHtmlReporterUserConfigProtocolSetting(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
- html.config().setProtocol(Protocol.HTTP);
- Object p = html.getConfigurationStore().getConfig("protocol");
+ ExtentSparkReporter spark = new ExtentSparkReporter(method.getName() + ".html");
+ spark.config().setProtocol(Protocol.HTTP);
+ Object p = spark.getConfigurationStore().getConfig("protocol");
Protocol v = Protocol.valueOf(String.valueOf(p).toUpperCase());
Assert.assertEquals(v, Protocol.HTTP);
}
@Test
public void testHtmlReporterUserConfigDetaultTheme(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
- Object t = html.getConfigurationStore().getConfig("theme");
+ ExtentSparkReporter spark = new ExtentSparkReporter(method.getName() + ".html");
+ Object t = spark.getConfigurationStore().getConfig("theme");
Theme theme = Theme.valueOf(String.valueOf(t).toUpperCase());
Assert.assertEquals(theme, Theme.STANDARD);
}
@Test
public void testHtmlReporterUserConfigThemeSetting(Method method) {
- ExtentHtmlReporter html = new ExtentHtmlReporter(method.getName() + ".html");
- html.config().setTheme(Theme.DARK);
- Object t = html.config().getConfigurationStore().getConfig("theme");
+ ExtentSparkReporter spark = new ExtentSparkReporter(method.getName() + ".html");
+ spark.config().setTheme(Theme.DARK);
+ Object t = spark.config().getConfigurationStore().getConfig("theme");
Theme theme = Theme.valueOf(String.valueOf(t).toUpperCase());
Assert.assertEquals(theme, Theme.DARK);
}