Package core.support.logger
Class ExtentManager
java.lang.Object
core.support.logger.ExtentManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voiddeletes test report for particular run based on test run namestatic voidclearTestReport(String suitename) deletes test report for particular run based on test run namestatic com.aventstack.extentreports.ExtentReportscreateInstance(String fileName) static voidemailTestReport(String message) zips up And emails test report with screenshot to specified email addressstatic Stringstatic Stringstatic Stringstatic com.aventstack.extentreports.ExtentReportsstatic Stringstatic Stringreturns 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 namestatic Stringstatic Stringgets report folder path eg.selenium/test-output/testReports/20181124/core/static Stringstatic Stringstatic voidlaunches the report html page after test runstatic StringparseTestName(String value) formats test name to format from: "loginTest" to "Login Test"static voidprints the test report link for klov or html or report portal report typestatic voidNote: 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.static voidsetup 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 countstatic voidif 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.0static voidstatic voidslackNotification(String message) TODO: replace slack api with newer library sends test report to slack slack notification must be enabled in properties filestatic void
-
Field Details
-
LAUNCH_AFTER_REPORT
- See Also:
-
NOTIFY_SLACK_ON_FAIL_ONLY
- See Also:
-
NOTIFY_EMAIL_ON_FAIL_ONLY
- See Also:
-
ENABLE_SLACK_NOTIFICATION
- See Also:
-
ENABLE_EMAIL_REPORT
- See Also:
-
REPORT_EXPIRE_DAYS
- See Also:
-
REPORT_TYPE
- See Also:
-
HTML_REPORT_TYPE
- See Also:
-
KLOV_REPORT_TYPE
- See Also:
-
KLOV_SERVER_URL
- See Also:
-
KLOV_MONGODB_URL
- See Also:
-
classList
-
REPORT_DEFAULT_NAME
-
TEST_OUTPUT_PATH
-
TEST_OUTPUT_FULL_PATH
-
-
Constructor Details
-
ExtentManager
public ExtentManager()
-
-
Method Details
-
getReporter
public static com.aventstack.extentreports.ExtentReports getReporter() -
getScreenshotsFolderFullPath
-
getScreenshotsFolderRelativePath
-
getMediaFolderFullPath
-
getMediaFolderRelativePathFromHtmlReport
-
getMediaFolderRelativePathFromRoot
-
getReportHTMLFullPath
-
getReportRootFullPath
-
getReportRootRelativePath
gets report folder path eg.selenium/test-output/testReports/20181124/core/- Returns:
-
createInstance
-
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
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
TODO: replace slack api with newer library sends test report to slack slack notification must be enabled in properties file- Parameters:
message-
-
emailTestReport
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
deletes test report for particular run based on test run name -
clearOldTestReports
public static void clearOldTestReports() -
parseTestName
formats test name to format from: "loginTest" to "Login Test"- Parameters:
value-- Returns:
-