public class EspRecyclerViewItem extends EspView
Actions and assertions for RecyclerView items.
| Constructor and Description |
|---|
EspRecyclerViewItem(EspRecyclerViewItem template)
Create new instance based on given element matcher.
|
EspRecyclerViewItem(org.hamcrest.Matcher<android.view.View> base,
int index)
Create new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assertExist()
Check that this item exist.
|
void |
assertIsHidden()
Check that this item is not displayed on screen.
|
void |
assertNotExist()
Check that this item is not displayed on screen.
|
protected org.hamcrest.Matcher<android.view.View> |
baseMatcherForItemChild(org.hamcrest.Matcher<android.view.View> matcher)
Base for matching a view inside this item.
|
static EspRecyclerViewItem |
byItemIndex(org.hamcrest.Matcher<android.view.View> recyclerView,
int index)
Create new instance based on adapter index.
|
protected android.support.test.espresso.ViewInteraction |
findRecyclerView()
Create an interaction to perform assertion and actions on recycler view.
|
protected android.support.test.espresso.ViewInteraction |
findRecyclerView(org.hamcrest.Matcher<android.view.View> additional)
Create an interaction to perform assertion and actions on recycler view.
|
protected android.support.test.espresso.ViewInteraction |
findView(java.util.List<org.hamcrest.Matcher<android.view.View>> additional)
Create an interaction to perform assertion and actions on list items.
|
void |
scrollTo()
Make the item visible.
|
assertIsDisabled, assertIsDisplayedOnScreen, assertIsEnabled, assertIsNotSelected, assertIsPartiallyDisplayedOnly, assertIsPartiallyDisplayedOnScreen, assertIsSelected, assertIsVisible, baseMatcher, byAll, byId, click, createMatcherList, doubleClick, findView, longClick, swipeDown, swipeUppublic EspRecyclerViewItem(org.hamcrest.Matcher<android.view.View> base,
int index)
Create new instance.
base - Matcher for item parent (RecyclerView).index - Item index for doing actions or assertions.public EspRecyclerViewItem(EspRecyclerViewItem template)
Create new instance based on given element matcher.
template - Pre configured element matcher.public static EspRecyclerViewItem byItemIndex(org.hamcrest.Matcher<android.view.View> recyclerView, int index)
Create new instance based on adapter index.
recyclerView - Matcher for adapter view containing this item.index - Item index for doing actions or assertions.public void scrollTo()
Make the item visible.
When you use CoordinatorLayout and it is expanded then the item may not be full displayed. This happen because the list is partly moved outside of the screen through CoordinatorLayout. You can workaround this issue by calling EspAppBarLayout.collapse().
public void assertIsHidden()
Check that this item is not displayed on screen.
Is true when the item exist but not displayed so you must scroll to it.
assertIsHidden in class EspViewpublic void assertExist()
Check that this item exist.
Is true when adapter has matching item ignores the display state.
public void assertNotExist()
Check that this item is not displayed on screen.
Is true when the no matching item exist in adapter.
assertNotExist in class EspViewprotected org.hamcrest.Matcher<android.view.View> baseMatcherForItemChild(@Nullable
org.hamcrest.Matcher<android.view.View> matcher)
Base for matching a view inside this item.
matcher - Matcher for any item child view.protected android.support.test.espresso.ViewInteraction findRecyclerView()
Create an interaction to perform assertion and actions on recycler view.
protected android.support.test.espresso.ViewInteraction findRecyclerView(org.hamcrest.Matcher<android.view.View> additional)
Create an interaction to perform assertion and actions on recycler view.
additional - More specification about the requested element.protected android.support.test.espresso.ViewInteraction findView(java.util.List<org.hamcrest.Matcher<android.view.View>> additional)
Create an interaction to perform assertion and actions on list items.