I am trying to write a test that performs a click on a Spinner
item by text.
My test contains these lines:
onView(withId(R.id.spn_trans_type))
.perform(click());
onData(anything())
.inAdapterView(withId(R.id.spn_trans_type))
.onChildView(allOf(withId(textViewIdToTest), withText(expectedText)))
.perform(click());
But I got an exception: NoMatchingViewException: No views in hierarchy found matching: with id: com.rirdev.aalf.demo:id/spn_trans_type
How to find spinner adapter view? In other words what should I put into inAdapterView()
method ?