Skip to content

Commit 63495e0

Browse files
committed
#114 provide hierarchical test-name
1 parent 046c611 commit 63495e0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/com/aventstack/extentreports/model/service/TestService.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,14 @@ public static String getRunDuration(Test test) {
7171
public static Long getRunDurationMillis(Test test) {
7272
return test.getEndTime().getTime() - test.getStartTime().getTime();
7373
}
74+
75+
public static String getHierarchicalName(Test test) {
76+
StringBuilder sb = new StringBuilder(test.getName());
77+
while (test.getParent() != null) {
78+
test = test.getParent();
79+
sb.insert(0, test.getName() + ".");
80+
}
81+
return sb.toString();
82+
}
7483

7584
}

0 commit comments

Comments
 (0)