View on GitHub

reading-notes

Espresso

\

What is Espresso?

Espresso is a frameworke use to write reusable UI test for Android, this framework also ensures that your activity is started before the tests run. Espresso test wait until all background activities have finished. It also could test a single or test across applications.

Example:

@Test
public void greeterSaysHello() {
    onView(withId(R.id.name_field)).perform(typeText("Steve"));
    onView(withId(R.id.greet_button)).perform(click());
    onView(withText("Hello Steve!")).check(matches(isDisplayed()));
}

What is synchronization capabilities of Espresso:

When the test invokes onView(), Espresso check the following:

What are the Packages in Espresso?

What are the basic components on Espresso?

Espresso basics:

What are the main components of Espresso include?

Example:

onView(withId(R.id.my_view))
  .perform(click())
  .check(matches(isDisplayed()));

Create UI tests with Espresso Test Recorder: