Understanding results of Android Espresso instrumentation test

  android, android-espresso, android-studio

I’ve created a simple test using Espresso in Android Studio.
The test runs to completion and gives a success message.

However, I’m testing to see if two Button views are visible or not.
I expect to see that one button is visible and the other is not

The test result does not mention this at all. The goal of this test is to run it via Firebase Test Lab on various virtual and real devices and read the results of the test!

Here is the simple test on Android Studio:

@RunWith(AndroidJUnit4.class)
@LargeTest
public class MyGraphingTest {  

@Rule
public ActivityScenarioRule<MainActivity> activityRule
        = new ActivityScenarioRule<>(MainActivity.class); 

@Test
public void MyTestMethod(){

  //some test instructions that will lead me to where the two Button views are...
  //more test instructions that will hide one Button view from screen, while the other Button view remains visible.

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

}

see the attached picture to see the test results!
enter image description here

Source: Android Questions

LEAVE A COMMENT