// Path: app/src/androidTest/java/com/ragdroid/dahaka/DahakaTestApplication.java
// public class DahakaTestApplication extends DahakaApplication {
// 
//     public TestComponent getTestComponent() {
//         return testComponent;
//     }
// 
//     private TestComponent testComponent;
// 
//     @Override
//     protected void createComponent() {
//         testComponent = DaggerTestComponent.builder().application(this).build();
//         testComponent.inject(this);
//     }
// 
// }
// 
// Path: app/src/androidTest/java/com/ragdroid/dahaka/app/TestComponent.java
// @Singleton
// @Component(modules = {
//         MockAppModule.class,
//         MockApiModule.class,
//         TestAppBindingModule.class,
//         AndroidSupportInjectionModule.class})
// public interface TestComponent extends AppComponent {
// 
//     void inject(DahakaTestApplication instance);
// 
//     void inject(LoginActivityTest loginActivityTest);
// 
//     @Component.Builder
//     interface Builder {
// 
//         TestComponent build();
// 
//         @BindsInstance
//         Builder application(Application application);
//     }
// 
// }
// 
// Path: app/src/main/java/com/ragdroid/dahaka/user/PokemonService.java
// @UserScope
// public interface PokemonService {
// 
//     /**
//      * fetch pokemon user
//      * @param id
//      * @return
//      */
//     @Headers("Content-Type: application/json")
//     @GET("pokemon/{name}")
//     Single<Pokemon> getPokemon(@Path("name") String id);
// 
// }


import android.app.Instrumentation;
import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import com.ragdroid.dahaka.DahakaTestApplication;
import com.ragdroid.dahaka.R;
import com.ragdroid.dahaka.app.TestComponent;
import com.ragdroid.dahaka.user.PokemonService;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.inject.Inject;
import io.reactivex.Single;
import io.reactivex.schedulers.TestScheduler;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.RootMatchers.withDecorView;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.core.Is.is;
import static org.mockito.Mockito.when;
package com.ragdroid.dahaka.activity.login;








/**
 * Created by garimajain on 28/08/17.
 */
@RunWith(AndroidJUnit4.class)
public class LoginActivityTest {

    @Inject
// Path: app/src/androidTest/java/com/ragdroid/dahaka/DahakaTestApplication.java
// public class DahakaTestApplication extends DahakaApplication {
// 
//     public TestComponent getTestComponent() {
//         return testComponent;
//     }
// 
//     private TestComponent testComponent;
// 
//     @Override
//     protected void createComponent() {
//         testComponent = DaggerTestComponent.builder().application(this).build();
//         testComponent.inject(this);
//     }
// 
// }
// 
// Path: app/src/androidTest/java/com/ragdroid/dahaka/app/TestComponent.java
// @Singleton
// @Component(modules = {
//         MockAppModule.class,
//         MockApiModule.class,
//         TestAppBindingModule.class,
//         AndroidSupportInjectionModule.class})
// public interface TestComponent extends AppComponent {
// 
//     void inject(DahakaTestApplication instance);
// 
//     void inject(LoginActivityTest loginActivityTest);
// 
//     @Component.Builder
//     interface Builder {
// 
//         TestComponent build();
// 
//         @BindsInstance
//         Builder application(Application application);
//     }
// 
// }
// 
// Path: app/src/main/java/com/ragdroid/dahaka/user/PokemonService.java
// @UserScope
// public interface PokemonService {
// 
//     /**
//      * fetch pokemon user
//      * @param id
//      * @return
//      */
//     @Headers("Content-Type: application/json")
//     @GET("pokemon/{name}")
//     Single<Pokemon> getPokemon(@Path("name") String id);
// 
// }


// Path: app/src/androidTest/java/com/ragdroid/dahaka/activity/login/LoginActivityTest.java
import android.app.Instrumentation;
import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import com.ragdroid.dahaka.DahakaTestApplication;
import com.ragdroid.dahaka.R;
import com.ragdroid.dahaka.app.TestComponent;
import com.ragdroid.dahaka.user.PokemonService;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.inject.Inject;
import io.reactivex.Single;
import io.reactivex.schedulers.TestScheduler;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.RootMatchers.withDecorView;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.core.Is.is;
import static org.mockito.Mockito.when;

package com.ragdroid.dahaka.activity.login;








/**
 * Created by garimajain on 28/08/17.
 */
@RunWith(AndroidJUnit4.class)
public class LoginActivityTest {

    @Inject
    PokemonService service;