-
Notifications
You must be signed in to change notification settings - Fork 301
Open
Description
In the method clickDecrementButton_ChangesQuantityAndCost() we should increment first the quantity to "1" to test that the decrement button works!. Comments updated accordingly:
@Test
public void clickDecrementButton_ChangesQuantityAndCost() {
// Check the initial quantity variable is zero
onView((withId(R.id.quantity_text_view))).check(matches(withText("0")));
// Click on increment button
onView((withId(R.id.increment_button)))
.perform(click());
// Click on decrement button
onView((withId(R.id.decrement_button)))
.perform(click());
// Verify that the decrement button decreases the quantity by 1
onView(withId(R.id.quantity_text_view)).check(matches(withText("0")));
// Verify that the decrement button also decreases the total cost from $5.00 to $0.00
onView(withId(R.id.cost_text_view)).check(matches(withText("$0.00")));
}
Metadata
Metadata
Assignees
Labels
No labels