I'm trying to write an Espresso test that tests a RatingBar selection. How can I set a specific rating using Espresso? I only see click()
, which always sets the middle rating.
You need to create a custom subclass of ViewAction that calls setRating on the view, then pass an instance of your custom view action to the perform() method.