package fr.miage.paris10.projetm1.helpu;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.action.ViewActions.click;

import static android.support.test.espresso.matcher.ViewMatchers.withId;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;


/**
 * Created by dameimou on 07/03/2017.
 */

@RunWith(AndroidJUnit4.class)
public class LoginActivityTest {
    @Rule
    public ActivityTestRule<LoginActivity> loginActivityRule  = new ActivityTestRule<>(LoginActivity.class);


    @Test
    public void testGoodLogIn() {
        onView(withId(R.id.input_email))
                .perform(typeText("33012900@u-paris10.fr"), closeSoftKeyboard());

        onView(withId(R.id.input_password)).perform(typeText("azerty"), closeSoftKeyboard());
        onView(withId(R.id.btn_login)).perform(click());
    }
   @Test
    public void testFalseLogIn() {
       LoginActivity activity = loginActivityRule.getActivity();
        onView(withId(R.id.input_email))
                .perform(typeText("a@u-paris10.fr"), closeSoftKeyboard());

        onView(withId(R.id.input_password)).perform(typeText("azerty"), closeSoftKeyboard());
        onView(withId(R.id.btn_login)).perform(click());
    }

}

@@ -324,262 +324,1202 @@
 ck;%0A
-%0Aimport static android.support.test.espresso.matcher.ViewMatchers.withId;%0Aimport android.support.test.rule.ActivityTestRule;%0Aimport android.support.test.runner.AndroidJUnit4;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A
+import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;%0Aimport static android.support.test.espresso.matcher.ViewMatchers.withText;%0A%0Aimport static android.support.test.espresso.action.ViewActions.typeText;%0Aimport static android.support.test.espresso.matcher.ViewMatchers.withId;%0Aimport android.support.test.rule.ActivityTestRule;%0Aimport android.support.test.runner.AndroidJUnit4;%0Aimport android.widget.Toast;%0Aimport static android.support.test.espresso.Espresso.onView;%0Aimport static android.support.test.espresso.matcher.ViewMatchers.withText;%0Aimport static android.support.test.espresso.matcher.RootMatchers.withDecorView;%0Aimport static android.support.test.espresso.assertion.ViewAssertions.matches;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport static android.support.test.espresso.assertion.ViewAssertions.matches;%0Aimport static android.support.test.espresso.matcher.RootMatchers.withDecorView;%0Aimport static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;%0Aimport static android.support.test.espresso.matcher.ViewMatchers.withText;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.hamcrest.Matchers.not;
 %0A%0A/*
@@ -1906,33 +1906,32 @@
 oftKeyboard());%0A
-%0A
         onView(w
@@ -2296,17 +2296,16 @@
 ard());%0A
-%0A
         
@@ -2451,13 +2451,207 @@
 ));%0A    
+           onView(withText(%22Login failed%22)).%0A                       inRoot(withDecorView(not(is(activity.getWindow().getDecorView())))).%0A                       check(matches(isDisplayed()));%0A    
 %7D
-%0A
 %0A%7D%0A

Update LoginActivityTest.java