Class ReportManagerHelper

java.lang.Object
com.shaft.tools.io.internal.ReportManagerHelper

public class ReportManagerHelper extends Object
  • Method Details

    • setOpenIssuesForFailedTestsCounter

      public static void setOpenIssuesForFailedTestsCounter(int openIssuesForFailedTestsCounter)
    • setOpenIssuesForPassedTestsCounter

      public static void setOpenIssuesForPassedTestsCounter(int openIssuesForPassedTestsCounter)
    • setFailedTestsWithoutOpenIssuesCounter

      public static void setFailedTestsWithoutOpenIssuesCounter(int failedTestsWithoutOpenIssuesCounter)
    • setListOfOpenIssuesForFailedTests

      public static void setListOfOpenIssuesForFailedTests(List<List<String>> listOfOpenIssuesForFailedTests)
    • setListOfOpenIssuesForPassedTests

      public static void setListOfOpenIssuesForPassedTests(List<List<String>> listOfOpenIssuesForPassedTests)
    • setListOfNewIssuesForFailedTests

      public static void setListOfNewIssuesForFailedTests(List<List<String>> listOfNewIssuesForFailedTests)
    • getIssueCounter

      public static int getIssueCounter()
    • getOpenIssuesForFailedTestsCounters

      public static int getOpenIssuesForFailedTestsCounters()
    • logIssue

      public static void logIssue(String issue)
    • prepareIssuesLog

      public static String 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

      public static void setDebugMode(Boolean debugMode)
    • logImportantEntry

      public static void logImportantEntry(String logText, org.apache.logging.log4j.Level logLevel)
    • logEngineVersion

      public static void logEngineVersion()
    • logEngineClosure

      public static void logEngineClosure()
    • logTestInformation

      public static void logTestInformation(String className, String testMethodName, String testDescription)
    • logScenarioInformation

      public static void logScenarioInformation(String keyword, String name, String steps)
    • logConfigurationMethodInformation

      public static void logConfigurationMethodInformation(String className, String testMethodName, String configurationMethodType)
    • logExecutionSummary

      public static void logExecutionSummary(String total, String passed, String failed, String skipped)
    • logFinishedTestInformation

      public static void logFinishedTestInformation(String className, String testMethodName, String testDescription, String testStatus)
    • formatStackTraceToLogEntry

      public static String formatStackTraceToLogEntry(Throwable t)
    • 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 attachment
      attachmentName - the name of this attachment
      attachmentContent - the content of this attachment
    • attach

      public static void attach(String attachmentType, String attachmentName, String 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 attachment
      attachmentName - the name of this attachment
      attachmentContent - the content of this attachment
    • attachTestLog

      public 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.
      Parameters:
      currentMethodName - name of the current test method to be used in the attachment name
      testLog - content of the text log to be used as the attachment value
    • attachEngineLog

      public static void attachEngineLog(String executionEndTimestamp)
    • attachIssuesLog

      public static void attachIssuesLog(String executionEndTimestamp)
    • getCallingMethodFullName

      public static String getCallingMethodFullName()
    • getCallingClassFullName

      public static String getCallingClassFullName()
    • getTestClassName

      public static String getTestClassName()
    • getTestMethodName

      public static String getTestMethodName()
    • setTestCaseName

      public static void setTestCaseName(String scenarioName)
    • setTestCaseDescription

      public static void setTestCaseDescription(String scenarioSteps)
    • isCurrentTestPassed

      public static Boolean isCurrentTestPassed()
    • setFeatureName

      public static void setFeatureName(String featureName)
    • createLogEntry

      public static void createLogEntry(String logText, org.apache.logging.log4j.Level loglevel)
    • writeStepToReport

      public static void writeStepToReport(String logText)
      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 attachment
      attachmentName - the name of this attachment
      attachmentContent - the content of this attachment
    • cleanExecutionSummaryReportDirectory

      public static void cleanExecutionSummaryReportDirectory()
    • openExecutionSummaryReportAfterExecution

      public static void openExecutionSummaryReportAfterExecution()
    • log

      public static void log(String logText, List<List<Object>> attachments)
    • logNestedSteps

      public static void logNestedSteps(String logText, List<String> customLogMessages, List<List<Object>> attachments)
    • logNestedSteps

      public static void logNestedSteps(String logText, List<List<Object>> attachments)
    • attach

      public static void attach(List<List<Object>> attachments)
    • log

      public static void log(Throwable throwable)
      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

      public static void logDiscrete(Throwable t)
    • logDiscrete

      public static void logDiscrete(Throwable t, org.apache.logging.log4j.Level logLevel)
    • logDiscrete

      public 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 file
      Parameters:
      logText - the text that will be logged by action
      logLevel - Level.ERROR, TRACE, INFO, WARN, DEBUG, FATAL
    • getExecutionDuration

      public static String getExecutionDuration(long startTime, long endTime)