I have a question about selecting items in Spinners with Espresso. Or to be more exact: The selection works, but after that the view assertions fail because the spinner is s
You have to click on the spinner first, use this code:
@Test public void selectDogs() throws Exception { onView(withId(R.id.spinner)).perform(click()); onData(allOf(is(instanceOf(String.class)), is("dogs"))) .perform(click()); onView(withId(R.id.selected)).check(matches(withText("dogs"))); }