Skip to content

Commit bfae621

Browse files
ref test_su_02.03 Verifying text on the page
update start_unauthorized_page_test.py, start_unauthorized_page.py, start_unauthorized_page_data.py, start_unauthorized_page_locators.py, #209
1 parent a5cb230 commit bfae621

4 files changed

Lines changed: 64 additions & 16 deletions

File tree

locators/start_unauthorized_page_locators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ class StartUnauthorizedPageLocators:
1616
SECTION_1_FOURTH_LEVEL_ELEMENTS = (By.XPATH, "(//section)[1]/*/*/*/*")
1717
SECTION_2_FIRST_LEVEL_ELEMENTS = (By.XPATH, "(//section)[2]/*")
1818
SECTION_2_SECOND_LEVEL_ELEMENTS = (By.XPATH, "//div[contains(@class, 'm-auto')]/*")
19-
SECTION_2_TEXT = (By.XPATH, "//div[contains(@class, 'font')]")
19+
SECTION_2_TEXT = (By.XPATH, "(//div[contains(@class, 'font')])[position() <= 4]")
2020
SECTION_2_THIRD_LEVEL_ELEMENTS = (By.XPATH, "(//section)[2]/*//*//*")
21+
SECTION_3_TEXT = (By.XPATH, "(//div[contains(@class, 'font')])[5]")

pages/start_unauthorized_page.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ def get_list_of_titles(self):
8888

8989
@allure.step("Get the list of title values")
9090
def get_values_of_titles(self):
91-
titles = [title.text for title in self.get_list_of_titles()]
92-
print(*titles, len(titles), sep='\n')
93-
return titles
94-
# return [title.text for title in self.get_list_of_titles()]
91+
return [title.text for title in self.get_list_of_titles()]
9592

9693
@allure.step("Get the list of subtitles h4 on the page")
9794
def get_list_of_subtitles(self):
@@ -111,7 +108,15 @@ def get_list_of_elements_with_text_in_section2(self):
111108

112109
@allure.step("Get the list of text content in the section 2")
113110
def get_text_content_in_section2(self):
114-
return [element.text for element in self.get_list_of_elements_with_text_in_section2()]
111+
elements = self.get_list_of_elements_with_text_in_section2()
112+
elements_text = [element.text for element in elements]
113+
print(*elements_text, len(elements_text), sep='\n')
114+
return elements_text
115+
# return [element.text for element in self.get_list_of_elements_with_text_in_section2()]
116+
117+
@allure.step("Get the list of text content in the section 3")
118+
def get_text_content_in_section3(self):
119+
return self.get_text(self.locators.SECTION_3_TEXT)
115120

116121
@allure.step("Get text in the 'Login' link in the section 1")
117122
def get_text_in_login_link(self):

