/** * Convenience method for {@link #findView(List)} * * @since Espresso Macchiato 0.6 */ @SafeVarargs protected final ViewInteraction findView(Matcher<View>... matcher) { return findView(createMatcherList(matcher)); }
/** * Perform swipe down on the view. * * @since Espresso Macchiato 0.4 */ public void swipeDown() { findView().perform(ViewActions.swipeDown()); }
/** * Perform swipe up on the view. * * @since Espresso Macchiato 0.4 */ public void swipeUp() { findView().perform(ViewActions.swipeUp()); }
/** * Check that no view matches the given matcher in the view hierarchy. * * @since Espresso Macchiato 0.1 */ public void assertNotExist() { findView().check(doesNotExist()); }
/** * Check that the view is not in state selected. * * @since Espresso Macchiato 0.6 */ public void assertIsNotSelected() { findView().check(matches(not(isSelected()))); }
/** * Check that the view is in state disabled. * * @since Espresso Macchiato 0.1 */ public void assertIsDisabled() { findView().check(matches(not(isEnabled()))); }
/** * Perform long click on the view. * * @since Espresso Macchiato 0.6 */ public void longClick() { findView(isDisplayed()).perform(ViewActions.longClick()); }
/** * Check that the view is in state enabled. * * @since Espresso Macchiato 0.1 */ public void assertIsEnabled() { findView().check(matches(isEnabled())); }
/** * Perform double click on the view. * * @since Espresso Macchiato 0.1 */ public void doubleClick() { findView(isDisplayed()).perform(ViewActions.doubleClick()); }
/** * Check that a view is currently full shown on the screen so the user can see it. * * A view can exist and is in state visible but not currently displayed. * When the view height or width is greater than the screen it would still match. * * @since Espresso Macchiato 0.3 */ public void assertIsDisplayedOnScreen() { findView().check(matches(EspIsDisplayedMatcher.isDisplayingAtLeast(100))); }
/** * Check that the view is in state visible. * * @since Espresso Macchiato 0.3 */ public void assertIsVisible() { findView().check(matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); }
/** * Check that the view is in state selected. * * @since Espresso Macchiato 0.6 */ public void assertIsSelected() { findView().check(matches(isSelected())); }
/** * Perform click on the view. * * @since Espresso Macchiato 0.1 */ public void click() { findView(isDisplayed()).perform(ViewActions.click()); }
/** * Check only a small part of the view is visible on screen. * * Does fail if the view is fully displayed. * * @since Espresso Macchiato 0.4 */ public void assertIsPartiallyDisplayedOnly() { findView().check(matches(allOf(EspIsDisplayedMatcher.isDisplayingAtLeast(1), not(EspIsDisplayedMatcher.isDisplayingAtLeast(100))))); }
/** * Check if at least a small part of the view is visible on screen. * * Does fail if the view is not displayed. Success if partially or full visible. * * @since Espresso Macchiato 0.4 */ public void assertIsPartiallyDisplayedOnScreen() { findView().check(matches(allOf(EspIsDisplayedMatcher.isDisplayingAtLeast(1)))); }
/** * Check that you can't see the view. * * True when the view is in state invisible, gone or currently not displayed on screen. * * @since Espresso Macchiato 0.3 */ public void assertIsHidden() { findView().check(matches(anyOf( withEffectiveVisibility(ViewMatchers.Visibility.INVISIBLE), withEffectiveVisibility(ViewMatchers.Visibility.GONE), not(EspIsDisplayedMatcher.isDisplayingAtLeast(1))))); }