Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. @Test
  2. public void canModifyNutritionAndName() {
  3. addItem();
  4. onView(withId(R.id.recycler_view)).perform(actionOnItemAtPosition(1, click()));
  5.  
  6. onView(withId(R.id.name_edit_text)).perform(replaceText("new name"));
  7. onView(withId(R.id.protein_edit_text)).perform(replaceText("10"));
  8. onView(withId(R.id.fats_edit_text)).perform(replaceText("10"));
  9. onView(withId(R.id.carbs_edit_text)).perform(replaceText("10"));
  10. onView(withId(R.id.calories_edit_text)).perform(replaceText("100"));
  11. onView(withId(R.id.button_ok)).perform(click());
  12.  
  13. onView(withId(R.id.recycler_view)).perform(actionOnItemAtPosition(1, click()));
  14. onView(withId(R.id.name_edit_text)).check(matches(withText("new name")));
  15. onView(withId(R.id.protein_edit_text)).check(matches(withText("10.0")));
  16. onView(withId(R.id.fats_edit_text)).check(matches(withText("10.0")));
  17. onView(withId(R.id.carbs_edit_text)).check(matches(withText("10.0")));
  18. onView(withId(R.id.calories_edit_text)).check(matches(withText("100.0")));
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement