Skip to content

Commit 659ea8d

Browse files
Merge pull request #622 from Brain-up/issue_478
Issue_478_EXERCISES_SIMILAR_PHRASES_RU_PAGE_data
2 parents 241cf19 + 565e877 commit 659ea8d

File tree

7 files changed

+100
-105
lines changed

7 files changed

+100
-105
lines changed

locators/exercises_ru_words_page_locators.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,3 @@ class ExercisesRuWordsPageLocators:
2424
PAGE_LIST3_4 = (By.XPATH, '(//div[contains(@class, "series-page")]//a)[4]')
2525
# PAGE_LIST3 = (By.XPATH, "//main//div/a")
2626
CARD_IMAGES_LIST4 = (By.XPATH, '//div[contains(@style, "svg")]')
27-
28-
29-
class HeaderLocators:
30-
RU_BUTTON = (By.XPATH, "(//span/button)[1]")

pages/exercises_ru_similar_phrases_page.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ def check_list2_visibility(self):
9393
return self.element_is_visible(self.locators.PAGE_LIST2)
9494

9595
@allure.step("Check the list3 on the 5th level of nesting is present on the page")
96-
def get_list3_of_subgroup_links(self):
96+
def get_list3_of_series_links(self):
9797
return self.elements_are_present(self.locators.PAGE_LIST3)
9898

9999
@allure.step("Check the list3 is visible")
100100
def check_list3_visibility(self):
101-
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())
102102

103103
@allure.step("Check the list4 on the 6th level of nesting is present on the page")
104104
def get_list4_of_links(self):
@@ -122,9 +122,9 @@ def get_value_of_breadcrumbs(self):
122122
def get_group_links_text(self):
123123
return [element.text for element in self.get_list2_of_group_links()]
124124

125-
@allure.step("Get text in subgroup links on the page")
126-
def get_subgroup_links_text(self):
127-
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()]
128128

129129
# Checking links on the page
130130
@allure.step("Check if breadcrumbs are clickable")
@@ -154,18 +154,18 @@ def get_group_link_active_links(self):
154154
# print(len(group_link_active_links), *group_link_active_links, sep='\n')
155155
return [el.get_attribute("data-test-active-link") for el in self.get_list2_of_group_links()]
156156

157-
@allure.step("Check if subgroup links are clickable")
158-
def check_subgroup_links_clickability(self):
159-
return all(link.is_enabled() for link in self.get_list3_of_subgroup_links())
157+
@allure.step("Check if series links are clickable")
158+
def check_series_links_clickability(self):
159+
return all(link.is_enabled() for link in self.get_list3_of_series_links())
160160

161-
@allure.step("Get attribute 'href' of subgroup links")
162-
def get_subgroup_links_href(self):
163-
# print(len(subgroup_links_href), *subgroup_links_href, sep='\n')
164-
return [element.get_attribute("href") for element in self.get_list3_of_subgroup_links()]
161+
@allure.step("Get attribute 'href' of series links")
162+
def get_series_links_href(self):
163+
# print(len(series_links_href), *series_links_href, sep='\n')
164+
return [element.get_attribute("href") for element in self.get_list3_of_series_links()]
165165

166-
@allure.step("Get status code of subgroup links")
167-
def get_subgroup_link_status_codes(self):
168-
return [requests.head(link_href).status_code for link_href in self.get_subgroup_links_href()]
166+
@allure.step("Get status code of series links")
167+
def get_series_link_status_codes(self):
168+
return [requests.head(link_href).status_code for link_href in self.get_series_links_href()]
169169

170170
@allure.step("Click on breadcrumbs links and thereby open corresponding web pages in the same tab")
171171
def click_on_breadcrumbs_links(self):
@@ -194,15 +194,15 @@ def click_on_group_links(self):
194194

195195
return opened_pages
196196

197-
@allure.step("""Click on subgroup links and thereby open corresponding web pages in the same tab""")
198-
def click_on_subgroup_links(self):
199-
subgroup_locators = [self.locators.PAGE_LIST3_1, self.locators.PAGE_LIST3_2,
200-
self.locators.PAGE_LIST3_3, self.locators.PAGE_LIST3_4,
201-
self.locators.PAGE_LIST3_5, self.locators.PAGE_LIST3_6]
197+
@allure.step("""Click on series links and thereby open corresponding web pages in the same tab""")
198+
def click_on_series_links(self):
199+
series_locators = [self.locators.PAGE_LIST3_1, self.locators.PAGE_LIST3_2,
200+
self.locators.PAGE_LIST3_3, self.locators.PAGE_LIST3_4,
201+
self.locators.PAGE_LIST3_5, self.locators.PAGE_LIST3_6]
202202
group_page_url = self.get_current_tab_url()
203203
opened_pages = []
204204

205-
for link_locator in subgroup_locators:
205+
for link_locator in series_locators:
206206
self.element_is_clickable(link_locator).click()
207207
Wait(self.driver, self.timeout).until(EC.url_changes(group_page_url))
208208
opened_pages.append(self.get_current_tab_url())
@@ -222,7 +222,7 @@ def get_links_style(self):
222222
@allure.step("Get the list of sizes of background-images in links")
223223
def get_images_sizes(self):
224224
images_size = [image.size for image in self.get_list4_of_links()]
225-
print(len(images_size), *images_size, sep='\n')
225+
# print(len(images_size), *images_size, sep='\n')
226226
return images_size
227227

