diff --git a/test/e2e/gui/components/profile_popup.py b/test/e2e/gui/components/profile_popup.py index 93c29c377e..48cf5bc44b 100644 --- a/test/e2e/gui/components/profile_popup.py +++ b/test/e2e/gui/components/profile_popup.py @@ -8,6 +8,7 @@ from gui.components.base_popup import BasePopup from gui.components.context_menu import ContextMenu from gui.components.settings.review_contact_request_popup import AcceptRequestFromProfile from gui.components.settings.send_contact_request_popup import SendContactRequestFromProfile +from gui.components.share_profile_popup import ShareProfilePopup from gui.elements.button import Button from gui.elements.object import QObject from gui.elements.text_label import TextLabel @@ -23,6 +24,7 @@ class ProfilePopup(BasePopup): self._profile_image = QObject(names.ProfileHeader_userImage) self._user_name_label = TextLabel(names.ProfilePopup_displayName) self._edit_profile_button = Button(names.ProfilePopup_editButton) + self._share_profile_button = Button(names.share_Profile_StatusFlatButton) self._chat_key_text_label = TextLabel(names.https_status_app_StatusBaseText) self._emoji_hash = QObject(names.profileDialog_userEmojiHash_EmojiHash) self._chat_key_copy_button = Button(names.copy_icon_CopyButton) @@ -85,6 +87,11 @@ class ProfilePopup(BasePopup): self._edit_profile_button.click() return ProfileSettingsView() + @allure.step('Click share profile button') + def share_profile(self): + self._share_profile_button.click() + return ShareProfilePopup() + @allure.step('Wait until appears {0}') def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC): self._emoji_hash.wait_until_appears(timeout_msec) diff --git a/test/e2e/gui/components/share_profile_popup.py b/test/e2e/gui/components/share_profile_popup.py new file mode 100644 index 0000000000..977b84e55d --- /dev/null +++ b/test/e2e/gui/components/share_profile_popup.py @@ -0,0 +1,41 @@ +import allure + +import configs +import driver +from gui.components.base_popup import BasePopup +from gui.elements.button import Button +from gui.elements.object import QObject +from gui.elements.text_label import TextLabel +from gui.objects_map import names + + +class ShareProfilePopup(BasePopup): + + def __init__(self): + super().__init__() + self._profile_qr_code = QObject(names.o_Image) + self._profile_link_input = QObject(names.profileLinkInput_StatusBaseInput) + self._emoji_hash = TextLabel(names.o_EmojiHash) + self._copy_button = Button(names.o_copy_icon_CopyButton) + self._close_button = Button(names.closeCrossPopupButton) + + @allure.step('Wait until appears {0}') + def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC): + self._profile_qr_code.wait_until_appears(timeout_msec) + return self + + @allure.step('Get profile link') + def get_profile_link(self) -> str: + return str(self._profile_link_input.object.placeholderText) + + @allure.step('Get profile qr code visibility') + def is_profile_qr_code_visibile(self) -> bool: + return self._profile_qr_code.is_visible + + @allure.step('Get profile emoji hash') + def get_emoji_hash(self): + return self._emoji_hash.object.publicKey + + @allure.step('Close share profile popup') + def close(self): + self._close_button.click() diff --git a/test/e2e/gui/objects_map/names.py b/test/e2e/gui/objects_map/names.py index c8698722f5..b91c1d25d4 100644 --- a/test/e2e/gui/objects_map/names.py +++ b/test/e2e/gui/objects_map/names.py @@ -95,6 +95,7 @@ ProfileContentItem = {"container": statusDesktop_mainWindow_overlay, "objectName 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} +share_Profile_StatusFlatButton = {"checkable": False, "container": ProfileContentItem, "objectName": "shareProfileButton", "type": "StatusFlatButton", "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} @@ -107,6 +108,12 @@ review_contact_request_StatusButton = {"checkable": False, "container": statusDe profileDialogView_ContentItem = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileDialogView", "type": "ContentItem", "visible": True} menuButton_StatusFlatButton = {"checkable": False, "container": profileDialogView_ContentItem, "id": "menuButton", "type": "StatusFlatButton", "unnamed": 1, "visible": True} +# Share profile popup +o_Image = {"container": statusDesktop_mainWindow_overlay, "objectName": "profileQRCodeImage", "type": "Image", "visible": True} +o_copy_icon_CopyButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "copy-icon", "type": "CopyButton", "visible": True} +o_EmojiHash = {"container": statusDesktop_mainWindow_overlay, "type": "EmojiHash", "unnamed": 1, "visible": True} +profileLinkInput_StatusBaseInput = {"container": statusDesktop_mainWindow_overlay, "objectName": "profileLinkInput", "type": "StatusBaseInput", "visible": True} + # Welcome Status Popup betaConsent_StatusModal = {"container": statusDesktop_mainWindow_overlay, "objectName": "desktopBetaStatusModal", "type": "StatusModal", "visible": True} agreeToUse_StatusCheckBox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "objectName": "desktopBetaAgreeCheckBox", "type": "StatusCheckBox", "visible": True} diff --git a/test/e2e/tests/onboarding/test_onboarding_generate_new_keys.py b/test/e2e/tests/onboarding/test_onboarding_generate_new_keys.py index f166406980..7fc7a610b7 100755 --- a/test/e2e/tests/onboarding/test_onboarding_generate_new_keys.py +++ b/test/e2e/tests/onboarding/test_onboarding_generate_new_keys.py @@ -126,6 +126,15 @@ def test_generate_new_keys_sign_out_from_settings(aut, main_window, keys_screen, assert profile_popup.get_emoji_hash == emoji_hash_public_key, \ f'Public keys should match when they dont' + with step('Open share profile popup and check the data'): + share_profile_popup = profile_popup.share_profile() + profile_link = share_profile_popup.get_profile_link() + emoji_hash = share_profile_popup.get_emoji_hash() + assert share_profile_popup.is_profile_qr_code_visibile + assert chat_key in profile_link, f'Profile link is wrong {profile_link}, it does not contain correct chat key' + assert emoji_hash == emoji_hash_public_key, f'Public keys do not match' + share_profile_popup. close() + with step('Click left panel and open settings'): main_window.left_panel.click() settings = main_window.left_panel.open_settings() diff --git a/ui/imports/shared/views/profile/ShareProfileDialog.qml b/ui/imports/shared/views/profile/ShareProfileDialog.qml index d79f1d2206..327c35a3ae 100644 --- a/ui/imports/shared/views/profile/ShareProfileDialog.qml +++ b/ui/imports/shared/views/profile/ShareProfileDialog.qml @@ -47,6 +47,7 @@ StatusDialog { color: Theme.palette.white Image { + objectName: "profileQRCodeImage" anchors.fill: parent asynchronous: true fillMode: Image.PreserveAspectFit @@ -89,6 +90,7 @@ StatusDialog { } StatusBaseInput { + objectName: "profileLinkInput" Layout.fillWidth: true Layout.preferredHeight: 44 leftPadding: Style.current.padding @@ -118,6 +120,7 @@ StatusDialog { } StatusBaseInput { + objectName: "emojiHashInput" Layout.fillWidth: true Layout.preferredHeight: 44 leftPadding: Style.current.padding