-
- All Implemented Interfaces:
-
com.kaspersky.kaspresso.autoscroll.AutoScrollProvider
public final class AutoScrollProviderImpl implements AutoScrollProvider<ViewInteraction>
The implementation of the AutoScrollProvider interface for ViewInteraction
-
-
Constructor Summary
Constructors Constructor Description AutoScrollProviderImpl(AutoScrollParams params, UiTestLogger logger)
-
Method Summary
Modifier and Type Method Description <T extends Any> TwithAutoScroll(ViewInteraction interaction, Function0<T> action)Invokes the given action and calls scroll if it fails. <T extends Any> Tscroll(ViewInteraction interaction, Function0<T> action, Throwable cachedError)Performs the autoscrolling functionality. -
-
Constructor Detail
-
AutoScrollProviderImpl
AutoScrollProviderImpl(AutoScrollParams params, UiTestLogger logger)
-
-
Method Detail
-
withAutoScroll
<T extends Any> T withAutoScroll(ViewInteraction 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 ViewInteraction interface to perform actions and assertions.action- the actual action on the interacted view.
-
scroll
<T extends Any> T scroll(ViewInteraction interaction, Function0<T> action, Throwable cachedError)
Performs the autoscrolling functionality. Performs scroll and re-invokes the given action.
- Parameters:
interaction- the instance of ViewInteraction 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.
-
-
-
-