Espresso tests that check if Snackbar is displayed and if there is an internet connection I have recently began writing tests for Android using the espresso library.
Here I have three tests.

The first test is to check if a snackbar appears when searching with blank text.
The second is a search for a restaraunt not in the database.
Finally I have a test that checks if there is an internet connection.
Can anyone verify that my tests are doing what I intend them to do and if there is anything I am missing or doing wrong?

    public class MainScreenTest {


    //Rules are interceptors which are executed for each test method
    //and will run before any set up code in the @Before method
    @Rule
   public ActivityTestRule&lt;MainScreen&gt; mainScreenActivityTestRule =
            new ActivityTestRule&lt;MainScreen&gt;(MainScreen.class);


    @Test
    public void testSearchWithBlankText() throws Exception{
        Espresso.onView(withId(R.id.searchEditText)).perform(typeText(""),pressImeActionButton());
        Espresso.onView(withText(R.string.invalidSearch))
                .check(matches(isDisplayed()));

    }

    @Test
    public void testSearchWithInvalidRestaurant() throws Exception{
        Espresso.onView(withId(R.id.searchEditText))
                .perform(typeText("Hoffman"),pressImeActionButton());
        Espresso.onView(withId(R.id.noResultsTV)).check(matches(withText("No results, try another restaurant")));
    }


    @Test
    public void testWhenInternetIsAvailable() throws Exception{
        Context context = mainScreenActivityTestRule.getActivity().getBaseContext();
        ConnectivityManager cm = (ConnectivityManager)
                context.getSystemService(Context.CONNECTIVITY_SERVICE);
        boolean isConnected = cm.getActiveNetworkInfo().isConnectedOrConnecting();
        Assert.assertEquals(true, isConnected);
    }




}
Test#1 looks good, but I would add a case with blank text "_____" too.
Test#2 looks good, but I would name as userGetsErrorWhenSearchingInvalidRestaurant()
Test#3 needs attention. You verify only that an internet connection is good but you don't test user interaction. There are 2 options:


Left 'as is' but rename test method to `isConnectedOrConnectingReturnsTrueWhenInternetIsAvailable()
Add user interaction to make sure the data from internet was loaded successfully.