Reputation: 910
How can I check that a view (any view, TextBox, Button) is displayed in a WebView, using Espresso?
I have tried with the following, but I'm not able to finish the check:
onWebView().withElement(findElement(ID, "username")).check( ... )
Upvotes: 3
Views: 4968
Reputation: 3050
Just change this:
onWebView().withElement(findElement(ID, "username")).check( ... )
with this:
onWebView().check(webContent(hasElementWithId("username"));
Worked for me.
Upvotes: 1