Would anyone know how to test for the appearance of a Toast message on an Activity?
I\'m using code similar to what the OP posted on this question for testing my pro
you can choose Robolectric test framework.For checking toast, you can use it as below:
assertTrue(ShadowToast.showedCustomToast("message", R.id.message)); //R.id.message: textView ID
I am using it like:
wait_for_text("Notification message to be verified", timeout: 30)
This is an alternate way which partially serves the purpose.
Would anyone know how to test for the appearance of a Toast message on an Activity?
You can't -- sorry. By which, I mean there is no way to ask Android "hey, is a Toast showing? and what does it look like?".