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
16 changes: 16 additions & 0 deletions pages/header_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,22 @@ def check_size_changes_of_auth_logo_image(self):
return f"Image size changed after resizing to {window_resolution}"
# return changes

@allure.step("Check if the 'Logo' image is hidden after resizing in the Header for an authorized user")
def check_invisibility_of_auth_logo_image(self):
image_size_before = self.get_size_of_auth_logo_image()
self.driver.set_window_size(780, 1100)
window_size = self.driver.get_window_size()
window_resolution = f"{window_size['width']}x{window_size['height']}"
image_invisibility = self.element_is_not_visible(self.locators1.LOGO_IMAGE_AUTH)
hiding = 1 if image_invisibility else 0
print(f"\nAfter resizing the screen till {window_resolution} px")
print(f"The 'Logo' image is hidden" if hiding == 1 else f"The 'Logo' image isn't hidden")
if image_invisibility:
return f"The 'Logo' image is hidden after resizing to {window_resolution}"
else:
return f"The 'Logo' image isn't hidden after resizing to {window_resolution}"
# return image_invisibility


@allure.step("Check if the profile avatar is present in the Header for an authorized user")
def check_auth_profile_avatar_presence(self):
Expand Down
10 changes: 6 additions & 4 deletions tests/header_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,12 @@ def test_hpa_04_01_verify_auth_logo_image(self, driver, auto_test_user_authorize
@allure.title("Verify size of the image in the 'Logo' link in the Header for an authorized user")
def test_hpa_04_02_verify_auth_logo_image_size(self, driver, auto_test_user_authorized):
page = hPage(driver)
image_size = page.get_size_of_auth_logo_image()
image_size_change = page.check_size_changes_of_auth_logo_image()
assert image_size != 0, f"The image in the 'Logo' image has not size"
assert image_size_change, "The 'Logo' image size is changed"
logo_image_size = page.get_size_of_auth_logo_image()
logo_image_size_change = page.check_size_changes_of_auth_logo_image()
logo_image_invisibility = page.check_invisibility_of_auth_logo_image()
assert logo_image_size != 0, f"The image in the 'Logo' image has not size"
assert logo_image_size_change, "The 'Logo' image size is changed"
assert logo_image_invisibility, "The 'Logo' image is hidden"

@allure.title("Verify presence, visibility, attributes of icons in the Header for an authorized user")
def test_hpa_04_03_verify_auth_icons(self, driver, auto_test_user_authorized):
Expand Down
Loading