-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_main_page.py
28 lines (24 loc) · 1008 Bytes
/
test_main_page.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pytest
from pages.main_page import MainPage
from pages.login_page import LoginPage
from pages.cart_page import CartPage
@pytest.mark.login_guest
class TestLoginFromMainPage(object):
link = "http://selenium1py.pythonanywhere.com/ru/catalogue/the-shellcoders-handbook_209/"
def test_guest_can_go_to_login_page(self, browser):
page = MainPage(browser, self.link)
page.open()
page.go_to_login_page()
login_page = LoginPage(browser, browser.current_url)
login_page.should_be_login_page()
def test_guest_should_see_login_link(self, browser):
page = MainPage(browser, self.link)
page.open()
page.should_be_login_link()
def test_guest_cant_see_product_in_cart_opened_from_main_page(browser):
link = "http://selenium1py.pythonanywhere.com/"
page = MainPage(browser, link)
page.open()
page.go_to_cart_page()
cart_page = CartPage(browser, browser.current_url)
cart_page.should_see_no_products_in_the_cart()