Use both InstrumentationTestRunner and AndroidJUnitRunner with Robotium and Espresso

We’re using Robotium with the android.test.InstrumentationTestRunner for our tests. Nevertheless we want to replace Robotium for Espresso, but we still have some doubts about it, since we have a machine with Jenkins for the CI.

Espresso uses the while Robotium uses the aforementioned and first, we would like to be able to use both testing frameworks at the same time.
Is it possible? How can we specify that in the build.gradle file? How can we configure our jenkins machine to have different jobs for the different testing frameworks?

  • How do I build from a Git repository subdirectory with Jenkins & Ant?
  • Is it mandatory to save *.iml files in Version control?
  • Egit error when saving file
  • Gradle dependency causing error “Invalid Magic Number”
  • Cordova - Error code 1 for command | Command failed for
  • Short read Permission denied during Checkout branch in Android Studio
  • I understand it is possible to have Espresso extend the ActivityInstrumentationTestCase2, since our Robotium test classes also use a test runner which extends from ActivityInstrumentationTestCase2, but we still need to tackle the problem of the instrumentation test runner.

  • You need the NDKr9 or later
  • Configure Hudson to only execute Build or Post Build actions if changes in SVN are detected
  • push error: master: master
  • Detached HEAD Issue in Android Studio
  • working with bitbucket and native android development
  • How to use eclipse project from github for Android development
  • One Solution collect form web for “Use both InstrumentationTestRunner and AndroidJUnitRunner with Robotium and Espresso”

    From the Android developer docs, AndroidJUnitRunner replaces the older InstrumentationTestRunner.

    “The AndroidJUnitRunner class is a JUnit test runner that lets you run JUnit 3 or JUnit 4-style test classes on Android devices, including those using the Espresso and UI Automator testing frameworks. The test runner handles loading your test package and the app under test to a device, running your tests, and reporting test results. This class replaces the InstrumentationTestRunner class, which only supports JUnit 3 tests.”

    I’ve not found many examples of being able to run Instrumentation Tests (e.g. using Robotium). I’ve been looking for my own purposes.

    The doc explains how to replace the test runner in your build.gradle file

    Git Baby is a git and github fan, let's start git clone.