risangprisaltomo / android-test-kit

Automatically exported from code.google.com/p/android-test-kit
0 stars 0 forks source link

onData altering view hierarchy by executing single-click on spinner when not preceded by onView(..).click() #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a spinner
2. Populate it with mock data during test
3. Use only 'onData(allOf(is(instanceOf(String.class)), is("Americano")))', 
without a preceding onView(withId(R.id.spinner_simple)).perform(click());

What is the expected output? What do you see instead?
Don't think anything should happen, as the data is not displayed.
Instead the spinner is actually clicked, resulting in a different hierarchy and 
error ViewNotFound.

What version of the product are you using? On what operating system?
1.1-r2

Please provide any additional information below.

Original issue reported on code.google.com by dane...@gmail.com on 30 Apr 2014 at 10:54

GoogleCodeExporter commented 9 years ago
This is intended behavior. When invoking onData, you are instructing Espresso 
to select something in the given adapter and bring it into focus. Clicking on 
the spinner is part of that.

Original comment by vale...@google.com on 7 May 2014 at 6:54