I am currently testing my app's UI with Espresso, and have run into a few problems. My app requires a user to be logged in to use it, and then after logging in, in my apps onCreate I load a list with data that is retrieved from an api call to my server. How can i manually add this data(JSON) into my RecyclerView in my Espresso tests this way the app has data to work with during the testing.
Asked
Active
Viewed 1,139 times
2
-
one way would be to use a mock server, or to replace your api layer by a mock layer. – njzk2 Jul 27 '16 at 21:06
-
Ive actually tried mock server as that is what i am using on my (Robolectric) junit tests to test the api calls and responses, but i cant seem to get that to work/sync up with the Espresso tests the same way. – johntzan Jul 27 '16 at 21:14