use of com.github.pockethub.android.tests.ViewVisibilityIdlingResource in project PocketHub by pockethub.
the class EditIssueActivityTest method testSaveMenuEnabled.
/**
* Verify save menu is properly enabled/disable depending on the issue have
* a non-empty title
*
* @throws Throwable
*/
@Test
public void testSaveMenuEnabled() {
ViewInteraction createMenu = onView(withId(R.id.m_apply));
ViewInteraction comment = onView(withId(R.id.et_issue_title));
ViewVisibilityIdlingResource idlingResource = new ViewVisibilityIdlingResource(activityTestRule.getActivity(), R.id.sv_issue_content, View.VISIBLE);
IdlingRegistry.getInstance().register(idlingResource);
createMenu.check(ViewAssertions.matches(not(isEnabled())));
closeSoftKeyboard();
comment.perform(ViewActions.typeText("a"));
createMenu.check(ViewAssertions.matches(isEnabled()));
comment.perform(ViewActions.replaceText(""));
createMenu.check(ViewAssertions.matches(not(isEnabled())));
IdlingRegistry.getInstance().unregister(idlingResource);
}
Aggregations