Skip to content

Instantly share code, notes, and snippets.

@angiejones
Created November 12, 2020 01:41
Show Gist options
  • Save angiejones/0ae0bfd245a262fd15b61ed494b7b8a8 to your computer and use it in GitHub Desktop.
Save angiejones/0ae0bfd245a262fd15b61ed494b7b8a8 to your computer and use it in GitHub Desktop.
Updated test to include more assertions
@Test
public void test_add_to_cart(){
String product = "TOKYO TALKIES";
String color = "Red";
String size = "M";
int quantity = 2;
productPage.setColor(color);
productPage.setSize(size);
productPage.setQuanity(quantity);
productPage.addToCart();
cart = productPage.goToCart();
assertTrue(cart.isProductInCart(product));
assertEquals(cart.getColor(product), color);
assertEquals(cart.getSize(product), size);
assertEquals(cart.getQuantity(product), quantity);
assertEquals(cart.getPrice(product), "₹100.00");
assertEquals(cart.getTotal(product), "₹200.00");
assertEquals(cart.getNumberOfItems, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment