def test_guest_cant_see_product_in_basket_opened_from_product_page(wd): link = "http://selenium1py.pythonanywhere.com/en-gb/catalogue/the-city-and-the-stars_95/" page = ProductPage(wd, link) page.open() page.go_to_basket_page() basket_page = BasketPage(wd, wd.current_url) basket_page.should_be_empty_basket() basket_page.should_be_massage_empty()
def test_user_cant_see_success_message(self, wd): link = 'http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/' page = ProductPage(wd, link, 0) page.open() page.should_not_be_success_message()
def test_guest_can_go_to_login_page_from_product_page(self, wd): link = "http://selenium1py.pythonanywhere.com/en-gb/catalogue/the-city-and-the-stars_95/" page = ProductPage(wd, link) page.open() page.go_to_login_page()
def test_guest_should_see_login_link_on_product_page(self, wd): link = "http://selenium1py.pythonanywhere.com/en-gb/catalogue/the-city-and-the-stars_95/" page = ProductPage(wd, link) page.open() page.should_be_login_link()
def test_message_disappeared_after_adding_product_to_basket(wd): link = 'http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/' page = ProductPage(wd, link, 0) page.open() page.add_product_to_cart() page.should_be_disappeared_success_message()
def test_guest_can_add_product_to_basket( wd, link='http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/?promo=offer0' ): try: page = ProductPage(wd, link, 5) page.open() page.check_promt_in_url() page.add_product_to_cart() page.solve_quiz_and_get_code() page.check_added_to_cart_item_name() page.check_cart_total_cost_after_adding() finally: time.sleep(1)