Skip to content

Commit

Permalink
Merge pull request #18 from iamakshayshar/feature/version-5.0
Browse files Browse the repository at this point in the history
Fix for #17 | Added support for 5.7.1 version | Upgraded Extent Report version 5.1.1
  • Loading branch information
iamakshayshar authored Oct 16, 2023
2 parents a507309 + ef2e4e1 commit 7b109ce
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 61 deletions.
6 changes: 3 additions & 3 deletions Listener-XML/soapuiextentter-listeners.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<tns:soapui-listeners xmlns:tns="http://eviware.com/soapui/config">
<!--This will initialize TestStep level reporting-->
<tns:listener id="TestStepListener" listenerClass="com.soapuiutils.extentter.soapui.listener.ExtenterTestRunListener"
<tns:listener id="TestStepListener" listenerClass="com.soapuiextentter.listener.ExtenterTestRunListener"
listenerInterface="com.eviware.soapui.model.testsuite.TestRunListener" />
<!--This will initialize TestCase level reporting-->
<tns:listener id="TestCaseListener" listenerClass="com.soapuiutils.extentter.soapui.listener.ExtenterTestSuiteRunListener"
<tns:listener id="TestCaseListener" listenerClass="com.soapuiextentter.listener.ExtenterTestSuiteRunListener"
listenerInterface="com.eviware.soapui.model.testsuite.TestSuiteRunListener" />
<!--This will initialize TestSuite level reporting-->
<tns:listener id="TestSuiteListener" listenerClass="com.soapuiutils.extentter.soapui.listener.ExtenterProjectRunListener"
<tns:listener id="TestSuiteListener" listenerClass="com.soapuiextentter.listener.ExtenterProjectRunListener"
listenerInterface="com.eviware.soapui.model.testsuite.ProjectRunListener" />
</tns:soapui-listeners>
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## :pushpin: SOAPUI-Extentter (Important)
The pro version for this utility have automatic EMAIL reporting. please email for further details.
The pro version for this utility have some more features like Automatic Email Reporting. please email for further details. [Akshay Sharma](mailto:[email protected])

