Skip to content

Commit

Permalink
MOSIP-38489 - Generated single report with 2 sections
Browse files Browse the repository at this point in the history
Signed-off-by: Nandhukumar <[email protected]>
  • Loading branch information
nandhu-kumar committed Jan 15, 2025
1 parent e2cabd9 commit fb10f89
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ public static void suiteSetup(String runType) {
}

BaseTestCase.currentModule = GlobalConstants.PREREG;
BaseTestCase.setReportName(GlobalConstants.PREREG);
AdminTestUtil.copyPreregTestResource();
BaseTestCase.otpListener = new OTPListener();
BaseTestCase.otpListener.run();
Expand Down Expand Up @@ -156,15 +155,21 @@ public static void startTestRunner() {
homeDir = new File(dir.getParent() + "/mosip/testNgXmlFiles");
LOGGER.info("ELSE :" + homeDir);
}
for (File file : homeDir.listFiles()) {
if (file.getName().toLowerCase().contains(GlobalConstants.PREREG)) {
suitefiles.add(file.getAbsolutePath());
File[] files = homeDir.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().toLowerCase().contains("mastertestsuite")) {
BaseTestCase.setReportName(GlobalConstants.PREREG);
suitefiles.add(file.getAbsolutePath());
runner.setTestSuites(suitefiles);
System.getProperties().setProperty("testng.outpur.dir", "testng-report");
runner.setOutputDirectory("testng-report");
runner.run();
}
}
} else {
LOGGER.error("No files found in directory: " + homeDir);
}
runner.setTestSuites(suitefiles);
System.getProperties().setProperty("testng.outpur.dir", "testng-report");
runner.setOutputDirectory("testng-report");
runner.run();
}

public static String getGlobalResourcePath() {
Expand Down
11 changes: 11 additions & 0 deletions api-test/testNgXmlFiles/preregMasterTestSuite.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite name="PreReg API Test Rig Master Suite">
<listeners>
<listener class-name="io.mosip.testrig.apirig.report.EmailableReport" />
</listeners>
<suite-files>
<suite-file path="preregSuite.xml" />
</suite-files>
</suite>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite name="PreReg Suite">
<suite name="PreReg API Test">
<!-- Passing Group as parameter using "testType" Possible Groups are: smoke
regression smokeAndRegression -->
<listeners>
Expand Down

0 comments on commit fb10f89

Please sign in to comment.