Is an instrumentation test an integration test?

5

I've seen some videos where they explain how to test the call of an activity for another activity.

I did the following test and, after a reflection, I was not sure if the test I performed was integration, instrumentation or functional testing.

public class OneActivityTest {

    private OneActivity mActivity = null;

    @Rule
    public ActivityTestRule<OneActivity> mActivityTestRule = new ActivityTestRule<>(OneActivity.class);

    Instrumentation.ActivityMonitor monitor = getInstrumentation().addMonitor(TwoActivity.class.getName(), null, false);

    @Before
    public void setUp() {
        mActivity = mActivityTestRule.getActivity();
    }

    @Test
    public void checkYes() {

        Assert.assertNotNull(mActivity.findViewById(R.id.checkbox_sim));

        onView(withId(R.id.checkbox_sim)).perform(click());

        Assert.assertNotNull(mActivity.findViewById(R.id.save));

        onView(withId(R.id.save)).perform(click());

        Activity secondActivity = getInstrumentation().waitForMonitorWithTimeout(monitor, 5000);

        Assert.assertNotNull(secondActivity);

        secondActivity.finish();
    }
}

Can it be considered integration testing simply because it interacts with more than 1 activity?

    
asked by anonymous 27.09.2017 / 12:36

1 answer

2

The integration tests are aimed at verifying that the result of the interaction between the various parts / components of the application is as expected.

The instrumental tests are intended to simulate the interaction of the user, via UI, with the application. They check whether, at a given action in the UI, the application responds as expected. In doing so, they test integration of the UI with the rest of the application and so are integration tests.

    
27.09.2017 / 15:27