Esempio n. 1
0
 def test_cart_in_header_add_from_card(self):
     header_cart = HeaderPage(self.driver)
     card = CardPage(self.driver)
     self.driver.get(TEST_URL +
                     project_page.get('product_card_with_offers'))
     card.click_button_buy()
     assert card.check_present_button_in_cart
     assert '1' == header_cart.text_digit_cart_header
     assert header_cart.text_cart_price in card.text_price
Esempio n. 2
0
 def test_module_cart_delete_item(self):
     module_cart = ModulePage(self.driver)
     header_cart = HeaderPage(self.driver)
     card = CardPage(self.driver)
     self.driver.get(TEST_URL +
                     project_page.get('product_card_with_offers'))
     card.click_button_buy()
     header_cart.click_cart()
     assert module_cart.check_cart_module_info_loaded('грн')
     module_cart.click_button_remove_item()
     assert header_cart.check_cart_without_items
Esempio n. 3
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
Esempio n. 4
0
 def test_auth_checkout_page(self):
     """Test 4"""
     header = HeaderPage(self.driver)
     card = CardPage(self.driver)
     module = ModulePage(self.driver)
     checkout = CheckoutPage(self.driver)
     self.driver.get(TEST_URL +
                     project_page.get('product_card_with_offers'))
     card.click_button_buy()
     assert header.text_digit_cart_header
     header.click_cart()
     module.click_module_button_order()
     self.wait_client_loader(self.driver)
     self.login_multi_checkout(self.driver)
     assert test_user.get(
         'multi_name').lower() in header.text_profile_user.lower()
     assert test_user.get(
         'multi_name').lower() in checkout.text_checkout_user_name.lower()
Esempio n. 5
0
 def test_comparison_info_cart_vs_card(self):
     module_cart = ModulePage(self.driver)
     header_cart = HeaderPage(self.driver)
     cart = CartPage(self.driver)
     card = CardPage(self.driver)
     self.driver.get(TEST_URL +
                     project_page.get('product_card_with_offers'))
     page_info = card.set_product_info()
     card.click_button_buy()
     card.click_to_cart_button()
     assert self.driver.current_url == (TEST_URL + project_page.get('cart'))
     cart_info = cart.set_product_info()
     # self.close_draggable(self.driver)
     header_cart.click_cart()
     assert module_cart.check_cart_module_info_loaded('грн')
     cart_module_info = module_cart.set_product_info()
     assert page_info == cart_info
     assert page_info == cart_module_info
Esempio n. 6
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)