I have:
onView(withId(R.id.login_email_textview)).perform(clearText(), closeSoftKeyboard());
onView(withId(R.id.password_edittext)).perform(clearText(), closeSoftKeyboard());
onView(withId(R.id.login_email_textview)).perform(typeText(email), closeSoftKeyboard());
onView(withId(R.id.password_edittext)).perform(typeText(password), closeSoftKeyboard());
onView(withId(R.id.email_sign_in_button)).perform(click());
intended(hasComponent(new ComponentName(getTargetContext(), MainActivity.class)));
After the login button is pressed a Loading dialog shows up and Async task calls the server to check the credentials. After response the LoginActivity, witch I'm testing called finish() and MainActivity is started.
The test hangs after the login button is pressed. Also using:
@Rule
public IntentsTestRule<LoginActivity> mActivityRule = new IntentsTestRule<>(LoginActivity.class);
Also in my code after I/m calling startActivity(), I'm calling finish() on the LoginActivity.
On sign_in_button I'm calling Volley request.