vendredi 14 février 2020

How to scroll the page to the very bottom in Android Espresso?

I need to check the presence of the button that is located below. To do this, scroll through the page

@Test
public void checkMoneyBackButton() throws Exception {

    onView(withId(R.id.btnAuthLogin)).perform(click());

    Thread.sleep(10000);
    onView(withId(R.id.etSessionKey1)).perform(typeText("1234"));
    closeSoftKeyboard();

    SystemClock.sleep(45000);

    ViewInteraction viewInteraction = Espresso.onView(withText("**** 0431"));
    viewInteraction.perform(click());

    Thread.sleep(3000);

    onView(withId(R.id.cardContainer))
            .perform(swipeUp());

    onView(withId(R.id.statementMoneyBack)).check(matches(isDisplayed()));
}

But using this code, I get an error:

 Error performing 'fast swipe' on view 'with id:...

Aucun commentaire:

Enregistrer un commentaire