Class ReportContext
java.lang.Object
com.shaft.tools.io.internal.ReportContext
Runner-neutral per-thread report context and log buffer.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidAppends a formatted log line to the current runner buffer and sink.static voidclear()Clears current thread report context.static io.qameta.allure.model.StatusGets the current test status.static StringGets current test class name.static StringGets current test method name.static voidsetLogSink(Consumer<String> sink) Stores a runner-specific sink such as TestNG Reporter.static voidsetStatus(io.qameta.allure.model.Status currentStatus) Sets the current test status for Allure step status mapping.Returns a stable copy of the current runner log buffer.static voidstart(TestExecutionInfo info) Starts report context for the current test.static voidupdate(TestExecutionInfo info) Updates current test metadata without clearing buffered logs.
-
Method Details
-
start
Starts report context for the current test.- Parameters:
info- current test metadata
-
update
Updates current test metadata without clearing buffered logs.- Parameters:
info- current test metadata
-
append
Appends a formatted log line to the current runner buffer and sink.- Parameters:
log- formatted log line
-
snapshotOutput
-
setLogSink
-
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
Gets current test class name.- Returns:
- class name, or empty string
-
getTestMethodName
Gets current test method name.- Returns:
- method name, or empty string
-
clear
public static void clear()Clears current thread report context.
-