Java Code Examples for android.support.test.espresso.ViewAction.perform()

The following are Jave code examples for showing how to use perform() of the android.support.test.espresso.ViewAction class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DiscogsBrowser   File: TestUtils.java   View Source Code Vote up 6 votes
/**
 * From: http://stackoverflow.com/questions/33505953/espresso-how-to-test-swiperefreshlayout/33516360#33516360
 * <p>
 * ViewPager will throw an error if not 90% of it is displayed. This reduces the restriction.
 *
 * @param action      Action to be done.
 * @param constraints Restrictions on the view.
 * @return Performs an action on the view.
 */
public static ViewAction withCustomConstraints(final ViewAction action, final Matcher<View> constraints)
{
    return new ViewAction()
    {
        @Override
        public Matcher<View> getConstraints()
        {
            return constraints;
        }

        @Override
        public String getDescription()
        {
            return action.getDescription();
        }

        @Override
        public void perform(UiController uiController, View view)
        {
            action.perform(uiController, view);
        }
    };
}
 
Example 2
Project: firefox-tv   File: PullDownToRefreshTest.java   View Source Code Vote up 6 votes
public static ViewAction withCustomConstraints(final ViewAction action, final Matcher<View> constraints) {
    return new ViewAction() {
        @Override
        public Matcher<View> getConstraints() {
            return constraints;
        }

        @Override
        public String getDescription() {
            return action.getDescription();
        }

        @Override
        public void perform(UiController uiController, View view) {
            action.perform(uiController, view);
        }
    };
}
 
Example 3
Project: focus-android   File: PullDownToRefreshTest.java   View Source Code Vote up 6 votes
public static ViewAction withCustomConstraints(final ViewAction action, final Matcher<View> constraints) {
    return new ViewAction() {
        @Override
        public Matcher<View> getConstraints() {
            return constraints;
        }

        @Override
        public String getDescription() {
            return action.getDescription();
        }

        @Override
        public void perform(UiController uiController, View view) {
            action.perform(uiController, view);
        }
    };
}
 
Example 4
Project: bigbang   File: ViewActions.java   View Source Code Vote up 6 votes
public static ViewAction withCustomConstraints(final ViewAction action, final Matcher<View> constraints) {
  return new ViewAction() {
    @Override
    public Matcher<View> getConstraints() {
      return constraints;
    }

    @Override
    public String getDescription() {
      return action.getDescription();
    }

    @Override
    public void perform(UiController uiController, View view) {
      action.perform(uiController, view);
    }
  };
}
 
Example 5
Project: sunny-reader   File: ViewActionUtils.java   View Source Code Vote up 6 votes
public static ViewAction withCustomConstraints(final ViewAction action, final Matcher<View> constraints) {
    return new ViewAction() {
        @Override
        public Matcher<View> getConstraints() {
            return constraints;
        }

        @Override
        public String getDescription() {
            return action.getDescription();
        }

        @Override
        public void perform(UiController uiController, View view) {
            action.perform(uiController, view);
        }
    };
}
 
Example 6
Project: material-components-android   File: DesignViewActions.java   View Source Code Vote up 6 votes
/** Overwrites the constraints of the specified {@link ViewAction}. */
public static ViewAction withCustomConstraints(
    final ViewAction action, final Matcher<View> constraints) {
  return new ViewAction() {
    @Override
    public Matcher<View> getConstraints() {
      return constraints;
    }

    @Override
    public String getDescription() {
      return action.getDescription();
    }

    @Override
    public void perform(UiController uiController, View view) {
      action.perform(uiController, view);
    }
  };
}