toothpick
toothpick

Reputation: 143

Test 3 activities with Espresso

I have two activities which consist of filling a form and editing\viewing the filled form.
I would like to know whether the input text that was filled with one activity matches the text that is displayed in another activity. Currently, my test starts the form activity, fills random data and saves the form.
I would like to search for the filled form in a different activity, in which I click a button and then the filled details are shown and tested. What is the best way of testing such behavior?

Upvotes: 0

Views: 308

Answers (1)

jdonmoyer
jdonmoyer

Reputation: 1270

Espresso doesn't really care about Activities (other than the one you start with). You can start the Espresso test with one activity and then use ViewActions to navigate through your app to the one where you want to do the verification. One of the biggest issues that you may need to overcome is getting Espresso to 'wait' for anything asynchronous to occur while you're traveling from Point A to Point B in your app. Espresso will wait for AsyncTasks and provides rudimentary support for creating IdlingResources. In depth discussion of these things require more in depth knowledge of the specific issues that you are running into.

Upvotes: 1

Related Questions