Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-38489 - Generated single report with 2 sections #799

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading