def test_guest_cant_see_product_in_basket_opened_from_product_page(self, browser): page = ProductPage(browser, link) page.open() page.go_to_basket_page() basket_page = BasketPage(browser, browser.current_url) basket_page.should_be_empty_basket()
def test_guest_cant_see_product_in_basket_opened_from_main_page( self, browser): # Arrange page = MainPage(browser, link) page.open() # Act page.go_to_basket_page() basket_page = BasketPage(browser, browser.current_url) # Assert basket_page.should_be_empty_basket()
def test_user_can_delete_product_from_basket(self, browser): # Arrange page = ProductCatalogPage(browser, link) page.open() page.select_product() page.go_to_basket_page() basket_page = BasketPage(browser, browser.current_url) #Act basket_page.delete_item_from_basket() #Assert basket_page.should_not_be_goods_in_basket() basket_page.should_not_be_basket_total_info() basket_page.should_not_be_checkout_btn_in_busket()
def test_user_should_see_empty_bucket(self, browser): # Act basket_page = BasketPage(browser) basket_page.click_button_remove() # Assert basket_page.should_be_success_message() basket_page.is_message_about_an_empty_bucket_present()
def test_user_should_see_page_checkout(self, browser): # Act basket_page = BasketPage(browser) basket_page.click_button_proceed_to_checkout() # Assert basket_page.should_be_shipping_payment_form() basket_page.user_should_see_header_message()
def test_guest_can_delete_the_item_added_to_the_carte(self, browser): # Arrange page = CatalogPage(browser, self.catalog_link) page.open() first_name_product = page.first_name_product_text() page.add_to_basket_product_from_catalog_page() page.go_to_basket_via_alert_from_catalog_page() basket_page = BasketPage(browser, browser.current_url) # Act basket_page.delete_item_in_basket() # Assert basket_page.should_not_be_message_item_in_the_cart() basket_page.should_be_no_deleted_item_in_the_cart()
def test_user_can_go_to_basket_from_account_page(self, browser, language): #Act self.account_page.go_to_basket_page() basket_page = BasketPage(browser, browser.current_url) #Assert basket_page.should_be_basket_url() basket_page.should_be_basket_header(language)
def test_guest_can_go_to_cart_via_notification_from_catalog_page(self, browser): # Arrange page = CatalogPage(browser, self.catalog_link) # Act page.open() first_price_product = page.first_price_product_text() first_name_product = page.first_name_product_text() page.add_to_basket_product_from_catalog_page() page.go_to_basket_via_alert_from_catalog_page() basket_page = BasketPage(browser, browser.current_url) # Assert basket_page.should_be_message_item_in_the_cart() basket_page.check_price_added_item_basket_page(first_price_product) basket_page.check_name_added_item_basket_page(first_name_product)
def test_guest_cant_see_product_in_basket_opened_from_product_page( self, browser): page = ProductPage(browser, ProductPage.LINK) page.open() page.go_to_basket_page() basket_page = BasketPage(browser, browser.current_url) basket_page.should_be_no_products_in_basket() basket_page.should_be_text_basket_is_empty()
def test_user_can_use_discount(self, browser): # Arrange page = ProductCatalogPage(browser, link) page.open() page.select_product() page.go_to_basket_page() #Act basket_page = BasketPage(browser, browser.current_url) basket_page.should_be_discount_input_form() # Assert basket_page.should_be_success_applying_discount()
def setup(self, browser): # Data test_user_email = "*****@*****.**" test_user_password = "******" # Arrange login_page = LoginPage(browser) login_page.open() login_page.user_login(test_user_email, test_user_password) basket_page = BasketPage(browser) basket_page.open() basket_page.user_clear_basket() product_page = ProductPage(browser, self.test_product_link) product_page.open() product_page.click_button_add_to_basket() product_page.click_button_view_basket()