Esempio n. 1
0
 def test_guest_cant_see_product_in_basket_opened_from_main_page(self, browser):
     link = "http://selenium1py.pythonanywhere.com/en-gb/catalogue/the-city-and-the-stars_95/"
     page = MainPage(browser, link)
     page.open()
     page.go_to_basket_page()
     basket_page = BasketPage(browser, browser.current_url)
     basket_page.should_be_empty()
Esempio n. 2
0
def test_guest_cant_see_product_in_cart_opened_from_main_page(browser):
    page = MainPage(browser, link)
    page.open()
    page.go_to_cart_page()
    cart_page = CartPage(browser, browser.current_url)
    cart_page.cart_is_empty()
    cart_page.empty_cart_subtitle()
Esempio n. 3
0
 def test_guest_can_go_to_login_page(self, browser):
     link = "http://selenium1py.pythonanywhere.com/"
     page = MainPage(browser, link)
     page.open()
     page.should_be_login_link()
     page.go_to_login_page()
     login_page = LoginPage(browser, browser.current_url)
     login_page.should_be_login_page()
Esempio n. 4
0
def test_open_main_page(browser, base_url, generate_env):
    mp = MainPage(browser)
    with allure.step("Открываем главную страницу"):
        mp.open(base_url, mp.path)
    mp.logger.info("Сравниваем заголовок страницы с эталоном")
    with allure.step("Проверяем заголовок"):
        assert mp.get_title() == 'Your Store'
    with allure.step("Проверяем ссылку на OpenCart"):
        assert mp.get_link_powered_by_text() == 'OpenCart'
 def setup(self, browser):
     link = "http://selenium1py.pythonanywhere.com/"
     page = MainPage(browser, link)
     page.open()
     page.go_to_login_page()
     login_page = LoginPage(browser, browser.current_url)
     login_page.register_new_user(email=str(time.time()) + "@fakemail.org",
                                  password='******')
     login_page.should_be_authorized_user()
Esempio n. 6
0
def test_main_page(browser, base_url):
    mp = MainPage(browser)
    with allure.step("Открываем главную страницу"):
        mp.open(base_url, mp.path)
    with allure.step("Проверяем наличие карусели товаров"):
        assert mp.get_main_carousel()
    with allure.step("Проверяем наличие логотипа"):
        assert mp.get_logo()
    with allure.step("Проверяем наличие строки поиска"):
        assert mp.get_search_field()
    with allure.step("Проверяем наличие заголовка товаров"):
        assert mp.get_head_featured_goods()
    with allure.step("Проверяем наличие товаров"):
        assert mp.get_featured_goods()
Esempio n. 7
0
 def test_guest_can_go_to_login_page(self, browser):
     page = MainPage(browser, link)
     page.open()
     page.go_to_login_page()
     login_page = LoginPage(browser, browser.current_url)
     login_page.should_be_login_page()
Esempio n. 8
0
def test_guest_cant_see_product_in_basket_opened_from_main_page(browser):
    page = MainPage(browser, link)
    page.open()
    page.go_to_cart()
    basket_page = BasketPage(browser, browser.current_url)
    basket_page.should_be_empty_basket()
Esempio n. 9
0
 def test_guest_should_see_login_link(self, browser):
     page = MainPage(browser, link)
     page.open()
     page.should_be_login_link()