diff --git a/src/main/java/com/aventstack/extentreports/model/service/TestService.java b/src/main/java/com/aventstack/extentreports/model/service/TestService.java index 2b5d4a9..1de5b69 100644 --- a/src/main/java/com/aventstack/extentreports/model/service/TestService.java +++ b/src/main/java/com/aventstack/extentreports/model/service/TestService.java @@ -71,5 +71,14 @@ public static String getRunDuration(Test test) { public static Long getRunDurationMillis(Test test) { return test.getEndTime().getTime() - test.getStartTime().getTime(); } + + public static String getHierarchicalName(Test test) { + StringBuilder sb = new StringBuilder(test.getName()); + while (test.getParent() != null) { + test = test.getParent(); + sb.insert(0, test.getName() + "."); + } + return sb.toString(); + } }