Espresso - Asserting A Textview With Async Loaded Data
I'm writing a UI test with Google Espresso for Android and I'm stuck on how to assert a TextView text, which content is asynchronously loaded from a web service. My current code is
Solution 1:
You can handle this case by registering an IdlingResource for your web service with Espresso. Take a look at this write-up: https://developer.android.com/training/testing/espresso/idling-resource.html
Most likely, you'll want to use CountingIdlingResource (which uses a simple counter to track when something is idle). This sample test demonstrates how this can be done.
Post a Comment for "Espresso - Asserting A Textview With Async Loaded Data"