diff --git a/locators/exercises_ru_words_family_page_locators.py b/locators/exercises_ru_words_family_page_locators.py index 71cd78fe0b..2034e7dbc1 100644 --- a/locators/exercises_ru_words_family_page_locators.py +++ b/locators/exercises_ru_words_family_page_locators.py @@ -1,5 +1,6 @@ -"""Locators of web elements on the 'Exercises "Family"' page in the series "Words" on the 'ru' local""" +"""Locators of web elements on the exercises subgroup "Family" page in the series "Words" on the "ru" local""" +from selenium.webdriver.common.by import By class ExercisesRuWordsFamilyPageLocators: - pass + PAGE_CONTENT = (By.TAG_NAME, "main") diff --git a/pages/exercises_ru_words_family_page.py b/pages/exercises_ru_words_family_page.py index 357684ee46..9e9d36e59c 100644 --- a/pages/exercises_ru_words_family_page.py +++ b/pages/exercises_ru_words_family_page.py @@ -1,7 +1,14 @@ -"""Methods for verifying web elements on the 'Exercises "Family"' page in the series "Words" on the 'ru' local""" +"""Methods for verifying web elements on the exercises subgroup "Family" page +in the series "Words" on the "ru" local""" +import allure from pages.base_page import BasePage from locators.exercises_ru_words_family_page_locators import ExercisesRuWordsFamilyPageLocators class ExercisesRuWordsFamilyPage(BasePage): locators = ExercisesRuWordsFamilyPageLocators + + # Checking the structure and display of elements on the page + @allure.step("Check if some content is present in DOM") + def check_presence_of_page_content(self): + return self.element_is_present(self.locators.PAGE_CONTENT) diff --git a/test_data/links.py b/test_data/links.py index 124485b45a..04e1b81e02 100644 --- a/test_data/links.py +++ b/test_data/links.py @@ -45,4 +45,5 @@ class ExercisesUrls: f"{c}46") # Speech Exercises > Words > Family + URL_EXERCISES_RU_WORDS_FAMILY_PAGE = f"{STARTING_POINT}/2/series/1/subgroup/1" URL_EXERCISE1_MODAL_WINDOW_PAGE = f"{STARTING_POINT}/4/series/9/subgroup/73/exercise/919/task/919" diff --git a/tests/conftest.py b/tests/conftest.py index f97e0909ef..c0fde4aa00 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -119,6 +119,12 @@ def page_fully_loaded(driver): Wait(driver, 10).until(EC.presence_of_all_elements_located(erwPL.PAGE_LIST3)) +@pytest.fixture() +@allure.step(f'Open page: {ExercisesUrls.URL_EXERCISES_RU_WORDS_FAMILY_PAGE} on the "ru" local') +def exercises_ru_words_family_page_open(driver, groups_ru_page_open): + driver.get(ExercisesUrls.URL_EXERCISES_RU_WORDS_FAMILY_PAGE) + + @pytest.fixture() @allure.step(f'Open page: {MainPageLinks.URL_LOGIN_PAGE}') def login_page_open(driver, main_page_open): diff --git a/tests/exercises_ru_words_family_page_test.py b/tests/exercises_ru_words_family_page_test.py index dd7329cdc5..f6050c6965 100644 --- a/tests/exercises_ru_words_family_page_test.py +++ b/tests/exercises_ru_words_family_page_test.py @@ -1,7 +1,14 @@ -"""Auto tests for verifying web elements on the 'Exercises "Family"' page in the series "Words" on the 'ru' local""" +"""Auto tests for verifying web elements on the exercises subgroup "Family" page +in the series "Words" on the "ru" local""" import allure +from pages.exercises_ru_words_family_page import ExercisesRuWordsFamilyPage as erwfPage -@allure.epic("The Exercises 'Family' page in the series 'Words' on the 'ru' local") +@allure.epic("The exercises subgroup 'Family' page in the series 'Words' on the 'ru' local") class TestExercisesRuWordsFamilyPage: - pass + class TestExRuWordsFamilyPageStructure: + @allure.title("Verify presence and visibility of content on the page") + def test_erwf_01_01_verify_page_presence(self, driver, exercises_ru_words_family_page_open): + page = erwfPage(driver) + page_content_presence = page.check_presence_of_page_content() + assert page_content_presence, "The page content is absent in DOM"