def test_can_proceed_to_sign_in(self, browser):
     """proceed to sign in from shopping cart"""
     home_page = HomePage(browser)
     home_page.add_product_to_cart(3)  # add product No3 on home page to cart
     summary = CartSummary(browser)
     summary.go_to_checkout()  # click 'Go to checkout' in the short cart summary
     shopping_cart = ShoppingCart(browser)
     shopping_cart.proceed_to_sign_in()  # click 'Proceed to sign in' on the shopping cart page
 def test_can_see_product_in_shopping_cart(self, browser):
     """add product to cart"""
     home_page = HomePage(browser)  # open home page
     name = home_page.get_product_name(2)  # get the name of product No2 on home page
     home_page.add_product_to_cart(2)  # add product No2 to cart by clicking add to cart
     summary = CartSummary(browser)
     summary.go_to_checkout()  # click go to checkout in cart short summary
     shopping_cart = ShoppingCart(browser)
     shopping_cart.product_should_be_in_cart(name)  # check if the name of product is the same in the cart
Beispiel #3
0
 def test_guest_can_add_product_to_cart_from_home_page(self, browser):
     """add a product to the cart from home page"""
     home_page = HomePage(browser)
     name = home_page.get_product_name(1)  # get product No1 name
     home_page.add_product_to_cart(
         1)  # hover over product area and click "add to cart"
     summary = CartSummary(browser)
     # check if names match with short cart summary and count is as expected
     # takes expected product name argument and expected count
     summary.product_is_added_to_cart(name, 1)
     summary.close_cart_summary()  # click "close" on short cart summary
     home_page = HomePage(browser)
     home_page.number_of_products_in_cart_should_be_as_expected(
         1)  # compare number of items in cart with expected