Skip to content

Commit 4cdfd82

Browse files
add test_ersp_04.02 Verify images sizes
update exercises_ru_similar_phrases_page_test.py, exercises_ru_similar_phrases_page.py #478
1 parent 502de4c commit 4cdfd82

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

pages/exercises_ru_similar_phrases_page.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,11 @@ def click_on_subgroup_links(self):
216216
@allure.step("Get the list of attribute 'style' values of images in links")
217217
def get_links_style(self):
218218
style = [image.get_attribute('style') for image in self.get_list4_of_links()]
219-
print(len(style), *style, sep='\n')
219+
# print(len(style), *style, sep='\n')
220220
return style
221+
222+
@allure.step("Get the list of sizes of background-images in links")
223+
def get_images_sizes(self):
224+
images_size = [image.size for image in self.get_list4_of_links()]
225+
print(len(images_size), *images_size, sep='\n')
226+
return images_size

tests/exercises_ru_similar_phrases_page_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,9 @@ def test_ersp_04_01_verify_images_attributes(self, driver, exercises_ru_similar_
168168
assert links_style, "The 'style' attribute value of links is empty"
169169
assert all(element in erspPD.subgroup_links_style for element in links_style), \
170170
"The 'style' attribute value of links mismatches valid values"
171+
172+
@allure.title("Verify sizes of background-images in links on the page")
173+
def test_ersp_04_02_verify_images_sizes(self, driver, exercises_ru_similar_phrases_page_open):
174+
page = erspPage(driver)
175+
images_size = page.get_images_sizes()
176+
assert images_size != 0, "Background-images have not sizes"

0 commit comments

Comments
 (0)