package com.socialteinc.socialate;

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;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.*;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;

@RunWith(AndroidJUnit4.class)

public class CheckEmailTest {

    @Rule
    public ActivityTestRule<CheckEmailActivity> rule = new ActivityTestRule<>(CheckEmailActivity.class);

    @Test
    public void checkEmailLaunchTest(){

        onView(withId(R.id.emailEditText)).check(matches(isDisplayed()));
    }

    @Test
    public void checkEmailExistsTest(){

        onView(withId(R.id.emailEditText)).perform(typeText("invalid@socialate.com"), closeSoftKeyboard());
       // onView(withId(R.id.nextButton)).perform(click());
    }
}

@@ -789,26 +789,82 @@
 LaunchTest()
-%7B%0A
+ throws InterruptedException %7B%0A        Thread.sleep(2000);
 %0A        onV

put thread.sleep() to see if it works