Package com.shaft.tools.io.internal
Class ReportManagerHelper
java.lang.Object
com.shaft.tools.io.internal.ReportManagerHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
attach
(String attachmentType, String attachmentName, InputStream attachmentContent) Adds a new attachment using the input parameters provided.static void
Adds a new attachment using the input parameters provided.static void
static void
attachAsStep
(String attachmentType, String attachmentName, InputStream attachmentContent) Adds a new attachment using the input parameters provided.static void
attachEngineLog
(String executionEndTimestamp) static void
attachIssuesLog
(String executionEndTimestamp) static void
attachTestLog
(String currentMethodName, String testLog) Returns the log of the current test, and attaches it in the end of the test execution report.static void
static void
createLogEntry
(String logText, org.apache.logging.log4j.Level loglevel) static String
static String
static String
static boolean
static String
getExecutionDuration
(long startTime, long endTime) static int
static int
static String
static String
static Boolean
static boolean
static void
static void
Format an exception message and stack trace, and calls attach to add it as a log entry.static void
logConfigurationMethodInformation
(String className, String testMethodName, String configurationMethodType) static void
logDiscrete
(String logText, org.apache.logging.log4j.Level logLevel) Creates a custom log entry that will not be added as a step in the execution report, but you can see it in the attached execution log txt filestatic void
static void
logDiscrete
(Throwable t, org.apache.logging.log4j.Level logLevel) static void
static void
static void
logExecutionSummary
(String total, String passed, String failed, String skipped) static void
logFinishedTestInformation
(String className, String testMethodName, String testDescription, String testStatus) static void
logImportantEntry
(String logText, org.apache.logging.log4j.Level logLevel) static void
static void
static void
logNestedSteps
(String logText, List<List<Object>> attachments) static void
logScenarioInformation
(String keyword, String name, String steps) static void
logTestInformation
(String className, String testMethodName, String testDescription) static void
static String
static void
setDebugMode
(Boolean debugMode) static void
setDiscreteLogging
(boolean discreteLogging) static void
setFailedTestsWithoutOpenIssuesCounter
(int failedTestsWithoutOpenIssuesCounter) static void
setFeatureName
(String featureName) static void
setListOfNewIssuesForFailedTests
(List<List<String>> listOfNewIssuesForFailedTests) static void
setListOfOpenIssuesForFailedTests
(List<List<String>> listOfOpenIssuesForFailedTests) static void
setListOfOpenIssuesForPassedTests
(List<List<String>> listOfOpenIssuesForPassedTests) static void
setOpenIssuesForFailedTestsCounter
(int openIssuesForFailedTestsCounter) static void
setOpenIssuesForPassedTestsCounter
(int openIssuesForPassedTestsCounter) static void
setTestCaseDescription
(String scenarioSteps) static void
setTestCaseName
(String scenarioName) static void
setTotalNumberOfTests
(int totalNumberOfTests) static void
writeStepToReport
(String logText) Formats logText and adds timestamp, then logs it as a step in the execution report.
-
Method Details
-
setOpenIssuesForFailedTestsCounter
public static void setOpenIssuesForFailedTestsCounter(int openIssuesForFailedTestsCounter) -
setOpenIssuesForPassedTestsCounter
public static void setOpenIssuesForPassedTestsCounter(int openIssuesForPassedTestsCounter) -
setFailedTestsWithoutOpenIssuesCounter
public static void setFailedTestsWithoutOpenIssuesCounter(int failedTestsWithoutOpenIssuesCounter) -
setListOfOpenIssuesForFailedTests
-
setListOfOpenIssuesForPassedTests
-
setListOfNewIssuesForFailedTests
-
getIssueCounter
public static int getIssueCounter() -
getOpenIssuesForFailedTestsCounters
public static int getOpenIssuesForFailedTestsCounters() -
logIssue
-
prepareIssuesLog
-
getDiscreteLogging
public static boolean getDiscreteLogging()- Returns:
- the discreteLogging
-
setDiscreteLogging
public static void setDiscreteLogging(boolean discreteLogging) - Parameters:
discreteLogging
- the discreteLogging to set
-
setTotalNumberOfTests
public static void setTotalNumberOfTests(int totalNumberOfTests) -
setDebugMode
-
logImportantEntry
-
logEngineVersion
public static void logEngineVersion() -
logEngineClosure
public static void logEngineClosure() -
logTestInformation
-
logScenarioInformation
-
logConfigurationMethodInformation
-
logExecutionSummary
-
logFinishedTestInformation
-
formatStackTraceToLogEntry
-
attach
public static void attach(String attachmentType, String attachmentName, InputStream attachmentContent) Adds a new attachment using the input parameters provided. The attachment is displayed as a step in the execution report. Used for Screenshots.- Parameters:
attachmentType
- the type of this attachmentattachmentName
- the name of this attachmentattachmentContent
- the content of this attachment
-
attach
Adds a new attachment using the input parameters provided. The attachment is displayed as a step in the execution report. Used for Screenshots.- Parameters:
attachmentType
- the type of this attachmentattachmentName
- the name of this attachmentattachmentContent
- the content of this attachment
-
attachTestLog
Returns the log of the current test, and attaches it in the end of the test execution report.- Parameters:
currentMethodName
- name of the current test method to be used in the attachment nametestLog
- content of the text log to be used as the attachment value
-
attachEngineLog
-
attachIssuesLog
-
getCallingMethodFullName
-
getCallingClassFullName
-
getTestClassName
-
getTestMethodName
-
setTestCaseName
-
setTestCaseDescription
-
isCurrentTestPassed
-
setFeatureName
-
createLogEntry
-
writeStepToReport
Formats logText and adds timestamp, then logs it as a step in the execution report.- Parameters:
logText
- the text that needs to be logged in this action
-
isInternalStep
public static boolean isInternalStep() -
attachAsStep
@Step("Attachment: {attachmentType} - {attachmentName}") public static void attachAsStep(String attachmentType, String attachmentName, InputStream attachmentContent) Adds a new attachment using the input parameters provided. The attachment is displayed as a step in the execution report. Used for Screenshots.- Parameters:
attachmentType
- the type of this attachmentattachmentName
- the name of this attachmentattachmentContent
- the content of this attachment
-
cleanExecutionSummaryReportDirectory
public static void cleanExecutionSummaryReportDirectory() -
openExecutionSummaryReportAfterExecution
public static void openExecutionSummaryReportAfterExecution() -
log
-
logNestedSteps
-
logNestedSteps
-
attach
-
log
Format an exception message and stack trace, and calls attach to add it as a log entry.- Parameters:
throwable
- the throwable (exception or error) that will be logged in this action
-
logDiscrete
-
logDiscrete
-
logDiscrete
Creates a custom log entry that will not be added as a step in the execution report, but you can see it in the attached execution log txt file- Parameters:
logText
- the text that will be logged by actionlogLevel
- Level.ERROR, TRACE, INFO, WARN, DEBUG, FATAL
-
getExecutionDuration
-