-
- All Implemented Interfaces:
-
com.kaspersky.kaspresso.failure.FailureLoggingProvider
public final class FailureLoggingProviderImpl implements FailureLoggingProvider
The implementation of the FailureLoggingProvider interface.
-
-
Constructor Summary
Constructors Constructor Description FailureLoggingProviderImpl(UiTestLogger logger)
-
Method Summary
Modifier and Type Method Description <T extends Any> TwithLoggingOnFailure(Function0<T> action)Invokes the given action and logs if it fails. UnitlogStackTrace(Throwable error)Logs the error's stacktrace. UnitlogDescriptionAndThrow(Throwable error, Matcher<View> viewMatcher)Logs the error description got by viewMatcher and throws the error. -
-
Constructor Detail
-
FailureLoggingProviderImpl
FailureLoggingProviderImpl(UiTestLogger logger)
-
-
Method Detail
-
withLoggingOnFailure
<T extends Any> T withLoggingOnFailure(Function0<T> action)
Invokes the given action and logs if it fails.
- Parameters:
action- the action to invoke.
-
logStackTrace
Unit logStackTrace(Throwable error)
Logs the error's stacktrace.
- Parameters:
error- the error to get stacktrace from.
-
logDescriptionAndThrow
Unit logDescriptionAndThrow(Throwable error, Matcher<View> viewMatcher)
Logs the error description got by viewMatcher and throws the error.
- Parameters:
error- the error to be described.viewMatcher- the view matcher to get description from.
-
-
-
-