use of androidx.test.uiautomator.UiDevice in project android by nextcloud.
the class InitialTest method clickByText.
/**
* Helper to click on object that match the text value.
*
* @param text the text
* @throws UiObjectNotFoundException
*/
private void clickByText(String text) throws UiObjectNotFoundException {
UiDevice device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
UiObject obj = device.findObject(new UiSelector().text(text));
obj.clickAndWaitForNewWindow();
}
Aggregations