From 2b95e2f36847b4afadcaa0e51910267eb5e473df Mon Sep 17 00:00:00 2001 From: Alena Krauch Date: Wed, 16 Apr 2025 22:56:02 +0300 Subject: [PATCH] update specialists_page_test.py, specialists_page_data.py, start_unauthorized_page_data.py --- test_data/specialists_page_data.py | 49 +++++++++-------------- test_data/start_unauthorized_page_data.py | 8 ++-- tests/specialists_page_test.py | 14 +++---- 3 files changed, 31 insertions(+), 40 deletions(-) diff --git a/test_data/specialists_page_data.py b/test_data/specialists_page_data.py index 9f51535201..dead402dca 100644 --- a/test_data/specialists_page_data.py +++ b/test_data/specialists_page_data.py @@ -3,25 +3,23 @@ class SpecialistsPageData: - tab_title = ["Специалисты | BrainUp", "Specialists | BrainUp"] + tab_title = ("Специалисты | BrainUp", "Specialists | BrainUp") - page_title = ["Специалисты", "Specialists"] + page_title = ("Специалисты", "Specialists") - text_on_page = ["Обучающая программа BrainUp разработана совместно с лучшими специалистами " + text_on_page = ("Обучающая программа BrainUp разработана совместно с лучшими специалистами " "в области сурдопедагогики из России и Беларуси", "The BrainUp training program was developed jointly with the best specialists " - "in the field of deaf education from Russia and Belarus"] + "in the field of deaf education from Russia and Belarus") - specialists_names = [ - ["Гарбарук Екатерина Сергеевна", "Прошина Любовь Александровна", "Березкина Ксения Сергеевна", - "Метельская Наталья Николаевна", "Королева Инна Васильевна", "Юлия Кибалова", "Платоненко Дарья Сергеевна", - "Сивенкова Кристина Александровна"], - ["Ekaterina Garbaruk", "Lubov Proshina", "Ksenia Berezkina", "Natalia Metelskaya", "Inna Koroleva", - "Yulia Kibalova", "Daria Platonenko", "Kristina Sivenkova"] - ] + specialists_names = ("Гарбарук Екатерина Сергеевна", "Прошина Любовь Александровна", "Березкина Ксения Сергеевна", + "Метельская Наталья Николаевна", "Королева Инна Васильевна", "Юлия Кибалова", + "Платоненко Дарья Сергеевна", "Сивенкова Кристина Александровна", + "Ekaterina Garbaruk", "Lubov Proshina", "Ksenia Berezkina", "Natalia Metelskaya", + "Inna Koroleva", "Yulia Kibalova", "Daria Platonenko", "Kristina Sivenkova") - specialists_professions = [ - ["Кандидат биологических наук, специалист Лаборатории слуха и речи ПСПбГМУ, специалист " + specialists_professions = ( + "Кандидат биологических наук, специалист Лаборатории слуха и речи ПСПбГМУ, специалист " "в области диагностики слуховых нарушений", "Сурдопедагог, РНПЦ оториноларингологии, опыт работы более 10 лет", "Сурдопедагог, Городской ресурсный центр для детей с нарушением слуха, опыт работы более 10 лет", @@ -30,8 +28,8 @@ class SpecialistsPageData: 'автор серии методических пособий "Учусь слушать и говорить"', "Сурдопедагог, дефектолог, Лаборатория слуха и речи ПСПбГМУ, опыт работы более 10 лет", "Сурдопедагог, РНПЦ оториноларингологии, опыт работы более 3 лет", - "Сурдопедагог, СПб Сурдоцентр, молодой специалист"], - ["Candidate of Biological Sciences, expert at the Laboratory of Hearing and Speech " + "Сурдопедагог, СПб Сурдоцентр, молодой специалист", + "Candidate of Biological Sciences, expert at the Laboratory of Hearing and Speech " "(The Pavlov First Saint Petersburg State Medical University), expert in diagnosis of aural disorders", "Teacher of the deaf, Belarusian Republican Scientific and Practical Center of Otorhinolaryngology, " "10+ years of experience", @@ -43,25 +41,18 @@ class SpecialistsPageData: "(The Pavlov First Saint Petersburg State Medical University), 10+ years of experience", "Teacher of the deaf, Belarusian Republican Scientific and Practical Center of Otorhinolaryngology, " "3+ years of experience", - "Teacher of the deaf, Saint Petersburg Center of Otorhinolaryngology, young professional"] - ] + "Teacher of the deaf, Saint Petersburg Center of Otorhinolaryngology, young professional") - all_specialists_link_text = ["Все Специалисты", "All Specialists"] + all_specialists_link_text = ("Все Специалисты", "All Specialists") all_specialists_link_href = f"{Links.URL_MAIN_PAGE}specialists#" - all_specialists_link_status_code = 200 + all_specialists_link_status_code = (200,) - images_src = [ - "https://brnup.s3.eu-north-1.amazonaws.com/pictures/specialists/garbaruk.png", - "https://brnup.s3.eu-north-1.amazonaws.com/pictures/specialists/proshina.png", - "https://brnup.s3.eu-north-1.amazonaws.com/pictures/specialists/berezkina.png", - "https://brnup.s3.eu-north-1.amazonaws.com/pictures/specialists/metelskaya.png", - "https://brnup.s3.eu-north-1.amazonaws.com/pictures/specialists/koroleva.png", - "https://brnup.s3.eu-north-1.amazonaws.com/pictures/specialists/kibalova.png", - "https://brnup.s3.eu-north-1.amazonaws.com/pictures/specialists/platonenko.png", - "https://brnup.s3.eu-north-1.amazonaws.com/pictures/specialists/sivenkova.png" - ] + s = 'https://brnup.s3.eu-north-1.amazonaws.com/pictures/specialists/' + e = '.png' + images_src = (f'{s}garbaruk{e}', f'{s}proshina{e}', f'{s}berezkina{e}', f'{s}metelskaya{e}', + f'{s}koroleva{e}', f'{s}kibalova{e}', f'{s}platonenko{e}', f'{s}sivenkova{e}') images_alt = "user avatar" diff --git a/test_data/start_unauthorized_page_data.py b/test_data/start_unauthorized_page_data.py index ad182a84b3..088a0c3861 100644 --- a/test_data/start_unauthorized_page_data.py +++ b/test_data/start_unauthorized_page_data.py @@ -15,13 +15,13 @@ class StartUnauthorizedPageData: page_subtitles = ["BRAINUP", "ОНЛАЙН ЗАНЯТИЯ", "РАЗВИТИЕ"] text_on_page = { - "text_in_section1": [ + "text_in_section1": ( "Наш сайт - это платформа интерактивных упражнений для взрослых и детей от семи лет с когнитивными " "проблемами восприятия речи, которая помогает тренировать способности слушать и понимать", "Our site is a platform of interactive exercises for adults and children from the age of seven with " - "cognitive speech perception problems, which helps to train the ability to listen and understand."], + "cognitive speech perception problems, which helps to train the ability to listen and understand."), - "text_in_section2": [ + "text_in_section2": ( "Тренируйтесь всего от 30 минут в день для развития и получения результата", "Первая бесплатная онлайн программа для взрослых и детей с когнитивными проблемами восприятия речи. " @@ -36,7 +36,7 @@ class StartUnauthorizedPageData: "Занимаясь по нашей программе, вы сможете, развивать слух в различных акустических ситуациях; " "тренировать слуховую память, прослушивая упражнения столько раз, сколько необходимо именно вам. " "А также, расширить словарный запас в интересной игровой форме и в дальшейшем использовать новые слова " - "в общении с друзьями и знакомыми."] + "в общении с друзьями и знакомыми.") } login_link_text = ["Начать", "Login"] diff --git a/tests/specialists_page_test.py b/tests/specialists_page_test.py index 987ce71472..981dc7dc6e 100644 --- a/tests/specialists_page_test.py +++ b/tests/specialists_page_test.py @@ -14,7 +14,7 @@ def test_sp_01_01_verify_page_presence_and_visibility(self, driver, specialists_ page = SpecialistsPage(driver) page_content_presence = page.check_presence_of_page_content() page_content_visibility = page.check_visibility_of_page_content() - assert page_content_presence is not None, "The page content is absent in DOM" + assert page_content_presence, "The page content is absent in DOM" assert page_content_visibility, "The page content is invisible" @allure.title("""Verify the composition and visibility of elements @@ -110,10 +110,10 @@ def test_sp_02_04_verify_name_and_profession_in_cards(self, driver, specialists_ name_values = page.get_name_values_in_cards() profession_values = page.get_profession_values_in_cards() assert name_values, "Name values in cards are empty" - assert name_values in SpecialistsPageData.specialists_names, \ - "Names in specialist cards mismatch the valid values" + assert all(element in SpecialistsPageData.specialists_names for element in name_values), \ + "Names in specialist cards mismatch valid values" assert profession_values, "Profession values in cards are empty" - assert profession_values in SpecialistsPageData.specialists_professions, \ + assert all(element in SpecialistsPageData.specialists_professions for element in profession_values), \ "Professions in specialist cards mismatch valid values" @allure.title("Verify text in the 'All Specialists' link") @@ -135,7 +135,7 @@ def test_sp_03_01_verify_all_specialists_link(self, driver, specialists_page_ope assert link_href, "Link href is empty" assert link_href == SpecialistsPageData.all_specialists_link_href, \ "The attribute 'href' of the link mismatches the valid value" - assert link_status_code == SpecialistsPageData.all_specialists_link_status_code, \ + assert link_status_code in SpecialistsPageData.all_specialists_link_status_code, \ "The status code of the link mismatches the valid value" @allure.title("""Verify that the 'All Specialists' link leads an unauthorized user @@ -170,10 +170,10 @@ def test_sp_04_01_verify_images_attributes_in_cards(self, driver, specialists_pa images_src = page.get_images_src() images_alt = page.get_images_alt() assert images_src, "The 'src' attribute value of some card images is empty" - assert images_src == SpecialistsPageData.images_src, \ + assert all(element in SpecialistsPageData.images_src for element in images_src), \ "The 'src' attribute of the card images mismatches valid values" assert images_alt, "The 'alt' attribute value of some card images is empty" - assert all(image_alt == SpecialistsPageData.images_alt for image_alt in images_alt), \ + assert all(element == SpecialistsPageData.images_alt for element in images_alt), \ "The 'alt' attribute value of some card images is empty or mismatches valid values" @allure.title("Verify sizes of images in specialist cards in the grid")