Ejemplo n.º 1
0
 def test_cart_delete_item(self):
     header_cart = HeaderPage(self.driver)
     cart = CartPage(self.driver)
     card = CardPage(self.driver)
     module_cart = ModulePage(self.driver)
     self.driver.get(TEST_URL +
                     project_page.get('product_card_with_offers'))
     card.click_button_buy()
     header_cart.click_cart()
     module_cart.click_to_cart()
     # self.close_draggable(self.driver)
     cart.click_button_remove_item()
     assert header_cart.check_cart_without_items
Ejemplo n.º 2
0
 def test_cart_change_count_items(self, mode):
     header_cart = HeaderPage(self.driver)
     cart = CartPage(self.driver)
     card = CardPage(self.driver)
     module_cart = ModulePage(self.driver)
     self.driver.get(TEST_URL +
                     project_page.get('product_card_with_offers'))
     decrease = card.text_price
     increase = str(int(decrease[:-3]) * 2)
     card.click_button_buy()
     header_cart.click_cart()
     module_cart.click_to_cart()
     # self.close_draggable(self.driver)
     cart.click_button_plus()
     assert cart.check_field_digit_field_count('2')
     assert cart.check_sum_price(
         increase) if mode == 'sum' else cart.check_total_price(increase)
     cart.click_button_minus()
     assert cart.check_field_digit_field_count('1')
     assert cart.check_sum_price(
         decrease) if mode == 'sum' else cart.check_total_price(decrease)