Commit f47f0bb2 authored by mjaillot's avatar mjaillot
Browse files

Fixed tests

parent 64f13840
......@@ -5,7 +5,7 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.ApplicationProvider
import androidx.test.espresso.Espresso.onView
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.contrib.DrawerActions
import androidx.test.espresso.contrib.DrawerMatchers
......@@ -171,11 +171,11 @@ class DrawerMenuTest {
onView(withText(R.string.menu_account)).perform(click())
Thread.sleep(100)
// Open bookmarks tab
onView(withId(R.id.profilePage)).perform(CustomMatchers.slowSwipeUp(true))
Thread.sleep(1000)
onView(withId(R.id.editButton)).perform(swipeUp())
Thread.sleep(100)
onView(withId(R.id.profile_view_pager))
.perform(CustomMatchers.slowSwipeLeft(true))
Thread.sleep(1000)
.perform(swipeLeft())
Thread.sleep(100)
// Open first post
onView(withId(R.id.profilePostsRecyclerView))
......@@ -183,7 +183,7 @@ class DrawerMenuTest {
RecyclerViewActions.actionOnItemAtPosition<ProfilePostsRecyclerViewAdapter.ViewHolder>
(0, CustomMatchers.clickChildViewWithId(R.id.postPreview))
)
Thread.sleep(1000)
Thread.sleep(100)
onView(withId(R.id.nlikes)).check(matches(withText("5 Likes")))
}
......
......@@ -167,15 +167,16 @@ class MockedServerTest {
onView(withId(R.id.list))
.perform(actionOnItemAtPosition<PostViewHolder>
(0, clickChildViewWithId(R.id.username)))
Thread.sleep(100)
Thread.sleep(1000)
onView(withId(R.id.followButton)).perform(ViewActions.swipeUp())
// Open followers list
onView(withId(R.id.nbFollowersTextView)).perform((click()))
Thread.sleep(1000)
Thread.sleep(100)
// Open follower's profile
onView(withText("ete2")).perform((click()))
Thread.sleep(1000)
Thread.sleep(100)
onView(withId(R.id.accountNameTextView)).check(matches(withText("Christian")))
}
......
......@@ -11,7 +11,6 @@
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/profilePage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment