chore: improve profile

This commit is contained in:
Anastasiya Semenkevich 2024-05-31 17:00:33 +03:00 committed by Anastasiya
parent 034b29d12e
commit b08751ac91
3 changed files with 20 additions and 20 deletions

View File

@ -54,13 +54,6 @@ class OnlineIdentifier(QObject):
self.wait_until_hidden()
@allure.step('Open Profile popup from online identifier')
def open_profile_popup_from_online_identifier(self, attempts: int =2) -> ProfilePopup:
def open_profile_popup_from_online_identifier(self) -> ProfilePopup:
self._view_my_profile_button.click()
time.sleep(0.5)
try:
return ProfilePopup()
except Exception as ex:
if attempts:
self.open_profile_popup_from_online_identifier(attempts - 1)
else:
raise ex
return ProfilePopup().wait_until_appears()

View File

@ -16,7 +16,8 @@ from gui.screens.settings_profile import ProfileSettingsView
class ProfilePopup(BasePopup):
def __init__(self):
super(ProfilePopup, self).__init__()
super().__init__()
self._profile_popup_content_item = QObject(names.ProfileContentItem)
self._profile_image = QObject(names.ProfileHeader_userImage)
self._user_name_label = TextLabel(names.ProfilePopup_displayName)
self._edit_profile_button = Button(names.ProfilePopup_editButton)
@ -24,6 +25,11 @@ class ProfilePopup(BasePopup):
self._emoji_hash = QObject(names.profileDialog_userEmojiHash_EmojiHash)
self._chat_key_copy_button = Button(names.copy_icon_CopyButton)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._profile_popup_content_item.wait_until_appears(timeout_msec)
return self
@property
@allure.step('Get profile image')
def profile_image(self):

View File

@ -84,17 +84,18 @@ userContextMenu_ViewMyProfileAction = {"container": o_StatusListView, "objectNam
userLabel_StyledText = {"container": o_StatusListView, "type": "StyledText", "unnamed": 1, "visible": True}
o_StatusIdenticonRing = {"container": o_StatusListView, "type": "StatusIdenticonRing", "unnamed": 1, "visible": True}
# My Profile Popup
ProfileHeader_userImage = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileDialog_userImage", "type": "UserImage", "visible": True}
ProfilePopup_displayName = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileDialog_displayName", "type": "StatusBaseText", "visible": True}
ProfilePopup_editButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "editProfileButton", "type": "StatusButton", "visible": True}
ProfilePopup_SendContactRequestButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "profileDialog_sendContactRequestButton", "type": "StatusButton", "visible": True}
profileDialog_userEmojiHash_EmojiHash = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileDialog_userEmojiHash", "type": "EmojiHash", "visible": True}
edit_TextEdit = {"container": statusDesktop_mainWindow_overlay, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
# My Profile Popup (online identifier)
ProfileContentItem = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileDialogView", "type": "ContentItem", "visible": True}
ProfileHeader_userImage = {"container": ProfileContentItem, "objectName": "ProfileDialog_userImage", "type": "UserImage", "visible": True}
ProfilePopup_displayName = {"container": ProfileContentItem, "objectName": "ProfileDialog_displayName", "type": "StatusBaseText", "visible": True}
ProfilePopup_editButton = {"container": ProfileContentItem, "objectName": "editProfileButton", "type": "StatusButton", "visible": True}
ProfilePopup_SendContactRequestButton = {"container": ProfileContentItem, "objectName": "profileDialog_sendContactRequestButton", "type": "StatusButton", "visible": True}
profileDialog_userEmojiHash_EmojiHash = {"container": ProfileContentItem, "objectName": "ProfileDialog_userEmojiHash", "type": "EmojiHash", "visible": True}
edit_TextEdit = {"container": ProfileContentItem, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
https_status_app_StatusBaseText = {"container": edit_TextEdit, "type": "StatusBaseText", "unnamed": 1, "visible": True}
copy_icon_CopyButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "copy-icon", "type": "CopyButton", "visible": True}
request_ID_verification_StatusFlatButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "requestIDVerification_StatusItem", "type": "StatusFlatButton", "visible": True}
send_contact_request_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "profileDialog_sendContactRequestButton", "type": "StatusButton", "visible": True}
copy_icon_CopyButton = {"container": ProfileContentItem, "objectName": "copy-icon", "type": "CopyButton", "visible": True}
request_ID_verification_StatusFlatButton = {"checkable": False, "container": ProfileContentItem, "objectName": "requestIDVerification_StatusItem", "type": "StatusFlatButton", "visible": True}
send_contact_request_StatusButton = {"checkable": False, "container": ProfileContentItem, "objectName": "profileDialog_sendContactRequestButton", "type": "StatusButton", "visible": True}
# Welcome Status Popup
betaConsent_StatusModal = {"container": statusDesktop_mainWindow_overlay, "objectName": "desktopBetaStatusModal", "type": "StatusModal", "visible": True}