Skip to content

Commit

Permalink
requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
GOVINDDIXIT committed Aug 14, 2019
1 parent 58d0ef3 commit 5dc6522
Showing 1 changed file with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ import chat.rocket.android.analytics.event.ScreenViewEvent
import chat.rocket.android.authentication.ui.AuthenticationActivity
import chat.rocket.android.util.RecyclerViewItemCountAssertion
import chat.rocket.android.util.extensions.addFragmentBackStack
import chat.rocket.android.util.loginUserToTheApp
import org.hamcrest.Matchers.equalTo
import org.hamcrest.Matchers.greaterThan
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import testConfig.Config.Companion.MEMBERS
import testConfig.Config.Companion.NON_EXISTING_USER
import testConfig.Config.Companion.PASSWORD
import testConfig.Config.Companion.SERVER_URL
import testConfig.Config.Companion.TEST_CHANNEL3
import testConfig.Config.Companion.TEST_USER2
import testConfig.Config.Companion.USERNAME


class InviteUsersFragmentTest {
Expand All @@ -36,7 +35,10 @@ class InviteUsersFragmentTest {
@Before
fun setUp() {
try {
loginIfUserIsLoggedOut()
rule().activity.addFragmentBackStack(ScreenViewEvent.Login.screenName, R.id.fragment_container) {
chat.rocket.android.authentication.login.ui.newInstance(SERVER_URL)
}
loginUserToTheApp()
navigateToInviteUser()
} catch (e: NoMatchingViewException) {
Thread.sleep(3000)
Expand Down Expand Up @@ -83,16 +85,4 @@ class InviteUsersFragmentTest {
)
onView(withId(R.id.text_member_not_found)).check(matches(isDisplayed()))
}

private fun loginIfUserIsLoggedOut() {
rule().activity.addFragmentBackStack(ScreenViewEvent.Login.screenName, R.id.fragment_container) {
chat.rocket.android.authentication.login.ui.newInstance(SERVER_URL)
}
onView(withId(R.id.text_username_or_email)).perform(
typeText(USERNAME), closeSoftKeyboard()
)
onView(withId(R.id.text_password)).perform(typeText(PASSWORD), closeSoftKeyboard())
onView(withId(R.id.button_log_in)).perform(click())
Thread.sleep(12000)
}
}

0 comments on commit 5dc6522

Please sign in to comment.