INNER CODE UNIT · Java

swipeUpRecyclerViewToPosition

JsonChao/Awesome-WanAndroid · app/src/androidTest/java/json/chao/com/wanandroid/BasePageTest.java:119

    protected void swipeUpRecyclerViewToPosition(@IdRes int recyclerViewId, int position) {
        onView(allOf(withId(recyclerViewId), hasFocus()))
                .check(matches(isDisplayed()))
                .perform(scrollToPosition(position))
                .perform(swipeUp());
    }

    /**
     * Swipe Down recyclerView to specify position
     *
     * @param recyclerViewId IdRes to recyclerView
     * @param position specify position
     */
    protected void swipeDownRecyclerViewToPosition(@IdRes int recyclerViewId, int position) {
        onView(allOf(withId(recyclerViewId), hasFocus()))
                .check(matches(isDisplayed()))
                .perform(scrollToPosition(position))
                .perform(swipeDown());

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…