Package 

Interface BaseActions


  • 
    public interface BaseActions
    
                        

    Base interface for performing actions on view

    Provides a lot of basic action methods, such as click(), scrollTo(), etc.

    • Method Summary

      Modifier and Type Method Description
      Unit click(GeneralLocation location) Performs click on view
      Unit doubleClick(GeneralLocation location) Performs double click on view
      Unit longClick(GeneralLocation location) Performs long click on view
      Unit pressImeAction() Presses IME action, if supported view is in focus
      Unit scrollTo() Scrolls to the view, if possible
      Unit act(Function0<ViewAction> function) Performs custom action on a view
      Unit onFailure(Function2<Throwable, Matcher<View>, Unit> function) Adds failure handler to the view
      Unit repeatUntil(Integer maxAttempts, Function0<ViewAction> action, Function1<ViewBuilder, Unit> matcher) Repeats given action on the view until this view will match the given matcher
      abstract ViewInteractionDelegate getView()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • click

         Unit click(GeneralLocation location)

        Performs click on view

        Parameters:
        location - Location of view where it should be clicked (VISIBLE_CENTER by default)
      • doubleClick

         Unit doubleClick(GeneralLocation location)

        Performs double click on view

        Parameters:
        location - Location of view where it should be clicked (VISIBLE_CENTER by default)
      • longClick

         Unit longClick(GeneralLocation location)

        Performs long click on view

        Parameters:
        location - Location of view where it should be clicked (VISIBLE_CENTER by default)
      • act

         Unit act(Function0<ViewAction> function)

        Performs custom action on a view

        Parameters:
        function - Lambda that must return ViewAction which will be performed
      • onFailure

         Unit onFailure(Function2<Throwable, Matcher<View>, Unit> function)

        Adds failure handler to the view

        Parameters:
        function - Lambda that handles this view's errors
      • repeatUntil

         Unit repeatUntil(Integer maxAttempts, Function0<ViewAction> action, Function1<ViewBuilder, Unit> matcher)

        Repeats given action on the view until this view will match the given matcher

        Parameters:
        maxAttempts - Maximum repeat count of the action
        action - Action to be performed
        matcher - ViewBuilder that will be used as matcher