try to fix tests failing sometimes
This commit is contained in:
parent
c09979a910
commit
ff16491a23
|
@ -51,6 +51,10 @@ class HomeFeedTest {
|
|||
)
|
||||
db.close()
|
||||
activityScenario = ActivityScenario.launch(MainActivity::class.java)
|
||||
|
||||
waitForView(R.id.username)
|
||||
onView(withId(R.id.list)).perform(scrollToPosition<StatusViewHolder>(0))
|
||||
|
||||
}
|
||||
@After
|
||||
fun after() {
|
||||
|
@ -63,6 +67,9 @@ class HomeFeedTest {
|
|||
//Wait for the feed to load
|
||||
waitForView(R.id.postPager)
|
||||
|
||||
|
||||
onView(withId(R.id.list)).perform(scrollToPosition<StatusViewHolder>(0))
|
||||
|
||||
activityScenario.onActivity {
|
||||
a -> run {
|
||||
//Pick the second photo
|
||||
|
@ -136,6 +143,8 @@ class HomeFeedTest {
|
|||
fun clickingUsernameOpensProfile() {
|
||||
waitForView(R.id.username)
|
||||
|
||||
onView(withId(R.id.list)).perform(scrollToPosition<StatusViewHolder>(0))
|
||||
|
||||
onView(withId(R.id.list)).perform(
|
||||
actionOnItemAtPosition<StatusViewHolder>(0, clickChildViewWithId(R.id.username))
|
||||
)
|
||||
|
@ -147,6 +156,8 @@ class HomeFeedTest {
|
|||
fun clickingProfilePicOpensProfile() {
|
||||
waitForView(R.id.profilePic)
|
||||
|
||||
onView(withId(R.id.list)).perform(scrollToPosition<StatusViewHolder>(0))
|
||||
|
||||
onView(withId(R.id.list)).perform(
|
||||
actionOnItemAtPosition<StatusViewHolder>(0, clickChildViewWithId(R.id.profilePic))
|
||||
)
|
||||
|
@ -158,6 +169,8 @@ class HomeFeedTest {
|
|||
fun clickingMentionOpensProfile() {
|
||||
waitForView(R.id.description)
|
||||
|
||||
onView(withId(R.id.list)).perform(scrollToPosition<StatusViewHolder>(0))
|
||||
|
||||
onView(withId(R.id.list)).perform(
|
||||
actionOnItemAtPosition<StatusViewHolder>(0, clickChildViewWithId(R.id.description))
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue