diff --git a/test/e2e/constants/syncing.py b/test/e2e/constants/syncing.py index 40fa5cf6a0..c7bb1e8b98 100644 --- a/test/e2e/constants/syncing.py +++ b/test/e2e/constants/syncing.py @@ -5,3 +5,5 @@ class SyncingSettings(Enum): SYNC_A_NEW_DEVICE_INSTRUCTIONS_HEADER = 'Sync a New Device' SYNC_A_NEW_DEVICE_INSTRUCTIONS_SUBTITLE = 'You own your data. Sync it among your devices.' SYNC_CODE_IS_WRONG_TEXT = 'This does not look like a sync code' + SYNC_SETUP_ERROR_PRIMARY = 'Failed to generate sync code' + SYNC_SETUP_ERROR_SECONDARY = 'Failed to start pairing server' diff --git a/test/e2e/gui/components/community/authenticate_popup.py b/test/e2e/gui/components/community/authenticate_popup.py index 7a59920e9b..8137f2d237 100644 --- a/test/e2e/gui/components/community/authenticate_popup.py +++ b/test/e2e/gui/components/community/authenticate_popup.py @@ -14,6 +14,7 @@ class AuthenticatePopup(BasePopup): self._content = QObject('keycardSharedPopupContent_KeycardPopupContent') self._passwort_text_edit = TextEdit('password_PlaceholderText') self._authenticate_button = Button('authenticate_StatusButton') + self._close_button = Button('headerCloseButton_StatusFlatRoundButton') @allure.step('Wait until appears {0}') def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC): @@ -25,3 +26,7 @@ class AuthenticatePopup(BasePopup): self._passwort_text_edit.type_text(password) self._authenticate_button.click() self._authenticate_button.wait_until_hidden() + + @allure.step('Close authenticate popup by close button') + def close_authenticate_popup(self): + self._close_button.click() diff --git a/test/e2e/gui/components/settings/sync_new_device_popup.py b/test/e2e/gui/components/settings/sync_new_device_popup.py index 4c338a2ac3..768a6e2f7c 100644 --- a/test/e2e/gui/components/settings/sync_new_device_popup.py +++ b/test/e2e/gui/components/settings/sync_new_device_popup.py @@ -3,6 +3,7 @@ import pyperclip from gui.components.base_popup import BasePopup from gui.elements.button import Button +from gui.elements.object import QObject from gui.elements.text_edit import TextEdit @@ -13,6 +14,18 @@ class SyncNewDevicePopup(BasePopup): self._copy_button = Button('copy_SyncCodeStatusButton') self._done_button = Button('done_SyncCodeStatusButton') self._sync_code_field = TextEdit('syncCodeInput_StatusPasswordInput') + self._close_button = Button('close_StatusButton') + self._error_message = QObject('errorView_SyncingErrorMessage') + + @property + @allure.step('Get primary error message') + def primary_error_message(self) -> str: + return str(self._error_message.object.primaryText) + + @property + @allure.step('Get secondary error message') + def secondary_error_message(self) -> str: + return str(self._error_message.object.secondaryText) @property @allure.step('Get syncing code') @@ -24,3 +37,8 @@ class SyncNewDevicePopup(BasePopup): def done(self): self._done_button.click() self.wait_until_hidden() + + @allure.step('Click close') + def close(self): + self._close_button.click() + self.wait_until_hidden() diff --git a/test/e2e/gui/objects_map/component_names.py b/test/e2e/gui/objects_map/component_names.py index bf24344be0..ecf8c7e939 100644 --- a/test/e2e/gui/objects_map/component_names.py +++ b/test/e2e/gui/objects_map/component_names.py @@ -193,6 +193,7 @@ delete_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow keycardSharedPopupContent_KeycardPopupContent = {"container": statusDesktop_mainWindow_overlay, "objectName": "KeycardSharedPopupContent", "type": "KeycardPopupContent", "visible": True} password_PlaceholderText = {"container": statusDesktop_mainWindow_overlay, "type": "PlaceholderText", "unnamed": 1, "visible": True} authenticate_StatusButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "PrimaryButton", "text": "Authenticate", "type": "StatusButton", "visible": True} +headerCloseButton_StatusFlatRoundButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "headerCloseButton", "type": "StatusFlatRoundButton", "visible": True} # Shared Popup sharedPopup_Popup_Content = {"container": statusDesktop_mainWindow, "objectName": "KeycardSharedPopupContent", "type": "Item"} @@ -311,6 +312,8 @@ mainWindow_secureYourSeedPhraseBanner_Button = {"container": statusDesktop_mainW copy_SyncCodeStatusButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "syncCodeCopyButton", "type": "StatusButton", "visible": True} done_SyncCodeStatusButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "syncAnewDeviceNextButton", "type": "StatusButton", "visible": True} syncCodeInput_StatusPasswordInput = {"container": statusDesktop_mainWindow_overlay, "id": "syncCodeInput", "type": "StatusPasswordInput", "unnamed": 1, "visible": True} +close_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "syncAnewDeviceNextButton", "type": "StatusButton", "visible": True} +errorView_SyncingErrorMessage = {"container": statusDesktop_mainWindow_overlay, "id": "errorView", "type": "SyncingErrorMessage", "unnamed": 1, "visible": True} # Edit group name and image popup groupChatEdit_name_TextEdit = {"container": statusDesktop_mainWindow_overlay, "objectName": "groupChatEdit_name", "type": "TextEdit", "visible": True} diff --git a/test/e2e/gui/screens/settings_syncing.py b/test/e2e/gui/screens/settings_syncing.py index 0281d87384..5e3a614cb3 100644 --- a/test/e2e/gui/screens/settings_syncing.py +++ b/test/e2e/gui/screens/settings_syncing.py @@ -33,6 +33,11 @@ class SyncingSettingsView(QObject): @allure.step('Setup syncing') def set_up_syncing(self, password: str): - self._setup_syncing_button.click() + self.click_setup_syncing() AuthenticatePopup().wait_until_appears().authenticate(password) return SyncNewDevicePopup().wait_until_appears() + + @allure.step('Click setup syncing') + def click_setup_syncing(self): + self._setup_syncing_button.click() + return AuthenticatePopup().wait_until_appears() diff --git a/test/e2e/tests/onboarding/test_onboarding_syncing.py b/test/e2e/tests/onboarding/test_onboarding_syncing.py index 51ca655d2a..e0752b2743 100644 --- a/test/e2e/tests/onboarding/test_onboarding_syncing.py +++ b/test/e2e/tests/onboarding/test_onboarding_syncing.py @@ -10,8 +10,10 @@ import constants import driver from constants import UserAccount from constants.syncing import SyncingSettings +from gui.components.community.authenticate_popup import AuthenticatePopup from gui.components.onboarding.before_started_popup import BeforeStartedPopUp from gui.components.onboarding.beta_consent_popup import BetaConsentPopup +from gui.components.settings.sync_new_device_popup import SyncNewDevicePopup from gui.components.splash_screen import SplashScreen from gui.main_window import MainWindow from gui.screens.onboarding import AllowNotificationsView, WelcomeToStatusView, SyncResultView, \ @@ -106,3 +108,21 @@ def test_wrong_sync_code(sync_screen, wrong_sync_code): pyperclip.copy(wrong_sync_code) sync_view.paste_sync_code() assert SyncingSettings.SYNC_CODE_IS_WRONG_TEXT.value == sync_view.sync_code_error_message, f'Wrong sync code message did not appear' + + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703591', 'Generate sync code. Negative') +@pytest.mark.case(703591) +def test_cancel_setup_syncing(main_screen: MainWindow): + with step('Open syncing settings'): + sync_settings_view = main_screen.left_panel.open_settings().left_panel.open_syncing_settings() + sync_settings_view.is_instructions_header_present() + sync_settings_view.is_instructions_subtitle_present() + if configs.DEV_BUILD: + sync_settings_view.is_backup_button_present() + with step('Click setup syncing and close authenticate popup'): + main_screen.left_panel.open_settings().left_panel.open_syncing_settings().click_setup_syncing().close_authenticate_popup() + sync_new_device_popup = SyncNewDevicePopup().wait_until_appears() + + with step('Verify error messages appear'): + assert sync_new_device_popup.primary_error_message == SyncingSettings.SYNC_SETUP_ERROR_PRIMARY.value + assert sync_new_device_popup.secondary_error_message == SyncingSettings.SYNC_SETUP_ERROR_SECONDARY.value