public class TestLog extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ENABLE_DEBUG |
static String |
ENABLE_EXTENT_SUBSTEPS |
static String |
IS_LOG_LIMIT |
static String |
LOG_MAX_LIMIT |
static String |
LOG_SKIP_CONSOLE |
static String |
LOG4JPATH |
static String |
MARY |
static String |
WATSON |
| Constructor and Description |
|---|
TestLog() |
| Modifier and Type | Method and Description |
|---|---|
static void |
And(String value,
Object... args)
logs to extent report as and node
|
static void |
attachVideoLog(String path,
boolean isVideoAttached)
adds video and video link to the sub step
|
static void |
attachVideoLogToReportPortal(File video)
link video file to report portal
currently attaching avi files does not work properly, hence linking url instead
|
static void |
Background(String value,
Object... args)
logs to extent report as background node
|
static void |
But(String value,
Object... args)
logs to extent report as but node
|
static boolean |
checkLatestAutonomx()
compares autonomx latest version from maven central against current maven version.
|
static boolean |
checkLatestAutonomxMavenVersion()
compares autonomx latest version from maven central against current maven version.
|
static void |
ConsoleLog(String value,
Object... args)
logs to console
|
static void |
ConsoleLogDebug(String value,
Object... args)
debug logs to console
|
static void |
ConsoleLogError(String value,
Object... args)
error logs to console
|
static void |
ConsoleLogNoLimit(String value,
Object... args)
logs to console
|
static void |
ConsoleLogWarn(String value,
Object... args)
logs warning to console
|
static String |
formatMessage(String value,
boolean isLimitMessage,
Object... args) |
static String |
formatMessage(String value,
Object... args) |
static String |
formatMessageNoLimit(String value,
Object... args) |
static com.aventstack.extentreports.ExtentTest |
getTestScenario() |
static void |
Given(String value,
Object... args)
logs to extent report as given node
|
static void |
logFail(String value,
Object... args)
sets fail log for extent report and console
|
static void |
logPass(String value,
Object... args)
log pass is used for test steps for extend report, enable if properties
option enableDetailedReport is true
|
static void |
logWarning(String value,
Object... args)
sets warning log for extent report and console
|
static void |
playAudio(String value)
plays audio file based on text value
|
static void |
playMaryAudio(String value)
plays audio using marytts library
|
static void |
playWatsonAudio(String value)
watson audio
|
static void |
printBatchClassToConsole(String classType)
prints class level logs to console prints only once
|
static void |
printBatchLogsToConsole()
prints out the entire test log for csv file at once Occurs When number of csv
files are greater than 1
|
static void |
printBatchToConsole(String testId)
prints batch class to console based on testId
|
static void |
printLogoOnSuccess() |
static void |
printLogs(List<LogObject> logs)
prints current test logs
|
static void |
printLogs(List<LogObject> testLog,
String testId)
prints logs to console removes logs from list after printing to console
|
static void |
removeLogUtilHandler()
removes handler for java.util.logging removes logs from third party jars such
as webdriver
|
static String |
setMaxLength(String value)
limites the max value size
|
static String |
setMaxLength(String value,
int length) |
static void |
setPassSubTestStep(String subStep)
sets substep as pass
|
static void |
setTestStep(core.support.logger.TestLog.gherkins gherkinState,
String value,
Object... args)
sets test step based on the gherkins language steps: given, when, then, and,
but, background
|
static void |
setupLog4j()
sets up log4j loggin
|
static void |
Then(String value,
Object... args)
logs to extent report as then node
|
static void |
When(String value,
Object... args)
logs to extent report as when node
|
public static final String ENABLE_EXTENT_SUBSTEPS
public static final String ENABLE_DEBUG
public static final String IS_LOG_LIMIT
public static final String LOG_MAX_LIMIT
public static final String LOG_SKIP_CONSOLE
public static String WATSON
public static String MARY
public static final String LOG4JPATH
public static void ConsoleLogNoLimit(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void ConsoleLog(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void ConsoleLogWarn(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void ConsoleLogDebug(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void ConsoleLogError(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void Background(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void But(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void Given(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void When(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void And(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void Then(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void setTestStep(core.support.logger.TestLog.gherkins gherkinState,
String value,
Object... args)
gherkinState - given, when, then, and, but, backgroundvalue - value to logargs - additional arguments for logging to be formattedpublic static void setPassSubTestStep(String subStep)
subStep - the substep node valuepublic static void attachVideoLog(String path, boolean isVideoAttached)
path - relative path to the video fileisVideoAttached - if the video is going to be attached to the extent
report path : relative path to the video filepublic static void attachVideoLogToReportPortal(File video)
path - public static void logPass(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void logFail(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static void logWarning(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static com.aventstack.extentreports.ExtentTest getTestScenario()
public static String formatMessageNoLimit(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static String formatMessage(String value, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static String formatMessage(String value, boolean isLimitMessage, Object... args)
value - value to logargs - additional arguments for logging to be formattedpublic static String setMaxLength(String value)
value - value to logpublic static String setMaxLength(String value, int length)
value - value to loglength - length to truncate message topublic static void removeLogUtilHandler()
public static void setupLog4j()
public static void playAudio(String value)
value - text value to play backpublic static void playMaryAudio(String value)
value - text value to play backpublic static void playWatsonAudio(String value)
value - text value to play backpublic static void printBatchLogsToConsole()
public static void printBatchClassToConsole(String classType)
classType - public static void printBatchToConsole(String testId)
testId - public static void printLogs(List<LogObject> logs)
logs - list of log objectspublic static void printLogs(List<LogObject> testLog, String testId)
testLog - list of logstestId - id of the testpublic static void printLogoOnSuccess()
public static boolean checkLatestAutonomxMavenVersion()
XPathExpressionExceptionpublic static boolean checkLatestAutonomx()
XPathExpressionExceptionCopyright © 2022. All rights reserved.