## :pushpin: Not Interested in Reading ? Watch video and setup
[<img src="https://img.youtube.com/vi/IAefMoBb0nI/0.jpg" width="50%">](https://www.youtube.com/watch?v=IAefMoBb0nI "Integrate Extent Report with SOAPUI")


## :pushpin: SOAPUI-Extentter
This is an easy utility create to generate extent report based on SOAPUI project execution. This utility supports SOAPUI PROJECT execution report, SOAPUI TESTSUITE execution report and you can also generate SOAPUI Individual TestCase execution report.
Expand Down Expand Up @@ -98,10 +102,10 @@ If the value if FALSE, then the project properties are NOT added to Extent Repor
As an addOn to this utility, I have also added code for data driven testing support inside SOAPUI. This git repo also have one sample project (calculator-soapui-project_Updated.xml) which have all the groovy code for data driven testing.

## :pushpin: Support:
* This utlity is tested with SOAPUI version 5.3.0, 5.4.0, 5.5.0 & 5.6.0.
* This utlity is tested with SOAPUI version 5.3.0, 5.4.0, 5.5.0, 5.6.0, 5.7.0 & 5.7.1
* With version 4.0, this utility is supported and tested with ReadyAPI version 3.9.0, 3.9.1 & 3.9.2
* This utlity is testing on JAVA version "1.8.0_221".
* This utlity is build on top of ExtentReport 5.0.8
* This utlity is build on top of ExtentReport 5.1.1
* This utility supports Klov Docker release 1.0.1

## :pushpin: License
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soapuiutils.dataprovider.soapui.utils;
package com.soapuiextentter.dataproviderUtils;

import java.io.BufferedReader;
import java.io.FileReader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soapuiutils.dataprovider.soapui.utils;
package com.soapuiextentter.dataproviderUtils;

import java.io.File;
import java.io.FileInputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soapuiutils.dataprovider.soapui.utils;
package com.soapuiextentter.dataproviderUtils;

public class Hello {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soapuiutils.extentter.soapui.listener;
package com.soapuiextentter.listener;

import java.io.File;
import java.net.InetAddress;
Expand All @@ -12,8 +12,8 @@
import com.eviware.soapui.model.testsuite.TestProperty;
import com.eviware.soapui.model.testsuite.TestSuite;
import com.eviware.soapui.model.testsuite.TestSuiteRunner;
import com.soapuiutils.extentter.soapui.service.SoapUIService;
import com.soapuiutils.extentter.soapui.service.SoapUIServiceImpl;
import com.soapuiextentter.service.SoapUIService;
import com.soapuiextentter.service.SoapUIServiceImpl;

/*
* Author : Akshay Sharma
Expand All @@ -34,7 +34,7 @@ public void beforeRun(ProjectRunner runner, ProjectRunContext context) {
HashMap<String, String> klovConfig = getKlovConfiguration(properties);
Projservice = new SoapUIServiceImpl();
String projectXmlPath = context.getProject().getPath();
int index = projectXmlPath.lastIndexOf("\\");
int index = projectXmlPath.lastIndexOf(File.separator);
reportPath = projectXmlPath.substring(0, index);
reportPath = reportPath + File.separator + "Reports";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soapuiutils.extentter.soapui.listener;
package com.soapuiextentter.listener;

import java.io.File;
import java.util.HashMap;
Expand All @@ -9,8 +9,8 @@
import com.eviware.soapui.model.testsuite.TestRunListener;
import com.eviware.soapui.model.testsuite.TestStep;
import com.eviware.soapui.model.testsuite.TestStepResult;
import com.soapuiutils.extentter.soapui.service.SoapUIService;
import com.soapuiutils.extentter.soapui.service.SoapUIServiceImpl;
import com.soapuiextentter.service.SoapUIService;
import com.soapuiextentter.service.SoapUIServiceImpl;

/*
* Author : Akshay Sharma
Expand All @@ -31,7 +31,7 @@ public void beforeRun(TestCaseRunner runner, TestCaseRunContext context) {
TCservice = new SoapUIServiceImpl();

String projectXmlPath = context.getTestCase().getTestSuite().getProject().getPath();
int index = projectXmlPath.lastIndexOf("\\");
int index = projectXmlPath.lastIndexOf(File.separator);
reportPath = projectXmlPath.substring(0, index);
reportPath = reportPath + File.separator + "Reports";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soapuiutils.extentter.soapui.listener;
package com.soapuiextentter.listener;

import java.io.File;
import java.util.HashMap;
Expand All @@ -9,8 +9,8 @@
import com.eviware.soapui.model.testsuite.TestSuiteRunContext;
import com.eviware.soapui.model.testsuite.TestSuiteRunListener;
import com.eviware.soapui.model.testsuite.TestSuiteRunner;
import com.soapuiutils.extentter.soapui.service.SoapUIService;
import com.soapuiutils.extentter.soapui.service.SoapUIServiceImpl;
import com.soapuiextentter.service.SoapUIService;
import com.soapuiextentter.service.SoapUIServiceImpl;

/*
* Author : Akshay Sharma
Expand All @@ -32,7 +32,7 @@ public void afterRun(TestSuiteRunner runner, TestSuiteRunContext context) {
SoapUI.log("Reports are published at " + reportPath);
}
} catch (Throwable t) {
SoapUI.log("TSYS Extentter Error in beforeTestCase of TestSuiteRunListener " + t.getMessage());
SoapUI.log("SOAPUI Extentter Error in beforeTestCase of TestSuiteRunListener " + t.getMessage());
}
}

Expand All @@ -43,7 +43,7 @@ public void beforeRun(TestSuiteRunner runner, TestSuiteRunContext context) {
TSservice = new SoapUIServiceImpl();

String projectXmlPath = context.getTestSuite().getProject().getPath();
int index = projectXmlPath.lastIndexOf("\\");
int index = projectXmlPath.lastIndexOf(File.separator);
reportPath = projectXmlPath.substring(0, index);
reportPath = reportPath + File.separator + "Reports";

Expand All @@ -60,7 +60,7 @@ public void beforeRun(TestSuiteRunner runner, TestSuiteRunContext context) {
TSservice.startTestSuiteLogging(testSuiteName, testSuiteDesc, testSuiteId);
}
} catch (Exception t) {
SoapUI.log("TSYS Extentter plugin cannot be initialized. " + t.getMessage());
SoapUI.log("SOAPUI Extentter plugin cannot be initialized. " + t.getMessage());
}
}

Expand All @@ -80,7 +80,7 @@ public void beforeTestCase(TestSuiteRunner paramTestSuiteRunner, TestSuiteRunCon
TSservice.startTestCaseLogging(testCaseName, testSuiteId, testCaseId);
}
} catch (Throwable t) {
SoapUI.log("TSYS Extentter Error in beforeTestCase of TestSuiteRunListener " + t.getMessage());
SoapUI.log("SOAPUI Extentter Error in beforeTestCase of TestSuiteRunListener " + t.getMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soapuiutils.extentter.soapui.listener;
package com.soapuiextentter.listener;

import java.io.IOException;
import java.net.InetAddress;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
package com.soapuiutils.extentter.soapui.reporter;
package com.soapuiextentter.reporter;

import java.io.File;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.io.FileUtils;
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.markuputils.Markup;
Expand Down Expand Up @@ -212,24 +207,20 @@ public void logPass(TestStepResult testStepContext, String testSuiteId, String t
AuthType = testStepContext.getTestStep().getProperty("AuthType");

if (GroovyScript == null) {

actualReq = Request.getValue();
actualRes = Response.getValue();
Markup mReqRes = MarkupHelper.createCodeBlock(actualReq, actualRes);

endPoint = testStepContext.getTestStep().getProperty("Endpoint").getValue();

if (AuthType == null) {
assignCategory(testSuiteId, "REST");
} else {
assignCategory(testSuiteId, "SOAP");
}

if (endPoint.contains("#")) {

actualEndPoint = getEndpoint(endPoint);
endPointLocation = getEndpointRef(endPoint);

if (actualEndPoint.contains("-")) {
String[] Endpoints = actualEndPoint.split("-", 2);
String partOne = Endpoints[0].trim();
Expand All @@ -250,17 +241,13 @@ public void logPass(TestStepResult testStepContext, String testSuiteId, String t
}

actualData = "<br><b>\n\n ENDPOINT DETAILS : </b>" + actualEndPoint;

getTestNode(testSuiteId, testCaseId).pass(logText + " <b>Check Details </b> " + actualData
+ "<br><b>Below are the Actual Request and Response Data.</b>");

getTestNode(testSuiteId, testCaseId).info(mReqRes);
} else {
actualData = "<br><b>\n\n ENDPOINT DETAILS : </b>" + endPoint;

getTestNode(testSuiteId, testCaseId).pass(logText + " <b>Check Details </b> " + actualData
+ "<br><b>Below are the Actual Request and Response Data.</b>");

getTestNode(testSuiteId, testCaseId).info(mReqRes);
}
} else {
Expand Down Expand Up @@ -329,11 +316,9 @@ public void logFail(TestStepResult testStepContext, String testSuiteId, String t
AuthType = testStepContext.getTestStep().getProperty("AuthType");

if (GroovyScript == null) {

actualReq = Request.getValue();
actualRes = Response.getValue();
Markup mReqRes = MarkupHelper.createCodeBlock(actualReq, actualRes);

endPoint = testStepContext.getTestStep().getProperty("Endpoint").getValue();

if (AuthType == null) {
Expand All @@ -343,10 +328,8 @@ public void logFail(TestStepResult testStepContext, String testSuiteId, String t
}

if (endPoint.contains("#")) {

actualEndPoint = getEndpoint(endPoint);
endPointLocation = getEndpointRef(endPoint);

if (actualEndPoint.contains("-")) {
String[] Endpoints = actualEndPoint.split("-", 2);
String partOne = Endpoints[0].trim();
Expand All @@ -367,47 +350,33 @@ public void logFail(TestStepResult testStepContext, String testSuiteId, String t
}

actualData = "<br><b>\n\n ENDPOINT DETAILS : </b>" + actualEndPoint;

getTestNode(testSuiteId, testCaseId).fail(logText + " <b>Failed. Check Details </b> "
+ actualData + "<br><b>Below are the Actual Request and Response Data.</b>");

getTestNode(testSuiteId, testCaseId).info(mReqRes);

getTestNode(testSuiteId, testCaseId).info(new RuntimeException(failedMessages.toString()));

failedMessages.clear();
} else {
actualData = "<br><b>\n\n ENDPOINT DETAILS : </b>" + endPoint;

getTestNode(testSuiteId, testCaseId).fail(logText + " <b>Failed. Check Details </b> "
+ actualData + "<br><b>Below are the Actual Request and Response Data.</b>");

getTestNode(testSuiteId, testCaseId).info(mReqRes);

getTestNode(testSuiteId, testCaseId).info(new RuntimeException(failedMessages.toString()));

failedMessages.clear();
}
} else if (Request == null) {
SoapUI.log("Test Log Started for TestStep " + logText + " of TestCase " + testCaseId
+ " of TestSuite " + testSuiteId);

getTestNode(testSuiteId, testCaseId).fail(logText + " <b>Failed. Check Details </b> ");

getTestNode(testSuiteId, testCaseId).info(new RuntimeException(failedMessages.toString()));

failedMessages.clear();
} else {
getTestNode(testSuiteId, testCaseId).fail(logText + " <b>Failed.<b>");
}
} else {
SoapUI.log("Test Log Started for TestStep " + logText + " of TestCase " + testCaseId + " of TestSuite "
+ testSuiteId);

getTestNode(testSuiteId, testCaseId).fail(logText + " <b>Failed. Check Details </b> ");

getTestNode(testSuiteId, testCaseId).info(new RuntimeException(failedMessages.toString()));

failedMessages.clear();
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soapuiutils.extentter.soapui.service;
package com.soapuiextentter.service;

import java.util.HashMap;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soapuiutils.extentter.soapui.service;
package com.soapuiextentter.service;

import java.util.HashMap;
import java.util.List;
Expand All @@ -10,8 +10,8 @@
import com.eviware.soapui.model.testsuite.TestStep;
import com.eviware.soapui.model.testsuite.TestStepResult;
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus;
import com.soapuiextentter.reporter.Report;
import com.eviware.soapui.model.testsuite.TestSuiteRunner;
import com.soapuiutils.extentter.soapui.reporter.Report;

/*
* Author : Akshay Sharma
Expand Down

0 comments on commit 7b109ce

Please sign in to comment.