Search code examples
androidandroid-studioreact-nativeandroid-espressoandroid-espresso-recorder

Recording Espresso tests with React Native


I'm creating an React Native application and I want to test it with Espresso.

When I click "Record Espresso Test", I get the following error:

No suitable Android Application configuration found

Please create an Android Application configuration with a valid module and Default or Specified launch activity.

Also, I created a test manually, but the "Run" button is not available for the test.

I found this answer: How to use Espresso UI Testing for React Native? and set the accessibilityLabel for my resources, but that does not seem to have any effect.

I'm using Android Studio 2.2.3 for this


Solution

  • I found a solution:

    If you import the android folder from the React Native project into Android Studio, it will behave as a regular Android project, so you will be able to record Espresso tests the usual way.