Create a Test Annotation for Android Espresso tests

Use Annotation to run a quick set of Android Espresso tests and not the test suite or test class. It’s simple you create a new annotation, you add the annotation to tests you want to quickly run, then you run the tests with a Gradle task.

1. Using Android Studio create a new interface name: AcceptanceTestSuite.

androidTest/suite/ -> new Kotlin File/Class

2. Then add annotation @AcceptanceTestSuite to the tests you want to run. The annotation helps to filter a suite of tests to run.

3. Have an Android emulator running.

4. Run AcceptanceTestSuite on Android emulator using below Gradle tasks.

Thanks for reading :) happy testing.

software engineer, read, swim, travel. apps: https://goo.gl/rDuuQw https://goo.gl/15GvfE

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store