Category Archives: testing

Robolectric reference

Robolectric Android testing Fragments and more private ReminderManagerFragment startReminderManagerFragment() { final ReminderManagerFragment fragment = new ReminderManagerFragment(); SupportFragmentTestUtil.startVisibleFragment(fragment); return fragment; } @Test public void reminderManagerTest() throws Exception { // by default there should be 3 Reminder rows ReminderManagerFragment fragment = startReminderManagerFragment(); assertThat(fragment).isNotNull(); Button addButton = (Button) fragment.getView().findViewById(R.id.reminder_add_button); assertThat(addButton).isNotNull(); List<Reminder> reminders = getReminders(TestValues.BillyUser); assertThat(reminders.size()).isEqualTo(3); // add a… Read More »

Robotium reference

Enter text EditText / text field solo.enterText((EditText) solo.getView(R.id.email_edittext), “baduser@gmail.com”); Click Button solo.clickOnButton(“Login”); Check for Toast Text Message assertTrue(solo.waitForText(getActivity().getResources() .getString(R.string.msg_login_failed)));     More to come…