Android – Record Espresso Test

Android – Record Espresso Test

Android Studio has a very useful tool, the Record Espresso Test. It records the action on your application and creates an instrumented class file. Go to Run > Record Espresso Test. Choose the deployment device and click OK. Your app will start and together it will open a window that shows your actions. I typed Kronos. I also clicked Add assertion. Then I have to choose the view on the screen for the assertion. Select what type of matcher and the text. I clicked Save Assertion and then OK. I…

Android – Record Espresso Test Read More

Android – Instrumented test

Android – Instrumented test

If you want to read about JUnit tests then read this post. JUnit tests test the Java behaviour of your app. But to test the Android behaviour we need instrumented tests. They require a full Android environment and that is why they run on an Android Device or Emulator. One type is the unit instrumented test and another type is the automated UI test that checks the application behaviour when there are UI interactions. We should use @RunWith(AndroidJUnit4.class) before the class declaration. Also, all the annotations from the JUnit tests…

Android – Instrumented test Read More