First of all, Espresso allows you to use Hamcrest matchers in tests.
Hamcrest 1.3 Quick Reference.
The most useful for catching the programmatically added views are withChild, withParent, hasSibling, and hasDescendant.
To make it more clear, I would give a simple example from my app:
onView(withId(R.id.action_bar_details))
.check(matches(withChild(withChild(withText("Details")))));
Secondly, for RecyclerView tests in Espresso use onData methods instead onView.
Espresso 2.1. Espresso Cheat Sheet Master
Another example from my app - using onData method
onData(anything()).inAdapterView(withId(R.id.listView)).atPosition(getRandomPosition()).
onChildView(withId(R.id.item)).check(matches(isDisplayed()));
Finally, check these great Googles repository for get more examples
- GoogleSample
- GoogleCodeLabs