/**
* Matches a view that is a descendant of the nth item in a recyclerview
* @param listMatcher
* @param childPosition
* @param subviewMatcher
* @return
*/
public static Matcher<View> subfieldOfNthItemWithId(final Matcher<View> listMatcher, final int childPosition, final Matcher<View> subviewMatcher) {
return new TypeSafeMatcher<View>() {
@Override
public void describeTo(Description description) {
description.appendText("Sub-view of an item from a list");
}
@Override
public boolean matchesSafely(View view) {
//
// Clearly "espresso + recyclerview != love"
//
return allOf(
isDescendantOfA(nthChildOf(listMatcher, childPosition)),
subviewMatcher
).matches(view);
}
};
}
PlaylistActivityTest.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:GreenfieldTemplate
作者:
评论列表
文章目录