mercredi 3 février 2016

Find view in adapterView with Espresso

I want to find a view with specific id in the first position of my listview. My list adapter has items of type "User", but I just want to find if a checkBox in a concrete row of the listview is checked or not. So I have tried something like this:

    onData(allOf(withId(R.id.contact_list_checkbox))).atPosition(0).check(matches(isChecked()));

But it doesn't work:

No data found matching: (with id: 2131689762) contained values: <[Data: User1 (class: User) token: 0, Data: User2 (class: User) token: 1]> at android.support.test.espresso.action.AdapterDataLoaderAction.perform(AdapterDataLoaderAction.java:96)

Aucun commentaire:

Enregistrer un commentaire