package com.abhi.fyberdemo;

import android.support.test.espresso.assertion.ViewAssertions;
import android.support.test.rule.ActivityTestRule;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;

/**
 * Created by abhi on 28/10/16.
 */
public class MainActivityEspressoTest {
    @Rule
    public ActivityTestRule<MainActivity> mActivityRule =
            new ActivityTestRule<>(MainActivity.class);

    @Before
    public void setUp() throws Exception {

    }

    @Test
    public void ensureProgressBarDisplay(){
        onView(withId(R.id.button_get_data))
                .perform(click());
        onView(withId(R.id.progress)).
                check(ViewAssertions.matches(isDisplayed()));
    }
}
Add Espresso Test for MainActivity
Add Espresso Test for MainActivity
