Testing Snackbar on Android
Barry Carroll

Looks like this can help with testing toasts in our espresso automation. Thanks for sharing it.

Is there a reliable way to assert that toast/snack bar doesn’t show up?

I have something like

ToastPopup toast = new ToastPopup(setupRule.getActivity());

Where ToastPopup is

public class ToastPopup {
public ViewInteraction oopsToast;

public ToastPopup(Activity activity) {
oopsToast =

But I am not fully confident this is reliable and I have seen it flaking out sometimes.