test_data/start_unauthorized_page_data.py

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ class StartUnauthorizedPageData:
2323
"text_in_section2": (
2424
"Тренируйтесь всего от 30 минут в день для развития и получения результата",
2525

26-
"Первая бесплатная онлайн программа для взрослых и детей с когнитивными проблемами восприятия речи. "
26+
"Первая бесплатная онлайн-программа для взрослых и детей с когнитивными проблемами восприятия речи. "
2727
"Все наши занятия рассчитаны на возраст детей от 7 лет и старше. "
28-
"Уже сейчас программа насчитывает более 20 разных тем по которым вы можете начать заниматься уже сейчас. "
29-
"А дальше будет еще больше - мы планируем постоянно расширять список наших тем.",
28+
"Уже сейчас программа насчитывает более 20 разных тем, по которым вы можете начать заниматься уже сейчас. "
29+
"А дальше будет еще больше мы планируем постоянно расширять список наших тем.",
3030

31-
"Мы хотели чтобы формат обучения был максимально удобным для каждого нашего пользователя. "
31+
"Мы хотели, чтобы формат обучения был максимально удобным для каждого нашего пользователя. "
3232
"Именно поэтому наши уроки доступны в любое время. "
33-
"Вы ожете сами выбрать в какое время вам заниматься и сформировать собственное расписание занятий.",
33+
"Вы можете сами выбрать в какое время вам заниматься, и сформировать собственное расписание занятий.",
3434

35-
"Занимаясь по нашей программе, вы сможете, развивать слух в различных акустических ситуациях; "
35+
"Занимаясь по нашей программе, вы сможете развивать слух в различных акустических ситуациях; "
3636
"тренировать слуховую память, прослушивая упражнения столько раз, сколько необходимо именно вам. "
37-
"А также, расширить словарный запас в интересной игровой форме и в дальшейшем использовать новые слова "
37+
"А также расширить словарный запас в интересной игровой форме и в дальнейшем использовать новые слова "
3838
"в общении с друзьями и знакомыми.",
3939

4040
"Train for just 30 minutes a day to develop and achieve results",
@@ -52,6 +52,44 @@ class StartUnauthorizedPageData:
5252
"train your auditory memory by listening to exercises as many times as you need. "
5353
"Additionally, you can expand your vocabulary in an engaging, "
5454
"game-like format and later use new words in conversations with friends and acquaintances."
55+
),
56+
57+
"text_in_section3": (
58+
"«Приложение BrainUP предназначено для слуховой тренировки у детей "
59+
"с центральными и периферическими нарушениями слуха. "
60+
"Актуальность его использования обусловлена тем, что даже при периферической тугоухости "
61+
"наблюдаются проблемы слухового анализа, в особенности у детей с сопутствующими нарушениями. "
62+
"Растет также распространенность заболеваний спектра аудиторных нейропатий, "
63+
"центральных слуховых расстройств, при которых коррекция слуха не может ограничиваться "
64+
"только использованием слуховых аппаратов или кохлеарных имплантов. "
65+
"Исследованиями показано, что систематический слуховой тренинг способствует улучшению различения звуков, "
66+
"распознавания речи в тишине и на фоне помехи, локализации звуков и других аспектов слуховой обработки. "
67+
"Дефицит русскоязычных программ для слуховой тренировки "
68+
"ограничивал возможности реабилитации таких пациентов. "
69+
"С появлением приложения BrainUP ситуация во многом улучшилась. "
70+
"BrainUP отличает простой и понятный интерфейс, "
71+
"ступенчатое усложнение заданий по мере прохождения предыдущего уровня, "
72+
"логика развития как речевого, так и неречевого слуха. "
73+
"Надеемся, что дальнейшее развитие приложения будет способствовать еще большим успехам наших пациентов!»",
74+
75+
"The BrainUP application is designed for auditory training in children "
76+
"with central and peripheral hearing impairments. "
77+
"The relevance of its use is due to the fact that even with peripheral hearing loss, "
78+
"problems of auditory analysis are observed, especially in children with concomitant disorders. "
79+
"The prevalence of auditory neuropathy spectrum disorders and central auditory processing disorders "
80+
"is also growing, in which hearing correction cannot be limited "
81+
"to the use of hearing aids or cochlear implants alone. "
82+
"Research has shown that systematic auditory training helps improve sound discrimination, "
83+
"speech recognition in quiet and in the presence of noise, sound localization, "
84+
"and other aspects of auditory processing. "
85+
"The lack of Russian-language programs for auditory training "
86+
"limited the rehabilitation options for such patients. "
87+
"With the advent of the BrainUP application, the situation has improved significantly. "
88+
"BrainUP features a simple and intuitive interface, "
89+
"gradual task complexity as previous levels are completed, "
90+
"and a logical development of both speech and non-speech hearing. "
91+
"We hope that the further development of the application will contribute to even greater success "
92+
"for our patients!"
5593
)
5694
}
5795

tests/start_unauthorized_page_test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,21 @@ def test_su_02_02_verify_page_titles_and_subtitles(self, driver, main_page_open)
8080
assert all(element in suPD.page_subtitles for element in subtitle_values), \
8181
"Subtitles mismatch any valid values"
8282

83-
@allure.title("Verify content of the text in sections 1, 2")
83+
@allure.title("Verify content of the text in sections 1, 2, 3")
8484
def test_su_02_03_verify_page_text(self, driver, main_page_open):
8585
page = suPage(driver)
8686
text_content_section1 = page.get_text_content_in_section1()
8787
text_content_section2 = page.get_text_content_in_section2()
88+
text_content_section3 = page.get_text_content_in_section3()
8889
assert text_content_section1, "Text content in the section 1 is empty"
8990
assert text_content_section1 in suPD.text_on_page["text_in_section1"], \
9091
"Text in the section 1 mismatches any valid values"
9192
assert text_content_section2, "The text content in the section 2 is empty"
92-
assert all(element in suPD.text_on_page["text_in_section2"]
93-
for element in text_content_section2), "Text in the section 2 mismatches any valid values"
93+
assert all(element in suPD.text_on_page["text_in_section2"] for element in text_content_section2), \
94+
"Text in the section 2 mismatches valid values"
95+
assert text_content_section3, "The text content in the section 3 is empty"
96+
assert text_content_section3 in suPD.text_on_page["text_in_section3"], \
97+
"Text in the section 3 mismatches any valid values"
9498

9599
@allure.title("Verify text in the 'Login' link in the section 1")
96100
def test_su_02_04_verify_text_in_links(self, driver, main_page_open):

0 commit comments

Comments
 (0)