osama-raddad/android-test-kit

withText matches Buttons too

Closed this issue · 1 comments

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

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

  • Changed state: Invalid