Skip to content

Instantly share code, notes, and snippets.

@haigopi
Created May 10, 2020 16:27
Show Gist options
  • Save haigopi/4825bc848be9c4cc50924df0eaf2c15b to your computer and use it in GitHub Desktop.
Save haigopi/4825bc848be9c4cc50924df0eaf2c15b to your computer and use it in GitHub Desktop.
import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
import com.aventstack.extentreports.reporter.configuration.Theme;
public class ExtentManager {
private static ExtentReports extentReports = null;
private static ExtentHtmlReporter htmlReporter;
private ExtentManager() {
}
public static ExtentReports getInstance() {
if (extentReports == null) {
htmlReporter = new ExtentHtmlReporter(System.getProperty("user.dir") + AppConstants.REPORT_PATH);
extentReports = new ExtentReports();
extentReports.attachReporter(htmlReporter);
htmlReporter.config().setDocumentTitle("Functional Test Automation Report"); // Tittle of Report
htmlReporter.config().setReportName("Functional Test Report"); // Name of the report
htmlReporter.config().setTheme(Theme.DARK);//Default Theme of Report
htmlReporter.config().setTimeStampFormat("EEEE, MMMM dd, yyyy, hh:mm a '('zzz')'");
// General information releated to application
extentReports.setSystemInfo("Application Name", "Tests");
extentReports.setSystemInfo("User Name", "Gopi K Kancharla");
extentReports.setSystemInfo("Envirnoment", "QE");
}
return extentReports;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment