Open timozattol opened 9 years ago
I suggest using Mockito to mock a certain JSON response from the server; the UI test can then check that a particular list of groups appears on the screen.
We want to navigate to MyRadinGroupActivity, this activity retrieves the radinGroups from server. Instead of retrieving data from server we want to mock the connection and its return in order to be sure to have always the same radinGroups (names shown) in the activity.
To me, mockito allows to mock objects and test their behaviours but not to replace some code with mock code during the app is running. The only thing that I see could be to re-code all the code that should be executed with Mockito.spy and insert the mock response between. But this seems complicated and I don't think that it is feasible because of the methods (or class) modifiers like protected and private...
Thanks for your help.
Demo = Opening app, going to MyRadinGroups and seeing multiple radingroups on the screen