Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion locators/start_unauthorized_page_locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ class StartUnauthorizedPageLocators:
SECTION_1_FOURTH_LEVEL_ELEMENTS = (By.XPATH, "(//section)[1]/*/*/*/*")
SECTION_2_FIRST_LEVEL_ELEMENTS = (By.XPATH, "(//section)[2]/*")
SECTION_2_SECOND_LEVEL_ELEMENTS = (By.XPATH, "//div[contains(@class, 'm-auto')]/*")
SECTION_2_TEXT = (By.XPATH, "//div[contains(@class, 'font')]")
SECTION_2_TEXT = (By.XPATH, "(//div[contains(@class, 'font')])[position() <= 4]")
SECTION_2_THIRD_LEVEL_ELEMENTS = (By.XPATH, "(//section)[2]/*//*//*")
SECTION_3_TEXT = (By.XPATH, "(//div[contains(@class, 'font')])[5]")
15 changes: 10 additions & 5 deletions pages/start_unauthorized_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ def get_list_of_titles(self):

@allure.step("Get the list of title values")
def get_values_of_titles(self):
titles = [title.text for title in self.get_list_of_titles()]
print(*titles, len(titles), sep='\n')
return titles
# return [title.text for title in self.get_list_of_titles()]
return [title.text for title in self.get_list_of_titles()]

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

@allure.step("Get the list of text content in the section 2")
def get_text_content_in_section2(self):
return [element.text for element in self.get_list_of_elements_with_text_in_section2()]
elements = self.get_list_of_elements_with_text_in_section2()
elements_text = [element.text for element in elements]
print(*elements_text, len(elements_text), sep='\n')
return elements_text
# return [element.text for element in self.get_list_of_elements_with_text_in_section2()]

@allure.step("Get the list of text content in the section 3")
def get_text_content_in_section3(self):
return self.get_text(self.locators.SECTION_3_TEXT)

@allure.step("Get text in the 'Login' link in the section 1")
def get_text_in_login_link(self):
Expand Down
52 changes: 45 additions & 7 deletions test_data/start_unauthorized_page_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ class StartUnauthorizedPageData:
"text_in_section2": (
"Тренируйтесь всего от 30 минут в день для развития и получения результата",

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

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

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

"Train for just 30 minutes a day to develop and achieve results",
Expand All @@ -52,6 +52,44 @@ class StartUnauthorizedPageData:
"train your auditory memory by listening to exercises as many times as you need. "
"Additionally, you can expand your vocabulary in an engaging, "
"game-like format and later use new words in conversations with friends and acquaintances."
),

"text_in_section3": (
"«Приложение BrainUP предназначено для слуховой тренировки у детей "
"с центральными и периферическими нарушениями слуха. "
"Актуальность его использования обусловлена тем, что даже при периферической тугоухости "
"наблюдаются проблемы слухового анализа, в особенности у детей с сопутствующими нарушениями. "
"Растет также распространенность заболеваний спектра аудиторных нейропатий, "
"центральных слуховых расстройств, при которых коррекция слуха не может ограничиваться "
"только использованием слуховых аппаратов или кохлеарных имплантов. "
"Исследованиями показано, что систематический слуховой тренинг способствует улучшению различения звуков, "
"распознавания речи в тишине и на фоне помехи, локализации звуков и других аспектов слуховой обработки. "
"Дефицит русскоязычных программ для слуховой тренировки "
"ограничивал возможности реабилитации таких пациентов. "
"С появлением приложения BrainUP ситуация во многом улучшилась. "
"BrainUP отличает простой и понятный интерфейс, "
"ступенчатое усложнение заданий по мере прохождения предыдущего уровня, "
"логика развития как речевого, так и неречевого слуха. "
"Надеемся, что дальнейшее развитие приложения будет способствовать еще большим успехам наших пациентов!»",

"The BrainUP application is designed for auditory training in children "
"with central and peripheral hearing impairments. "
"The relevance of its use is due to the fact that even with peripheral hearing loss, "
"problems of auditory analysis are observed, especially in children with concomitant disorders. "
"The prevalence of auditory neuropathy spectrum disorders and central auditory processing disorders "
"is also growing, in which hearing correction cannot be limited "
"to the use of hearing aids or cochlear implants alone. "
"Research has shown that systematic auditory training helps improve sound discrimination, "
"speech recognition in quiet and in the presence of noise, sound localization, "
"and other aspects of auditory processing. "
"The lack of Russian-language programs for auditory training "
"limited the rehabilitation options for such patients. "
"With the advent of the BrainUP application, the situation has improved significantly. "
"BrainUP features a simple and intuitive interface, "
"gradual task complexity as previous levels are completed, "
"and a logical development of both speech and non-speech hearing. "
"We hope that the further development of the application will contribute to even greater success "
"for our patients!"
)
}

Expand Down
10 changes: 7 additions & 3 deletions tests/start_unauthorized_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,21 @@ def test_su_02_02_verify_page_titles_and_subtitles(self, driver, main_page_open)
assert all(element in suPD.page_subtitles for element in subtitle_values), \
"Subtitles mismatch any valid values"

@allure.title("Verify content of the text in sections 1, 2")
@allure.title("Verify content of the text in sections 1, 2, 3")
def test_su_02_03_verify_page_text(self, driver, main_page_open):
page = suPage(driver)
text_content_section1 = page.get_text_content_in_section1()
text_content_section2 = page.get_text_content_in_section2()
text_content_section3 = page.get_text_content_in_section3()
assert text_content_section1, "Text content in the section 1 is empty"
assert text_content_section1 in suPD.text_on_page["text_in_section1"], \
"Text in the section 1 mismatches any valid values"
assert text_content_section2, "The text content in the section 2 is empty"
assert all(element in suPD.text_on_page["text_in_section2"]
for element in text_content_section2), "Text in the section 2 mismatches any valid values"
assert all(element in suPD.text_on_page["text_in_section2"] for element in text_content_section2), \
"Text in the section 2 mismatches valid values"
assert text_content_section3, "The text content in the section 3 is empty"
assert text_content_section3 in suPD.text_on_page["text_in_section3"], \
"Text in the section 3 mismatches any valid values"

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