public void testOnClickLogoutMenuItem() { solo.clickOnMenuItem(getActivity().getString(R.string.logout)); getInstrumentation().waitForIdleSync(); solo.hideSoftKeyboard(); solo.assertCurrentActivity("Expected Login activity", "Login"); solo.goBack(); }
// the function just for help to minimize and reuse the code private void innerFunction(Button btn, Class cls) { solo.clickOnView(btn); solo.sleep(500); solo.assertCurrentActivity("ERR - Could not jump to children list.", cls); solo.hideSoftKeyboard(); solo.goBack(); solo.goBack(); solo.assertCurrentActivity("ERR - Could not jump back from children list.", researcher.class); }