-
- All Implemented Interfaces:
-
com.kaspersky.kaspresso.failure.FailureLoggingProvider,com.kaspersky.kaspresso.interceptors.behaviorkautomator.DeviceBehaviorInterceptor,com.kaspersky.kaspresso.interceptors.behaviorkautomator.KautomatorBehaviorInterceptor
public final class FailureLoggingDeviceBehaviorInterceptor implements DeviceBehaviorInterceptor, FailureLoggingProvider
The implementation of DeviceBehaviorInterceptor and FailureLoggingProvider interfaces. Provides failure logging functionality for UiDeviceInteraction.perform and UiDeviceInteraction.check calls.
By default, this interceptor is not used in Kaspresso. If you desire to change result log (especially in case of an error) we recommend to use FailureLoggingProvider directly
-
-
Constructor Summary
Constructors Constructor Description FailureLoggingDeviceBehaviorInterceptor(UiTestLogger logger)
-
Method Summary
Modifier and Type Method Description <T extends Any> TinterceptCheck(UiDeviceInteraction interaction, UiOperation<UiDevice> assertion, Function0<T> activity)Wraps the given activity invocation with the failure logging. <T extends Any> TinterceptPerform(UiDeviceInteraction interaction, UiOperation<UiDevice> action, Function0<T> activity)Wraps the given activity invocation with the failure logging. -
Methods inherited from class com.kaspersky.kaspresso.interceptors.behaviorkautomator.KautomatorBehaviorInterceptor
equals, hashCode, toString -
Methods inherited from class com.kaspersky.kaspresso.interceptors.behaviorkautomator.impl.failure.FailureLoggingDeviceBehaviorInterceptor
logDescriptionAndThrow, logStackTrace, withLoggingOnFailure -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
FailureLoggingDeviceBehaviorInterceptor
FailureLoggingDeviceBehaviorInterceptor(UiTestLogger logger)
-
-
Method Detail
-
interceptCheck
<T extends Any> T interceptCheck(UiDeviceInteraction interaction, UiOperation<UiDevice> assertion, Function0<T> activity)
Wraps the given activity invocation with the failure logging.
- Parameters:
interaction- the intercepted UiDeviceInteraction.assertion- the intercepted UiDeviceAssertion.activity- the activity to invoke.
-
interceptPerform
<T extends Any> T interceptPerform(UiDeviceInteraction interaction, UiOperation<UiDevice> action, Function0<T> activity)
Wraps the given activity invocation with the failure logging.
- Parameters:
interaction- the intercepted UiDeviceInteraction.action- the intercepted UiDeviceAction.activity- the activity to invoke.
-
-
-
-