44from selenium .webdriver .support import expected_conditions as EC
55from selenium .webdriver .support .wait import WebDriverWait as Wait
66from pages .base_page import BasePage
7- from locators .exercises_ru_words_page_locators import ExercisesRuWordsPageLocators , HeaderLocators
7+ from locators .exercises_ru_words_page_locators import ExercisesRuWordsPageLocators
88
99
1010class ExercisesRuWordsPage (BasePage ):
1111 locators = ExercisesRuWordsPageLocators
12- locators1 = HeaderLocators
1312
1413 # Checking the structure and display of elements on the page
1514 @allure .step ("Check if some content is present in DOM" )
@@ -94,12 +93,12 @@ def check_list2_visibility(self):
9493 return all (element .is_displayed () for element in self .get_list2_of_group_links ())
9594
9695 @allure .step ("Check the list3 on the 5th level of nesting is present on the page" )
97- def get_list3_of_subgroup_links (self ):
96+ def get_list3_of_series_links (self ):
9897 return self .elements_are_present (self .locators .PAGE_LIST3 )
9998
10099 @allure .step ("Check the list3 is visible" )
101100 def check_list3_visibility (self ):
102- return all (element .is_displayed () for element in self .get_list3_of_subgroup_links ())
101+ return all (element .is_displayed () for element in self .get_list3_of_series_links ())
103102
104103 @allure .step ("Check the list4 on the 6th level of nesting is present on the page" )
105104 def get_list4_of_links (self ):
@@ -123,9 +122,9 @@ def get_value_of_breadcrumbs(self):
123122 def get_group_links_text (self ):
124123 return [element .text for element in self .get_list2_of_group_links ()]
125124
126- @allure .step ("Get text in subgroup links on the page" )
127- def get_subgroup_links_text (self ):
128- return [element .text for element in self .get_list3_of_subgroup_links ()]
125+ @allure .step ("Get text in series links on the page" )
126+ def get_series_links_text (self ):
127+ return [element .text for element in self .get_list3_of_series_links ()]
129128
130129 # Checking links on the page
131130 @allure .step ("Check if breadcrumbs are clickable" )
@@ -152,22 +151,22 @@ def get_group_link_titles(self):
152151 def get_group_link_active_links (self ):
153152 return [el .get_attribute ("data-test-active-link" ) for el in self .get_list2_of_group_links ()]
154153
155- @allure .step ("Check if subgroup links are clickable" )
156- def check_subgroup_links_clickability (self ):
157- return all (link .is_enabled () for link in self .get_list3_of_subgroup_links ())
154+ @allure .step ("Check if series links are clickable" )
155+ def check_series_links_clickability (self ):
156+ return all (link .is_enabled () for link in self .get_list3_of_series_links ())
158157
159- @allure .step ("Get attribute 'title' of subgroup links" )
160- def get_subgroup_link_titles (self ):
161- return [element .get_attribute ("title" ) for element in self .get_list3_of_subgroup_links ()]
158+ @allure .step ("Get attribute 'title' of series links" )
159+ def get_series_link_titles (self ):
160+ return [element .get_attribute ("title" ) for element in self .get_list3_of_series_links ()]
162161
163- @allure .step ("Get attribute 'href' of subgroup links" )
164- def get_subgroup_links_href (self ):
165- # print(len(subgroup_links_href ), *subgroup_links_href , sep='\n')
166- return [element .get_attribute ("href" ) for element in self .get_list3_of_subgroup_links ()]
162+ @allure .step ("Get attribute 'href' of series links" )
163+ def get_series_links_href (self ):
164+ # print(len(series_links_href ), *series_links_href , sep='\n')
165+ return [element .get_attribute ("href" ) for element in self .get_list3_of_series_links ()]
167166
168- @allure .step ("Get status code of subgroup links" )
169- def get_subgroup_link_status_codes (self ):
170- return [requests .head (link_href ).status_code for link_href in self .get_subgroup_links_href ()]
167+ @allure .step ("Get status code of series links" )
168+ def get_series_link_status_codes (self ):
169+ return [requests .head (link_href ).status_code for link_href in self .get_series_links_href ()]
171170
172171 @allure .step ("Click on breadcrumbs links and thereby open corresponding web pages in the same tab" )
173172 def click_on_breadcrumbs_links (self ):
@@ -197,14 +196,14 @@ def click_on_group_links(self):
197196
198197 return opened_pages
199198
200- @allure .step ("""Click on subgroup links and thereby open corresponding web pages in the same tab""" )
201- def click_on_subgroup_links (self ):
202- subgroup_locators = [self .locators .PAGE_LIST3_1 , self .locators .PAGE_LIST3_2 ,
203- self .locators .PAGE_LIST3_3 , self .locators .PAGE_LIST3_4 ]
199+ @allure .step ("""Click on series links and thereby open corresponding web pages in the same tab""" )
200+ def click_on_series_links (self ):
201+ series_locators = [self .locators .PAGE_LIST3_1 , self .locators .PAGE_LIST3_2 ,
202+ self .locators .PAGE_LIST3_3 , self .locators .PAGE_LIST3_4 ]
204203 group_page_url = self .get_current_tab_url ()
205204 opened_pages = []
206205
207- for link_locator in subgroup_locators :
206+ for link_locator in series_locators :
208207 self .element_is_clickable (link_locator ).click ()
209208 Wait (self .driver , self .timeout ).until (EC .url_changes (group_page_url ))
210209 opened_pages .append (self .get_current_tab_url ())
0 commit comments