Search code examples
androidreact-nativeandroid-espressoandroid-espresso-recorder

Writing UI tests for React-native app using espresso


I am trying to write some ui tests for a react-native app with espresso and I didn't found much help. is there a way to use espresso with react-native and espresso recorder ??


Solution

  • Yes, you can use Espresso Recorder with Reactive Native Android Apps. Just import the Android package from your React Native project.

    However, Espresso Recorder is not under any active development and was originally made by the Firebase team so it is not open sourced under AndroidX Test or maintained by the Android Studio tooling team.

    You can definitely still use the Android tools to inspect a React Native application, and to write Espresso tests, but the code you get from the Espresso Recorder should be taken with a grain of salt.

    Check out How to use Espresso UI Testing for React Native? and the linked gist: https://gist.github.com/cybergrind/0a2ad855352a5cd47cb5fb6a486c5eaa for more on creating Espresso tests for React Native Android apps.