Skip to content

Commit 6090a70

Browse files
committed
Added comments
1 parent 2063327 commit 6090a70

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/main/java/listeners/MethodInterceptor.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@
1414
import utilities.filereaders.CsvReaderUtility;
1515

1616
/*
17-
* TestNG listener to get the list of tests to run.
18-
*/
17+
* MethodInterceptor implements the IMethodInterceptor listener from TestNG. The intercept method returns
18+
* a list of test that should be executed according to the data read from RUN_SETUP_CSV file.
19+
* If columns 'name', 'execute' or 'description' is altered in RunSetup.csv file, it should also be updated
20+
* in getListOfTestCasesToRun method. If the column name in RunSetup.csv file does not match with the names
21+
* used here, it will lead to none of the test cases being run.
22+
*
23+
* */
1924
public class MethodInterceptor implements IMethodInterceptor{
2025

2126
List<IMethodInstance> testList = new ArrayList<>();

src/main/java/utilities/filereaders/CsvReaderUtility.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
import com.fasterxml.jackson.dataformat.csv.CsvMapper;
1212
import com.fasterxml.jackson.dataformat.csv.CsvSchema;
1313

14+
/*
15+
* Simple csv reader using Jackson library to read mainly the RunSetup.csv file. Models are not used
16+
* to prevent frequent updating in the pojo class/models when the structure of the RunSetup file might
17+
* change according to the preferences of the test execution.
18+
* */
19+
1420
public final class CsvReaderUtility {
1521

1622
private CsvReaderUtility() {}

src/test/resources/RunSetup.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ testid,name,description,execute
22
1,navigateToHomepage,Navigate to home page,true
33
2,navigateToUserSignupPage,Navigate to user signup page,true
44
3,registerNewUser,Register new user,true
5+
6+
#name, description and execute header names should not be altered

0 commit comments

Comments
 (0)