oscarxie / android-test-kit

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

withText matches Buttons too #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Put TextView on Layout
2. Put Button on Layout
3. Give them the same text
4. withText will match both

What is the expected output? What do you see instead?
Documentation says that it should only match TextViews, but it is nice to be 
able to match Buttons with text also

What version of the product are you using? On what operating system?
2.0, Windows

Please provide any additional information below.
workaround matcher: allOf( ViewMatchers.withText(text), 
ViewMatchers.withClassName(endsWith(className)))

Original issue reported on code.google.com by kura...@gmail.com on 15 Jan 2015 at 11:23

GoogleCodeExporter commented 9 years ago
Button inherits from TextView: 
http://developer.android.com/reference/android/widget/Button.html

Original comment by vale...@google.com on 27 Jan 2015 at 7:12