diff --git a/src/test/java/TestScripts/Contacts_Count.java b/src/test/java/TestScripts/Contacts_Count.java
index 2dc8450..0b4483d 100644
--- a/src/test/java/TestScripts/Contacts_Count.java
+++ b/src/test/java/TestScripts/Contacts_Count.java
@@ -1,5 +1,6 @@
package TestScripts;
+import org.testng.annotations.Test;
import org.testng.annotations.Test;
import java.util.concurrent.TimeUnit;
diff --git a/src/test/java/TestScripts/Discover_Count.java b/src/test/java/TestScripts/Discover_Count.java
index ff8d6e2..9742585 100644
--- a/src/test/java/TestScripts/Discover_Count.java
+++ b/src/test/java/TestScripts/Discover_Count.java
@@ -1,5 +1,6 @@
package TestScripts;
+import org.testng.annotations.Test;
import org.testng.annotations.Test;
import java.util.List;
import java.util.concurrent.TimeUnit;
diff --git a/src/test/java/TestScripts/Track_Interaction_Count.java b/src/test/java/TestScripts/Track_Interaction_Count.java
index 7786f54..4bec846 100644
--- a/src/test/java/TestScripts/Track_Interaction_Count.java
+++ b/src/test/java/TestScripts/Track_Interaction_Count.java
@@ -1,5 +1,6 @@
package TestScripts;
+import org.testng.annotations.Test;
import org.testng.annotations.Test;
import java.util.List;
import java.util.concurrent.TimeUnit;
diff --git a/src/test/java/TestScripts/Track_Interaction_Export.java b/src/test/java/TestScripts/Track_Interaction_Export.java
index baf30e8..d6ce5a2 100644
--- a/src/test/java/TestScripts/Track_Interaction_Export.java
+++ b/src/test/java/TestScripts/Track_Interaction_Export.java
@@ -1,5 +1,6 @@
package TestScripts;
+import org.testng.annotations.Test;
import org.testng.annotations.Test;
import java.io.File;
import java.util.concurrent.TimeUnit;
@@ -38,8 +39,8 @@ public class Track_Interaction_Export extends BaseTest
WebDriver driver = new ChromeDriver();
ConfigReader config = new ConfigReader();
// Define the sets you want to use
- //String[] sets = {"set1", "set2", "set3", "set4", "set5", "set6", "set7"};
- String[] sets = {"set1"};
+ String[] sets = {"set1", "set2", "set3", "set4", "set5", "set6", "set7"};
+ //String[] sets = {"set1"};
Thread.sleep(10000);
for (String set : sets) {
Thread.sleep(10000);
diff --git a/src/test/java/TestScripts/Track_Medinsght_Export.java b/src/test/java/TestScripts/Track_Medinsght_Export.java
index 8dcf848..a561963 100644
--- a/src/test/java/TestScripts/Track_Medinsght_Export.java
+++ b/src/test/java/TestScripts/Track_Medinsght_Export.java
@@ -1,5 +1,6 @@
package TestScripts;
+import org.testng.annotations.Test;
import org.testng.annotations.Test;
import java.io.File;
import java.util.List;
diff --git a/src/test/java/TestScripts/Track_Medinsight_Count.java b/src/test/java/TestScripts/Track_Medinsight_Count.java
index 86dbe11..102f47c 100644
--- a/src/test/java/TestScripts/Track_Medinsight_Count.java
+++ b/src/test/java/TestScripts/Track_Medinsight_Count.java
@@ -1,5 +1,6 @@
package TestScripts;
+import org.testng.annotations.Test;
import org.testng.annotations.Test;
import java.util.List;
import java.util.concurrent.TimeUnit;
diff --git a/src/test/java/Utilities/ExtentReporterNG.java b/src/test/java/Utilities/ExtentReporterNG.java
new file mode 100644
index 0000000..9f35dfa
--- /dev/null
+++ b/src/test/java/Utilities/ExtentReporterNG.java
@@ -0,0 +1,76 @@
+package Utilities;
+
+
+import java.io.File;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.testng.IReporter;
+import org.testng.IResultMap;
+import org.testng.ISuite;
+import org.testng.ISuiteResult;
+import org.testng.ITestContext;
+import org.testng.ITestResult;
+import org.testng.xml.XmlSuite;
+
+import com.relevantcodes.extentreports.ExtentReports;
+import com.relevantcodes.extentreports.ExtentTest;
+import com.relevantcodes.extentreports.LogStatus;
+
+public class ExtentReporterNG implements IReporter {
+ private ExtentReports extent;
+
+ public void generateReport(List
xmlSuites, List suites,
+ String outputDirectory) {
+ extent = new ExtentReports(outputDirectory + File.separator
+ + "Extent.html", true);
+
+ for (ISuite suite : suites) {
+ Map result = suite.getResults();
+
+ for (ISuiteResult r : result.values()) {
+ ITestContext context = r.getTestContext();
+
+ buildTestNodes(context.getPassedTests(), LogStatus.PASS);
+ buildTestNodes(context.getFailedTests(), LogStatus.FAIL);
+ buildTestNodes(context.getSkippedTests(), LogStatus.SKIP);
+ }
+ }
+
+ extent.flush();
+ extent.close();
+ }
+
+ private void buildTestNodes(IResultMap tests, LogStatus status) {
+ ExtentTest test;
+
+ if (tests.size() > 0) {
+ for (ITestResult result : tests.getAllResults()) {
+ test = extent.startTest(result.getMethod().getMethodName());
+
+ test.setStartedTime(getTime(result.getStartMillis()));
+ test.setEndedTime(getTime(result.getEndMillis()));
+
+ for (String group : result.getMethod().getGroups())
+ test.assignCategory(group);
+
+ if (result.getThrowable() != null) {
+ test.log(status, result.getThrowable());
+ } else {
+ test.log(status, "Test " + status.toString().toLowerCase()
+ + "ed");
+ }
+
+ extent.endTest(test);
+ }
+ }
+ }
+
+ private Date getTime(long millis) {
+ Calendar calendar = Calendar.getInstance();
+ calendar.setTimeInMillis(millis);
+ return calendar.getTime();
+ }
+}
\ No newline at end of file
diff --git a/test-output/Default suite/Default test.html b/test-output/Default suite/Default test.html
index 6571382..fa33f8f 100644
--- a/test-output/Default suite/Default test.html
+++ b/test-output/Default suite/Default test.html
@@ -55,11 +55,11 @@ function toggleAllBoxes() {
Default test
-Tests passed/Failed/Skipped: | 6/0/0 |
+Tests passed/Failed/Skipped: | 1/0/0 |
-Started on: | Wed Oct 18 14:16:46 IST 2023 |
+Started on: | Wed Oct 25 09:44:52 IST 2023 |
-Total time: | 1485 seconds (1485277 ms) |
+
Total time: | 659 seconds (659989 ms) |
Included groups: | |
@@ -77,33 +77,8 @@ function toggleAllBoxes() {
Contactscount Test class: TestScripts.Contacts_Count |
|
-305 |
-TestScripts.Contacts_Count@8576fa0 |
-
-Discovercount Test class: TestScripts.Discover_Count |
- |
-267 |
-TestScripts.Discover_Count@558bdf1f |
-
-Interactioncount Test class: TestScripts.Track_Interaction_Count |
- |
-252 |
-TestScripts.Track_Interaction_Count@67545b57 |
-
-Interactionexport Test class: TestScripts.Track_Interaction_Export |
- |
-62 |
-TestScripts.Track_Interaction_Export@27216cd |
-
-Medinsightexport Test class: TestScripts.Track_Medinsght_Export |
- |
-299 |
-TestScripts.Track_Medinsght_Export@7582ff54 |
-
-Medsightcount Test class: TestScripts.Track_Medinsight_Count |
- |
-297 |
-TestScripts.Track_Medinsight_Count@492691d7 |
+659 |
+TestScripts.Contacts_Count@58ce9668 |