Open jongerrish opened 5 years ago
Perhaps this should be reworded as 'DataBinding' requires a custom IdlingResource? Since there is a IR sample for DataBinding that seems to work.
Both @slinzner and I looked into this and didn't think it was feasible for Espresso to use Choreographer as an idling resource
My espresso tests were working fine before I updated to AS 3.6 with
viewBinding {
enabled = true
}
Now, when I do something like this it is not working:
public static void tapCard(String PageName) throws Throwable {
Lets.performAndTakeSS(On.LocationsListDetails.CARDS_RECYCLER_VIEW, RecyclerViewActions.scrollTo(hasDescendant(EspressoMatchers.withText(EspressoMatchers.endsWith(PageName)))));
Lets.performAndTakeSS(On.LocationsListDetails.CARDS_RECYCLER_VIEW, RecyclerViewActions.actionOnItem(hasDescendant(EspressoMatchers.withText(EspressoMatchers.endsWith(PageName))), click()));
}
Am I supposed to change anything to work with viewbinding? Seeing this issue especially with Fragments.
Just to clarify, View binding doesn't have this problem right?
DataBinding uses different approach to schedule an update, it uses Choreographer.postFrameCallback. So updates are not posted into looper queue and Espresso will not wait for them.
See: https://stackoverflow.com/questions/40703567/how-do-i-make-espresso-wait-until-data-binding-has-updated-the-view-with-the-dat