Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Espresso:- IdlingResources must support Databinding #317

Open
jongerrish opened this issue Apr 29, 2019 · 3 comments
Open

Espresso:- IdlingResources must support Databinding #317

jongerrish opened this issue Apr 29, 2019 · 3 comments
Assignees

Comments

@jongerrish
Copy link
Collaborator

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

@brettchabot
Copy link
Collaborator

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

@thrlr123
Copy link

thrlr123 commented Apr 1, 2020

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.

android/testing-samples#314

Zemotacqy pushed a commit to Zemotacqy/android-test that referenced this issue May 5, 2023
Update to AndroidX Test 1.3.0-beta01
@seadowg
Copy link

seadowg commented Apr 5, 2024

Just to clarify, View binding doesn't have this problem right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants