Class ExtentManager


  • public class ExtentManager
    extends Object
    • Constructor Detail

      • ExtentManager

        public ExtentManager()
    • Method Detail

      • getReporter

        public static com.aventstack.extentreports.ExtentReports getReporter()
      • getScreenshotsFolderFullPath

        public static String getScreenshotsFolderFullPath()
      • getScreenshotsFolderRelativePath

        public static String getScreenshotsFolderRelativePath()
      • getMediaFolderFullPath

        public static String getMediaFolderFullPath()
      • getMediaFolderRelativePathFromHtmlReport

        public static String getMediaFolderRelativePathFromHtmlReport()
      • getMediaFolderRelativePathFromRoot

        public static String getMediaFolderRelativePathFromRoot()
      • getReportHTMLFullPath

        public static String getReportHTMLFullPath()
      • getReportPDFFullPath

        public static String getReportPDFFullPath()
      • getReportRootFullPath

        public static String getReportRootFullPath()
      • getReportRootRelativePath

        public static String getReportRootRelativePath()
        gets report folder path eg.selenium/test-output/testReports/20181124/core/
        Returns:
      • createInstance

        public static com.aventstack.extentreports.ExtentReports createInstance​(String fileName)
      • setupReportPage

        public static void setupReportPage()
      • reportSetup

        public static void reportSetup()
        setup report only for test methods, including before and after test not including: before suite, after suite, before class, after class this means only logs for test methods will show up in the reports reason: test report treats before/after suite, before/after class as tests and increases test count
      • setKlovReportReporter

        public static void setKlovReportReporter()
        if test are run through suite, set project name as suite if test are run outside of suite, use the module/app name TODO: support for klov not available in extent 5.0
      • launchReportAfterTest

        public static void launchReportAfterTest()
        launches the report html page after test run
        Throws:
        Exception
      • writeTestReport

        public static void writeTestReport()
      • removeEmptyTestNodesFromReport

        public static void removeEmptyTestNodesFromReport()
        Note: currently disabled as we're only adding test nodes to report removes empty logs from the test report these are logs that are initialized, But no test steps have been added to them note: test suite is removed, cause the feature When empty cannot be removed. feature in code is not associated with test steps TODO: find a way to preserve suite logs
      • printReportLink

        public static void printReportLink()
        prints the test report link for klov or html or report portal report type
      • getReportName

        public static String getReportName()
        returns the test report name the report name is stored in default test object if test suit runs, Then suit name is the report name if test is run without suit, Then app name is used for report name
        Returns:
      • slackNotification

        public static void slackNotification​(String message)
        TODO: replace slack api with newer library sends test report to slack slack notification must be enabled in properties file
        Parameters:
        message -
      • zipTestReportDir

        public static String zipTestReportDir()
        zip the report directory
        Returns:
      • emailTestReport

        public static void emailTestReport​(String message)
        zips up And emails test report with screenshot to specified email address
        Throws:
        Exception
      • clearTestReport

        public static void clearTestReport()
        deletes test report for particular run based on test run name
      • clearTestReport

        public static void clearTestReport​(String suitename)
        deletes test report for particular run based on test run name
      • clearOldTestReports

        public static void clearOldTestReports()
      • parseTestName

        public static String parseTestName​(String value)
        formats test name to format from: "loginTest" to "Login Test"
        Parameters:
        value -
        Returns: