6
6
from locators .groups_page_locators import GroupsPageLocators , HeaderLocators
7
7
from test_data .links import MainPageLinks as Links
8
8
9
- from selenium .webdriver .support .ui import WebDriverWait
10
- from selenium .webdriver .support import expected_conditions as ec
11
-
12
9
13
10
class GroupsPage (BasePage ):
14
11
locators = GroupsPageLocators
15
12
locators1 = HeaderLocators
16
13
17
- @allure .step ("Loader checking" )
18
- def loader_checking (self ):
19
- self .timeout = 50
20
- return WebDriverWait (self .driver , self .timeout ).until (
21
- ec .visibility_of_element_located (self .locators .PAGE_SUBTITLES ))
22
-
23
14
# Checking the structure and display of elements on the page
24
15
@allure .step ("Check if some content is present in DOM" )
25
16
def check_presence_of_page_content (self ):
@@ -76,17 +67,13 @@ def check_elements_visibility_on_5th_level(self):
76
67
77
68
@allure .step ("Get structure of the 6th level of nesting on the page" )
78
69
def get_structure_of_6th_level (self ):
79
- WebDriverWait (self .driver , 30 ).until (
80
- ec .presence_of_all_elements_located (self .locators .PAGE_SIXTH_LEVEL_ELEMENTS ))
81
70
elements = self .elements_are_present (self .locators .PAGE_SIXTH_LEVEL_ELEMENTS )
82
71
# tags = [element.tag_name for element in elements]
83
72
return elements
84
73
85
74
@allure .step ("Check if elements of the 6th level of nesting are visible" )
86
75
def check_elements_visibility_on_6th_level (self ):
87
76
elements = self .get_structure_of_6th_level ()
88
- for element in elements :
89
- WebDriverWait (self .driver , 10 ).until (ec .visibility_of (element ))
90
77
return all (element .is_displayed () for element in elements )
91
78
92
79
@allure .step ("Check the title h3 on the 2nd level of nesting is present on the page" )
@@ -107,16 +94,12 @@ def check_visibility_of_tiles(self):
107
94
108
95
@allure .step ("Get the list of images on the 6th level of nesting on the page" )
109
96
def get_list_of_images (self ):
110
- WebDriverWait (self .driver , 30 ).until (
111
- ec .presence_of_all_elements_located (self .locators .PAGE_IMAGES ))
112
97
elements = self .elements_are_present (self .locators .PAGE_IMAGES )
113
98
return elements
114
99
115
100
@allure .step ("Check if images on the 6th level of nesting are visible" )
116
101
def check_visibility_of_images (self ):
117
102
elements = self .get_list_of_images ()
118
- for element in elements :
119
- WebDriverWait (self .driver , 10 ).until (ec .visibility_of (element ))
120
103
return all (element .is_displayed () for element in elements )
121
104
122
105
@allure .step ("Get the list of subtitles on the 6th level of nesting on the page" )
@@ -168,7 +151,6 @@ def check_links_clickability(self):
168
151
@allure .step ("Get attribute 'title' of links on the 'ru' local" )
169
152
def get_links_titles_ru (self ):
170
153
elements = self .get_list_of_links ()
171
- # WebDriverWait(self.driver, 10).until(ec.visibility_of_all_elements_located(self.locators.PAGE_IMAGES))
172
154
return [element .get_attribute ('title' ) for element in elements ]
173
155
174
156
@allure .step ("Get attribute 'title' of links on the 'en' local" )
@@ -228,7 +210,6 @@ def get_images_src(self):
228
210
@allure .step ("Get the list of attribute 'alt' values of images in links on the 'ru' local" )
229
211
def get_images_alt_ru (self ):
230
212
elements = self .get_list_of_images ()
231
- WebDriverWait (self .driver , 10 ).until (ec .visibility_of_all_elements_located (self .locators .PAGE_IMAGES ))
232
213
return [element .get_attribute ('alt' ) for element in elements ]
233
214
234
215
@allure .step ("Get the list of attribute 'alt' values of images in links on the 'en' local" )
@@ -238,8 +219,6 @@ def get_images_alt_en(self):
238
219
@allure .step ("Get the list of sizes of images in links" )
239
220
def get_images_sizes (self ):
240
221
elements = self .get_list_of_images ()
241
- for element in elements :
242
- WebDriverWait (self .driver , 10 ).until (ec .visibility_of (element ))
243
222
return [element .size for element in elements ]
244
223
245
224
@allure .step ("Check changes of images sizes after resizing" )
0 commit comments