Search code examples
androidkotlinandroid-jetpack-composeandroid-espresso-recorderandroid-jetpack-compose-testing

Test recorder for jetpack compose


I want to record a UI test in my jetpack compose project, just like record an Espresso test.

I want to follow thees steps:
  1. start recording

  2. open the application

  3. click on the objects(buttons, etc...)

  4. finish recording

  5. get generated kotlin codes just like Espresso recording

It seems we cannot use Espresso in a jetpackCompose project.

enter image description here

but in this project I didn't completely migrate to JetpackCompose still. but It recognizes it as a Jetpack Compose project


Solution

  • Espresso testing framework cannot be used with Jetpack Compose so test recording is not yet available but Compose tests are fairly easy to write.

    You can check the official documentation if this helps: https://developer.android.com/jetpack/compose/testing