android - How do I test a that crouton message ALERT was displayed using espresso -


I am doing automated testing using espresso, generally if I have a message, then I see TextView or I use the resource ID to test the element. This way

  onView (withId (R.id.myTextViewID)). Check (Matching (string ("checking message"));  

Now there is a problem with crouton ALERT messages, I do not know which ID to check with. < / P>

This should do the trick:

  onview (with text (string ("Messages that you are checking")).) Tests (matches (some ());  

matches () section already checks That view is present in the scene hierarchy, I think that to test You can change the isDisplayed () with some () , if it does, but this check may fail if it has been done immediately when Crouton The view has been added to the view hierarchy, but partially still is not visible.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -