diff --git a/pages/base_page.py b/pages/base_page.py index 707874c0fa..0b87b8c625 100644 --- a/pages/base_page.py +++ b/pages/base_page.py @@ -89,6 +89,9 @@ def get_text(self, locator): def get_link_href(self, locator): return self.driver.find_element(*locator).get_attribute("href") + def get_link_style(self, locator): + return self.driver.find_element(*locator).get_attribute("style") + def get_link_title(self, locator): return self.driver.find_element(*locator).get_attribute("title") diff --git a/pages/exercises_ru_words_page.py b/pages/exercises_ru_words_page.py index ccb4997211..c4657b094e 100644 --- a/pages/exercises_ru_words_page.py +++ b/pages/exercises_ru_words_page.py @@ -269,5 +269,5 @@ def click_on_subgroup_link_beloved_home_food_clothes(self): @allure.step("Get the list of attribute 'style' values of images in links") def get_links_style(self): style = [image.get_attribute('style') for image in self.get_list4_of_links()] - print(len(style), *style, sep='\n') + # print(len(style), *style, sep='\n') return style diff --git a/test_data/exercises_ru_words_page_data.py b/test_data/exercises_ru_words_page_data.py index 5e4446be6c..bb935d9165 100644 --- a/test_data/exercises_ru_words_page_data.py +++ b/test_data/exercises_ru_words_page_data.py @@ -114,19 +114,16 @@ class ExercisesRuWordsPageData: links_status_code = 200 + s = 'background-image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/' + e = '.svg");' subgroup_links_style = [ - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/family.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/home.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/food.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/clothes.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/school.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/math.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/pets.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/animals.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/transport.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/colors.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/city.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/country.svg"");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/walk.svg");', - 'background - image: url("https://brnup.s3.eu-north-1.amazonaws.com/pictures/theme/weather.svg");' + 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}', + f'{s}animals{e}', f'{s}transport{e}', f'{s}colors{e}', f'{s}city{e}', f'{s}country{e}', f'{s}walk{e}', + f'{s}weather{e}', f'{s}future{e}', f'{s}body{e}', f'{s}game{e}', f'{s}adventure{e}', f'{s}hospital{e}', + f'{s}feelings{e}', f'{s}toys{e}', f'{s}insects{e}', f'{s}interior{e}', f'{s}kitchen{e}', f'{s}music{e}', + f'{s}musical_instruments{e}', f'{s}birds{e}', f'{s}jewelry{e}', f'{s}history{e}', f'{s}actions{e}', + f'{s}audible_actions{e}', f'{s}more_transport{e}', f'{s}special_transport{e}', f'{s}fruit_trees{e}', + f'{s}plants{e}', f'{s}trees{e}', f'{s}sport{e}', f'{s}shop{e}', f'{s}artiodactyls{e}', f'{s}dogs{e}', + f'{s}stationery{e}', f'{s}flowers{e}', f'{s}literature{e}', f'{s}physics{e}', f'{s}biology{e}', + f'{s}instruments{e}' ] diff --git a/tests/exercises_ru_words_page_test.py b/tests/exercises_ru_words_page_test.py index 042032bd09..c970a82b7e 100644 --- a/tests/exercises_ru_words_page_test.py +++ b/tests/exercises_ru_words_page_test.py @@ -177,3 +177,5 @@ def test_erw_04_01_verify_images_attributes(self, driver, exercises_ru_words_pag page = ExercisesRuWordsPage(driver) links_style = page.get_links_style() assert links_style, "The 'style' attribute value of links is empty" + assert all(element in ExRuWoPaData.subgroup_links_style for element in links_style), \ + "The 'style' attribute value of links do not match the valid values"