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
def test_comparison_info_cart_vs_recommended_in_cart(self): module_cart = ModulePage(self.driver) header_cart = HeaderPage(self.driver) cart = CartPage(self.driver) self.driver.get(TEST_URL + project_page.get('cart')) page_info = cart.set_recommended_product_info() cart.click_first_buy_button_recommended() 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
def test_comparison_info_cart_vs_full_search(self): module_cart = ModulePage(self.driver) header_cart = HeaderPage(self.driver) cart = CartPage(self.driver) full_search_product = FullSearchProductPage(self.driver) self.driver.get(TEST_URL + project_page.get('full-search-product')) page_info = full_search_product.set_product_info() full_search_product.click_first_buy_button() full_search_product.click_first_in_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
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
def test_comparison_info_cart_vs_search(self): count = random.randint(0, 2) module_cart = ModulePage(self.driver) header_cart = HeaderPage(self.driver) cart = CartPage(self.driver) search = SearchPage(self.driver) self.driver.get(TEST_URL + project_page.get('search')) page_info = search.set_recomended_product_info(count) search.get_first_offers_buy_button[count].click() search.get_first_offers_in_cart_button[0].click() 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
def test_comparison_info_cart_vs_card_offers(self): count = random.randint(0, 1) 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_offers(count) card.get_first_offers_buy_button[count].click() card.click_offer_in_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
def test_comparison_info_cart_vs_you_watched(self): module_cart = ModulePage(self.driver) header_cart = HeaderPage(self.driver) cart = CartPage(self.driver) main = MainPage(self.driver) self.driver.get(TEST_URL + project_page.get('product_card_with_offers')) self.driver.get(TEST_URL) page_info = main.set_you_watched_product_info() main.click_first_buy_button_you_watched() main.click_first_in_cart_button_you_watched() 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