https://kotlinlang.org logo
#compose
Title
# compose
f

flosch

05/01/2020, 8:53 AM
Regarding testing with the `AndroidComposeTestRule`: What is the reason that I cannot declare
<activity android:name="androidx.activity.ComponentActivity" />
in the
androidTest/AndroidManifest.xml
but have to do it in
main/AndroidManifest.xml
? 🤔
l

louiscad

05/01/2020, 9:21 PM
That's not related to Jetpack Compose at all. Also seems like an XY problem (http://xyproblem.info/), I don't understand why you want to do that.
f

flosch

05/01/2020, 11:31 PM
Because this Activity is only used for testing and needed by the AndroidComposeTestRule. And it does work for a regular ActivityRule, that is why I thought it might be a compose problem
l

louiscad

05/01/2020, 11:58 PM
@flosch Well, I don't know about this, but the JetNews sample definitely has UI tests, and I can confirm they run: https://github.com/android/compose-samples/tree/cd65f2520db270c95abe3672df751e90a2a8709e/JetNews/app/src You might want to check it out from Android Studio (File > New > Import Sample > type "Jetnews") https://github.com/android/compose-samples/tree/cd65f2520db270c95abe3672df751e90a2a8709e/JetNews/app/src
f

flosch

05/02/2020, 8:13 AM
Yes, thanks, I was looking at that example. I already created my own project and ui tests which all works great, however I think the
Activity
declaration for testing should not be in the production
AndroidManifest
but in the
androidTest
`AndroidManifest`🤷‍♂️
l

louiscad

05/02/2020, 8:58 AM
Might make sense to open an issue then
9 Views