androidreact-nativeandroid-espressoandroid-espresso-recorder

How to use Espresso Test Recorder in React Native


I have been struggling to get this to work. I am choosing Espresso as a framework to test because I see there is support in Xamarin Test Cloud, Firebase and Amazon Device Farm which makes it easier to port the tests.

Also, I like the fact that you can just record a test with Android Studio. The problem is that my clicks are not being catched. Only the ones that I made on the Back button.

It seems all the Touchable views in RN are being ignored. I understand RN creates Views in a different way, and also there is no resourceId.


Solution

  • i had the same error, for some reason Espresso does not support full Test Recorder clicks, you can do a few with the recorder but you will need to do some manually as this video says

    https://youtu.be/JRkDVvB106k?t=2m4s

    as the documentation says

    espresso-core - Contains core and basic View matchers, actions, and assertions. See Basics and Recipes.

    https://developer.android.com/training/testing/espresso/index.html