testing-samples
testing-samples copied to clipboard
How to verify a toast is shown in test case?
Any suggestions?
onView(withText(R.string.TOAST_STRING)).inRoot(withDecorView(not(is(getActivity().getWindow().getDecorView())))).check(matches(isDisplayed()));
some imports will be required to run this.