https://github.com/appium/appium/issues/4824
yahman72 commented 9 days ago
I decided to open a new issue for this enhancement since the #968 was closed with "closed because Google needs to add this to uiautomator" comment.
IMHO there would be a way to support this by using the Accessiblity Services i.e.
1) implement a ToastRecorder app that catches & records the Toasts (see http://stackoverflow.com/questions/10659734/detecting-toast-messages)
2) include that app in the appium apk's that are installed on the device
3) enhance the Appium API to access the ToastRecorder data
In that stackover thread is a link to an App that is recoding Toasts. Currently I'm using that App to verify Toasts. To support this in Appium would be much better because using an extra app is pretty cumbersome for the verification. Currently I need to do the following:
1) run the tests for my app "normally" with appium
2) After execution start that Toaster App and verify that all expected Toast were recorded.