-
- All Implemented Interfaces:
-
com.kaspersky.kaspresso.autoscroll.AutoScrollProvider
public final class ObjectAutoScrollProviderImpl implements AutoScrollProvider<UiObjectInteraction>
The implementation of the AutoScrollProvider interface for UiObjectInteraction
-
-
Constructor Summary
Constructors Constructor Description ObjectAutoScrollProviderImpl(UiTestLogger logger, AutoScrollParams autoScrollParams)
-
Method Summary
Modifier and Type Method Description <T extends Any> TwithAutoScroll(UiObjectInteraction interaction, Function0<T> action)Invokes the given action and calls scroll if it fails. <T extends Any> Tscroll(UiObjectInteraction interaction, Function0<T> action, Throwable cachedError)Performs the autoscrolling functionality. -
-
Constructor Detail
-
ObjectAutoScrollProviderImpl
ObjectAutoScrollProviderImpl(UiTestLogger logger, AutoScrollParams autoScrollParams)
-
-
Method Detail
-
withAutoScroll
<T extends Any> T withAutoScroll(UiObjectInteraction interaction, Function0<T> action)
Invokes the given action and calls scroll if it fails. Helps in cases when test fails because of the need to scroll to interacted view.
- Parameters:
interaction- the instance of UiObjectInteraction interface to perform actions and assertions.action- the actual action on the interacted view.
-
scroll
<T extends Any> T scroll(UiObjectInteraction interaction, Function0<T> action, Throwable cachedError)
Performs the autoscrolling functionality. Performs scroll and re-invokes the given action.
- Parameters:
interaction- the instance of UiObjectInteraction interface to perform actions and assertions.action- the actual action on the interacted view.cachedError- the error to be thrown if autoscroll would not help.
-
-
-
-