I want to click on the app tutorial OK button which is displayed only for first time,
In robotium this statement does this
if(solo.searchText("OK")){
solo.clickOnText("OK");
}else{
//Do other things
}
If OK text is not displayed test should not fail it should continue, but in espresso test is failed when second time app is run because that time app tutorial is not displayed.
In espresso
onView(withText("OK")).check(matches(isDisplayed())).perform(click());
asssertion fails here, I want boolean return value for OK text so that if OK button is not displayed test should continue.