Class ReportContext

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

public final class ReportContext extends Object
Runner-neutral per-thread report context and log buffer.
  • Method Details

    • start

      public static void start(TestExecutionInfo info)
      Starts report context for the current test.
      Parameters:
      info - current test metadata
    • update

      public static void update(TestExecutionInfo info)
      Updates current test metadata without clearing buffered logs.
      Parameters:
      info - current test metadata
    • append

      public static void append(String log)
      Appends a formatted log line to the current runner buffer and sink.
      Parameters:
      log - formatted log line
    • snapshotOutput

      public static List<String> snapshotOutput()
      Returns a stable copy of the current runner log buffer.
      Returns:
      buffered report output
    • setLogSink

      public static void setLogSink(Consumer<String> sink)
      Stores a runner-specific sink such as TestNG Reporter.
      Parameters:
      sink - log sink, or null to clear
    • setStatus

      public static void setStatus(io.qameta.allure.model.Status currentStatus)
      Sets the current test status for Allure step status mapping.
      Parameters:
      currentStatus - current Allure status
    • getStatus

      public static io.qameta.allure.model.Status getStatus()
      Gets the current test status.
      Returns:
      current status, or null
    • getTestClassName

      public static String getTestClassName()
      Gets current test class name.
      Returns:
      class name, or empty string
    • getTestMethodName

      public static String getTestMethodName()
      Gets current test method name.
      Returns:
      method name, or empty string
    • clear

      public static void clear()
      Clears current thread report context.