Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 248
Milad Varvaei Avatar asked Apr 09 '26 00:04

Milad Varvaei


2 Answers

Currently, this is marked as expected behavior due to the limitation of Espresso with Compose.

https://issuetracker.google.com/issues/232961218

Android Studio could have made it as a warning instead of an error that would have worked for hyrbrid apps but as of now, it's an error.

like image 89
shubhamgarg1 Avatar answered Apr 11 '26 14:04

shubhamgarg1


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

like image 44
Umberto Palazzini Avatar answered Apr 11 '26 13:04

Umberto Palazzini



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!