228228
@allure.step("Check changes of images sizes after resizing")

pages/exercises_ru_words_page.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
from selenium.webdriver.support import expected_conditions as EC
55
from selenium.webdriver.support.wait import WebDriverWait as Wait
66
from 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

1010
class 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())

test_data/exercises_ru_pages_data.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ class ExercisesRuPagesData:
2626
group_link_active_links = ('Слова', 'Слова Королёвой', 'Похожие фразы', 'Группа слов', 'Предложения',
2727
'Слова с частотной группировкой')
2828

29-
# subgroup links data
29+
# series links data
3030
s = 'background-image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/'
3131
e = '.svg");'
3232

33-
subgroup_links_style_similar_phrases_ru = (
33+
series_links_style_similar_phrases_ru = (
3434
f"{s}longShortPhrases{e}", f"{s}noPhrases{e}", f"{s}similarPhrases{e}", f"{s}differentEndPhrases{e}",
3535
f"{s}shortWords{e}", f"{s}prepositionPhrases{e}")
3636

37-
subgroup_links_text_similar_phrases_ru = (
37+
series_links_text_similar_phrases_ru = (
3838
'Разной длительности', 'С частицей Не', 'Похожие', 'С разным окончанием', 'Из коротких слов',
3939
'С разными предлогами')
4040

41-
subgroup_links_style_words_ru = (
41+
series_links_style_words_ru = (
4242
f"{s}family{e}", f"{s}home{e}", f"{s}food{e}", f"{s}clothes{e}", f"{s}school{e}", f"{s}math{e}", f"{s}pets{e}",
4343
f"{s}animals{e}", f"{s}transport{e}", f"{s}colors{e}", f"{s}city{e}", f"{s}country{e}", f"{s}walk{e}",
4444
f"{s}weather{e}", f"{s}future{e}", f"{s}body{e}", f"{s}game{e}", f"{s}adventure{e}", f"{s}hospital{e}",
@@ -49,7 +49,7 @@ class ExercisesRuPagesData:
4949
f"{s}stationery{e}", f"{s}flowers{e}", f"{s}literature{e}", f"{s}physics{e}", f"{s}biology{e}",
5050
f"{s}instruments{e}")
5151

52-
subgroup_links_text_words_ru = (
52+
series_links_text_words_ru = (
5353
'Семья', 'Любимый дом', 'Что я ем', 'Одежда', 'В школе', 'Математика', 'Домашние питомцы', 'Мир животных',
5454
'Транспорт', 'Цвета и форма', 'В городе', 'В деревне', 'На прогулке', 'Погода', 'Стану кем хочу',
5555
'Тело человека', 'Развлечения', 'Путешествия', 'В больнице', 'Что я чувствую', 'Игрушки', 'Насекомые',
@@ -58,7 +58,7 @@ class ExercisesRuPagesData:
5858
'Растения', 'Деревья и кустарники', 'Спорт', 'В магазине', 'Парнокопытные', 'Породы собак',
5959
'Канцелярские принадлежности', 'Цветы', 'Русский язык и литература', 'Физика', 'Биология', 'Инструменты')
6060

61-
subgroup_links_titles_words_ru = (
61+
series_links_titles_words_ru = (
6262
'Слова про семью', 'Слова про дом', 'Слова о еде', 'Слова об одежде', 'Слова о школе и учёбе',
6363
'Математика и её термины', 'Слова о домашних питомцах', 'Слова о животных', 'Слова о транспорте',
6464
'Слова о понятиях цета и формы', 'Слова о жизни города', 'Слова из деревенской жизни', 'Слова о прогулке',

test_data/links.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ class ExercisesUrls:
2929
breadcrumbs_urls_ru_similar_phrases = breadcrumbs_urls_ru + (URL_EXERCISES_RU_SIMILAR_PHRASES_PAGE,)
3030

3131
b = f"{URL_EXERCISES_RU_SIMILAR_PHRASES_PAGE}/subgroup/"
32-
subgroup_link_urls_ru_similar_phrases = (f"{b}60", f"{b}61", f"{b}62", f"{b}63", f"{b}64", f"{b}65")
32+
series_link_urls_ru_similar_phrases = (f"{b}60", f"{b}61", f"{b}62", f"{b}63", f"{b}64", f"{b}65")
3333

3434
# Speech Exercises RU > Words
3535
URL_EXERCISES_RU_WORDS_PAGE = f"{STARTING_POINT}/2/series/1"
3636

3737
breadcrumbs_urls_ru_words = breadcrumbs_urls_ru + (URL_EXERCISES_RU_WORDS_PAGE,)
3838

3939
c = f"{URL_EXERCISES_RU_WORDS_PAGE}/subgroup/"
40-
subgroup_link_urls_ru_words = (
40+
series_link_urls_ru_words = (
4141
f"{c}1", f"{c}2", f"{c}3", f"{c}4", f"{c}5", f"{c}6", f"{c}7", f"{c}8", f"{c}9", f"{c}10", f"{c}11", f"{c}12",
4242
f"{c}13", f"{c}14", f"{c}15", f"{c}16", f"{c}17", f"{c}18", f"{c}19", f"{c}20", f"{c}21", f"{c}22", f"{c}23",
4343
f"{c}24", f"{c}25", f"{c}26", f"{c}27", f"{c}28", f"{c}29", f"{c}30", f"{c}31", f"{c}32", f"{c}33", f"{c}34",

0 commit comments

Comments
 (0)