Android Espresso - How to check EditText hint?

Eduko picture Eduko · Dec 2, 2013 · Viewed 14.2k times · Source

I'm starting to play with Espresso, got my basic tests running. Now trying to figure out how to check that my edit text has a specific hint text? Thanks.

onView(withId(R.id.locationInput)).check(matches...?)

Answer

Dmitry Bilko picture Dmitry Bilko · Mar 11, 2015

Since Espresso 2.0 just use internal ViewMatcher withHint:

onView(withId(R.id.locationInput)).check(matches(withHint("your_hint")))