Reputation: 1041
I am working on a app where I need to test the layout using Espresso. The problem is that its and orphaned layout without any attachments to activity or fragment (I will attach it later). I would like to test the layout without any interaction of activity or fragments.
For example I have MainActivity with activity_main.xml as its content layout. I also have another layout say "activity_details.xml". I would like to test activity_details which is not attached to any Activity at the moment.
Also it would be great if I can know how to add mock values to the layout.
Upvotes: 2
Views: 536
Reputation: 19351
I would like to test the layout without any interaction of activity or fragments.
Sorry, but that's not possible. Espresso
gets an actual application context, so it depends on what is in actual moment visible on the screen and what is already be doing on UI Thread.
Try to use Robolectric
or UiAutomator
instead of Espresso
.
Upvotes: 2