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: 3 additions & 0 deletions pages/base_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion pages/exercises_ru_words_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 11 additions & 14 deletions test_data/exercises_ru_words_page_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
]
2 changes: 2 additions & 0 deletions tests/exercises_ru_words_page_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading