Skip to content

Instantly share code, notes, and snippets.

@Egorand
Created July 17, 2016 11:48
Show Gist options
  • Save Egorand/0066471d9a2a8cabb2eec0adbaea0c85 to your computer and use it in GitHub Desktop.
Save Egorand/0066471d9a2a8cabb2eec0adbaea0c85 to your computer and use it in GitHub Desktop.
android-testing-runtime-permissions-assert-text-visible
public static void assertViewWithTextIsVisible(UiDevice device, String text) {
UiObject allowButton = device.findObject(new UiSelector().text(text));
if (!allowButton.exists()) {
throw new AssertionError("View with text <" + text + "> not found!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment