PlaylistActivityTest.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:GreenfieldTemplate 作者:
/**
 * 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);
        }
    };
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号