forked from 47-studio-org/openlibrary
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_landing.py
45 lines (35 loc) · 1.4 KB
/
test_landing.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import pytest
from splinter import Browser
class TestLanding:
host = 'http://localhost:8080'
def login(self, browser_instance):
browser_instance.visit(self.host)
browser_instance.find_link_by_text('Log in').first.click()
browser_instance.fill('username', '[email protected]')
browser_instance.fill('password', 'openlibrary')
browser_instance.find_by_value('Log In').first.click()
@pytest.fixture
def browser(self):
browser = Browser('chrome')
yield browser
browser.quit()
def test_categories_carousel(self, browser):
url = self.host + '/'
browser.visit(url)
assert browser.is_element_present_by_css(".categoryCarousel")
def test_popular_carousel(self, browser):
url = self.host + '/'
browser.visit(url)
assert browser.is_element_present_by_css("#CarouselPopular")
def test_read_carousel(self, browser):
url = self.host + '/'
browser.visit(url)
assert browser.is_element_present_by_css("#read-carousel")
def test_return_carousel(self, browser):
url = self.host + '/'
browser.visit(url)
assert browser.is_element_present_by_css("#returncart_carousel")
def test_waitlist_carousel(self, browser):
url = self.host + '/'
browser.visit(url)
assert browser.is_element_present_by_css("#CarouselWaitlist")