def test_guest_cant_see_success_message_after_adding_product_to_basket(
        browser):
    link = "http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/"
    page = ProductPage(browser, link)
    page.open()
    page.product_add_to_cart()
    page.should_not_be_success_message()
def test_guest_can_go_to_login_page_from_product_page(browser):
    link = "http://selenium1py.pythonanywhere.com/en-gb/catalogue/the-city-and-the-stars_95/"
    page = ProductPage(browser, link)
    page.open()
    page.go_to_login_page()
    login_page = LoginPage(browser, browser.current_url)
    login_page.should_be_login_page()
def test_guest_cant_see_product_in_basket_opened_from_product_page(browser):
    link = "http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/"
    page = ProductPage(browser, link)
    page.open()
    page.go_to_basket()
    basket_page = BasketPage(browser, browser.current_url)
    basket_page.should_be_basket_page()
    basket_page.basket_should_not_have_items()
    basket_page.empty_basket_should_have_message()
def test_guest_can_add_product_to_basket(browser, link):
    page = ProductPage(browser, link)
    page.open()
    page.product_add_to_cart()
    page.solve_quiz_and_get_code()
    page.product_should_be_added_to_cart()
 def test_user_cant_see_success_message(self):
     link = "http://selenium1py.pythonanywhere.com/catalogue/coders-at-work_207/"
     page = ProductPage(self.browser, link)
     page.open()
     page.should_be_authorized_user()
     page.should_not_be_success_message()
 def test_user_can_add_product_to_basket(self, link):
     page = ProductPage(self.browser, link)
     page.open()
     page.should_be_authorized_user()
     page.product_add_to_cart()
     page.solve_quiz_and_get_code()
     page.product_should_be_added_to_cart()
def test_guest_should_see_login_link_on_product_page(browser):
    link = "http://selenium1py.pythonanywhere.com/en-gb/catalogue/the-city-and-the-stars_95/"
    page = ProductPage(browser, link)
    page.open()
    page.should_be_login_link()