Skip to content

What is espresso

Devrath edited this page Feb 27, 2024 · 6 revisions

About Espresso

  • Espresso is an open-source framework for Android applications developed by Google.
  • Espresso automatically synchronizes your test actions with the user interface of your application.
  • It ensures the activities are started before the tests are run.
  • It also ensures all the tests are run before the background activity is completed.

Espresso has 3 basic components

FIND-SOMETHING ----> DO-SOMETHING ----> CHECK-SOMETHING

  • ViewMatchers -> Finding a view in the current view hierarchy.
  • ViewActions -> Performing the actions on the view.
  • ViewAssertions -> Check something by asserting a value.

Advantages of using Espresso

  • Supported for all Android versions.
  • Easier to set up.
  • Supports Jacoco to measure code coverage.
  • Extensive testing is possible as it covers many UI actions and gestures(Toast messages, camera activity, etc.)

DisAdvantages of using Espresso

  • It takes a lot of time time to run the project.