Espresso: match with resource names in settings screen

Apparently this is more robust (especially for SDK version 25)
This commit is contained in:
Yusuke Matsubara 2017-05-21 20:03:03 +09:00
parent aeb66492d6
commit 28d73d2b96

View file

@ -103,8 +103,8 @@ public class SettingsActivityTest {
private static Matcher<View> findPreferenceList() {
return allOf(
ViewMatchers.isDescendantOfA(ViewMatchers.withId(android.R.id.content)),
ViewMatchers.withId(android.R.id.list),
ViewMatchers.isDescendantOfA(ViewMatchers.withId(R.id.settingsFragment)),
ViewMatchers.withResourceName("list"),
ViewMatchers.hasFocus()
);
}