Skip to content

Commit db34b7e

Browse files
Completed percent error fix
The completed percentage is coming more than 100%. The problem was - TestNG captures the excluded `@Test` methods list which are not really excluded by user, they are the configuration methods (i.e @BeforeTest etc..). So, now an extra check is applied from our code end to verify whether the `excluded` methods reported by TestNG is `@Test` annotated method or not.
1 parent d5d9274 commit db34b7e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

RealTimeReport/src/report/realtime/datahandler/DataPreparator.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,12 @@ synchronized public static List<ExMethodResultDTO> prepareExcludedTestMethod(ISu
161161
List<ExMethodResultDTO> resultDTOs = new ArrayList<ExMethodResultDTO>();
162162
ExMethodResultDTO dto;
163163
for (ITestNGMethod iTestNGMethod : suite.getExcludedMethods()) {
164-
dto = new ExMethodResultDTO();
165-
dto.setDataProvider(getDataProvider(iTestNGMethod));
166-
dto.setExcludedMethod(iTestNGMethod.getMethodName());
167-
resultDTOs.add(dto);
164+
if(iTestNGMethod.isTest()){
165+
dto = new ExMethodResultDTO();
166+
dto.setDataProvider(getDataProvider(iTestNGMethod));
167+
dto.setExcludedMethod(iTestNGMethod.getMethodName());
168+
resultDTOs.add(dto);
169+
}
168170
}
169171
return resultDTOs;
170172
}

0 commit comments

Comments
 (0)