From 29377385093b3aa6a85eee71e2c28a5cd278c1c1 Mon Sep 17 00:00:00 2001 From: loko Date: Fri, 2 Feb 2018 02:58:23 -0600 Subject: [PATCH] adding code to retrieve report output from the container --- Dockerfile | 2 +- src/main/resources/extent-config.xml | 53 +++++++++++++++++++ .../com/infolob/container/test/BasicFlow.java | 12 +++-- 3 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/extent-config.xml diff --git a/Dockerfile b/Dockerfile index 9c77949..89a5b6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,4 +12,4 @@ ADD target/libs $BASE_DIR/libs ADD basic-flow-module.xml $BASE_DIR/basic-flow-module.xml # Command line to execute the test -ENTRYPOINT ["/usr/bin/java", "-cp", "/usr/share/tag/container-test.jar", "org.testng.TestNG", "/usr/share/tag/basic-flow-module.xml"] +ENTRYPOINT ["/usr/bin/java", "-cp", "/usr/share/tag/container-test.jar", "org.testng.TestNG", "-d", "/usr/share/tag/test-output", "/usr/share/tag/basic-flow-module.xml"] diff --git a/src/main/resources/extent-config.xml b/src/main/resources/extent-config.xml new file mode 100644 index 0000000..e05f76c --- /dev/null +++ b/src/main/resources/extent-config.xml @@ -0,0 +1,53 @@ + + + + + + UTF-8 + + + + https + + + ExtentReports 2.0 + + + Fame UAT Automation Report + + + + + + + yyyy-MM-dd + + + + HH:mm:ss + + + + + + + + + + + + + + + + diff --git a/src/test/java/com/infolob/container/test/BasicFlow.java b/src/test/java/com/infolob/container/test/BasicFlow.java index 0a6f4e7..615606f 100755 --- a/src/test/java/com/infolob/container/test/BasicFlow.java +++ b/src/test/java/com/infolob/container/test/BasicFlow.java @@ -43,6 +43,8 @@ import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.Platform; + + public class BasicFlow { // extent-report public ExtentReports extent; @@ -62,10 +64,14 @@ public class BasicFlow { @BeforeSuite public void setUp(){ try { - String workingDir = System.getProperty("user.dir"); - extent = new ExtentReports(workingDir+"/Test_Execution_Report.html", true); - extent.loadConfig(new File(workingDir+"/extent-config.xml")); + + //String workingDir = System.getProperty("user.dir"); + //System.out.println("Current working directory : " + workingDir); + + // We need to find a Way to specify where we want this report been created + extent = new ExtentReports("/Test_Execution_Report.html", true); + extent.loadConfig(BasicFlow.class.getResource("/extent-config.xml")); extent.addSystemInfo("Environment","SIT"); /*