-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_post.py
99 lines (85 loc) · 3.22 KB
/
test_post.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
from BaseTest import BaseTest
import WPPost
# TestPost
# Written by Angela Korra'ti
# Last updated 7/6/2023
#
# This class conducts tests against a post on my test WordPress site.
class TestPost(BaseTest):
wp_post = None
wp_menu = None
def setup_method(self):
"""
Do setup for the test cases.
"""
super().setup_method()
self.driver.get(self.wp_lib.wp_post_uri)
self.wp_post = WPPost.WPPost(self.driver, self.wp_lib)
self.wp_menu = self.wp_post.wp_menu
def test_post_site_title(self):
"""
Verify that the post has the correct site title
"""
assert self.wp_post.site_title == self.wp_lib.site_title['text']
assert self.wp_post.site_title_element.is_displayed() is True
def test_post_site_description(self):
"""
Verify that the post has the correct site description
"""
assert self.wp_post.site_description == self.wp_lib.site_description['text']
assert self.wp_post.site_description_element.is_displayed() is True
def test_post_title(self):
"""
Verify that the post shows its correct title
"""
assert self.wp_post.post_title_text == self.wp_lib.post_title
assert self.wp_post.post_title_element.is_displayed() is True
def test_primary_menu_exists_visible(self):
"""
Verify that the primary menu is present and visible on the post
"""
menu = self.wp_menu.menu_element
assert menu is not None
assert menu.is_displayed()
def test_content_area(self):
"""
Verify that the overall content area is present and visible on the post
"""
content = self.wp_post.content_area_element
assert content is not None
assert content.is_displayed()
def test_primary_content_area_exists_visible(self):
"""
Verify that the primary content area is present and visible on the post
"""
content = self.wp_post.primary_content_area_element
assert content is not None
assert content.is_displayed()
def test_secondary_content_area_exists_visible(self):
"""
Verify that the secondary content area is present and visible on the post
"""
content = self.wp_post.secondary_content_area_element
assert content is not None
assert content.is_displayed()
def test_footer_exists_visible(self):
"""
Verify that the footer is present and visible on the post
"""
footer = self.wp_post.wp_footer.footer_element
assert footer is not None
assert footer.is_displayed()
def test_footer_social_menu_exists_visible(self):
"""
Verify that the footer social menu is present and visible on the post
"""
social_menu = self.wp_post.wp_footer.social_menu_element
assert social_menu is not None
assert social_menu.is_displayed()
def test_footer_site_info_exists_visible(self):
"""
Verify that the footer site info section is present and visible on the post
"""
site_info = self.wp_post.wp_footer.site_info_element
assert site_info is not None
assert site_info.is_displayed()