Home:ALL Converter>Testing two activities with Robolectric 4 and Espresso

Testing two activities with Robolectric 4 and Espresso

Ask Time:2018-11-16T16:43:30         Author:Master Disaster

Json Formatter

I am just wondering if I can write tests in Robolectric 4 that I can test full integration between Activities.

I need to open FirstActivity because I have to get full data from network API and then my application starts SecondActivity that is using data from FirstActivity. I do not pass data in bundle.

So we scenarios should look like: 1. Open first activity 2. Open second activity 3. Check if button is visible (Espresso) 4. Next step to test flow

I have test written in Espresso (Automated Test) and I can do everything what I wrote above. Is it possible to make similar test with Robolectric?

Does Robolectric have idea to test only one activity without integration for another?

Author:Master Disaster,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/53334231/testing-two-activities-with-robolectric-4-and-espresso
yy