Skip to content

Commit

Permalink
added finalize clause to ExtentTestLoggerFactory for autoflushing
Browse files Browse the repository at this point in the history
  • Loading branch information
Git-Leon committed Jun 8, 2022
1 parent bef4ba9 commit b460eac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,14 @@ public ExtentTestLoggerInterface getExtentTestLogger(String testName, String des
return extentTestLogger;
}
}

public void flush() {
getExtentHtmlReporter().flush();
getExtentReports().flush();
}

@Override
protected void finalize() {
flush();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ private void test(String testName) {
browserHandler.screenshot().getFile();
browserHandler.close();
final BrowserHandlerInterface tempBrowser = BrowserHandlerFactory.CHROME.getBrowserHandler();
extentTestLoggerFactory.getExtentHtmlReporter().flush();
extentTestLoggerFactory.getExtentReports().flush();
tempBrowser.navigateTo(extentTestLoggerFactory
.getExtentHtmlReporter()
.config()
Expand Down

0 comments on commit b460eac

Please sign in to comment.