Fixed tests

This commit is contained in:
mjaillot 2020-05-22 15:33:58 +02:00
parent 64f138406c
commit f47f0bb2f1
3 changed files with 10 additions and 10 deletions

View File

@ -5,7 +5,7 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.ApplicationProvider import androidx.test.core.app.ApplicationProvider
import androidx.test.espresso.Espresso.onView import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions.click import androidx.test.espresso.action.ViewActions.*
import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.DrawerActions import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.contrib.DrawerMatchers import androidx.test.espresso.contrib.DrawerMatchers
@ -171,11 +171,11 @@ class DrawerMenuTest {
onView(withText(R.string.menu_account)).perform(click()) onView(withText(R.string.menu_account)).perform(click())
Thread.sleep(100) Thread.sleep(100)
// Open bookmarks tab // Open bookmarks tab
onView(withId(R.id.profilePage)).perform(CustomMatchers.slowSwipeUp(true)) onView(withId(R.id.editButton)).perform(swipeUp())
Thread.sleep(1000) Thread.sleep(100)
onView(withId(R.id.profile_view_pager)) onView(withId(R.id.profile_view_pager))
.perform(CustomMatchers.slowSwipeLeft(true)) .perform(swipeLeft())
Thread.sleep(1000) Thread.sleep(100)
// Open first post // Open first post
onView(withId(R.id.profilePostsRecyclerView)) onView(withId(R.id.profilePostsRecyclerView))
@ -183,7 +183,7 @@ class DrawerMenuTest {
RecyclerViewActions.actionOnItemAtPosition<ProfilePostsRecyclerViewAdapter.ViewHolder> RecyclerViewActions.actionOnItemAtPosition<ProfilePostsRecyclerViewAdapter.ViewHolder>
(0, CustomMatchers.clickChildViewWithId(R.id.postPreview)) (0, CustomMatchers.clickChildViewWithId(R.id.postPreview))
) )
Thread.sleep(1000) Thread.sleep(100)
onView(withId(R.id.nlikes)).check(matches(withText("5 Likes"))) onView(withId(R.id.nlikes)).check(matches(withText("5 Likes")))
} }

View File

@ -167,15 +167,16 @@ class MockedServerTest {
onView(withId(R.id.list)) onView(withId(R.id.list))
.perform(actionOnItemAtPosition<PostViewHolder> .perform(actionOnItemAtPosition<PostViewHolder>
(0, clickChildViewWithId(R.id.username))) (0, clickChildViewWithId(R.id.username)))
Thread.sleep(100)
Thread.sleep(1000) onView(withId(R.id.followButton)).perform(ViewActions.swipeUp())
// Open followers list // Open followers list
onView(withId(R.id.nbFollowersTextView)).perform((click())) onView(withId(R.id.nbFollowersTextView)).perform((click()))
Thread.sleep(1000) Thread.sleep(100)
// Open follower's profile // Open follower's profile
onView(withText("ete2")).perform((click())) onView(withText("ete2")).perform((click()))
Thread.sleep(1000) Thread.sleep(100)
onView(withId(R.id.accountNameTextView)).check(matches(withText("Christian"))) onView(withId(R.id.accountNameTextView)).check(matches(withText("Christian")))
} }

View File

@ -11,7 +11,6 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
android:id="@+id/profilePage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">