From 4db85dbad6609917b297f137a2bff9c342f88bd7 Mon Sep 17 00:00:00 2001 From: Matthieu <24-artectrex@users.noreply.shinice.net> Date: Wed, 3 Mar 2021 14:20:06 +0100 Subject: [PATCH] Update test --- app/src/androidTest/java/com/h/pixeldroid/HomeFeedTest.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/androidTest/java/com/h/pixeldroid/HomeFeedTest.kt b/app/src/androidTest/java/com/h/pixeldroid/HomeFeedTest.kt index ae7cb737..5e9e5b52 100644 --- a/app/src/androidTest/java/com/h/pixeldroid/HomeFeedTest.kt +++ b/app/src/androidTest/java/com/h/pixeldroid/HomeFeedTest.kt @@ -10,6 +10,7 @@ import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition import androidx.test.espresso.contrib.RecyclerViewActions.scrollToPosition import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.viewpager2.widget.ViewPager2 import com.google.android.material.tabs.TabLayout import com.h.pixeldroid.utils.db.AppDatabase import com.h.pixeldroid.posts.StatusViewHolder @@ -55,15 +56,15 @@ class HomeFeedTest { @Test fun clickingTabOnAlbumShowsNextPhoto() { //Wait for the feed to load - waitForView(R.id.postTabs) + waitForView(R.id.postPager) activityScenario.onActivity { a -> run { //Pick the second photo - a.findViewById(R.id.postTabs).getTabAt(1)?.select() + a.findViewById(R.id.postPager).currentItem = 2 } } - onView(first(withId(R.id.postTabs))).check(matches(isDisplayed())) + onView(first(withId(R.id.postPager))).check(matches(isDisplayed())) } /* @Test