9

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

2 Answers2

3

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

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 03 '22 at 08:49
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/32830586) – Dr Mido Oct 05 '22 at 15:39
1

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.

shubhamgarg1
  • 1,619
  • 1
  • 15
  • 20