简体   繁体   中英

How to click on a button within a recycler view item using espresso?

Just to take an example, say my recycler view(with id "list") is this Gmail Inbox

在此处输入图片说明

I already know onView(withId(R.id.list)).perform(RecyclerViewActions.actionOnItemAtPosition(1, click()); let's me to open the second email.

But how do I just click on the star button of the second email with espresso ?

Have a look at the following stackoverflow question: It creates a ViewAction that clicks a view object, identified by id, at a specific position in the recyclerView.

Using Espresso to click view inside RecyclerView item

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM