diff --git a/test/e2e/gui/components/signing_phrase_popup.py b/test/e2e/gui/components/signing_phrase_popup.py index 6211a2b5cb1..d04960bf976 100644 --- a/test/e2e/gui/components/signing_phrase_popup.py +++ b/test/e2e/gui/components/signing_phrase_popup.py @@ -1,14 +1,15 @@ import allure +from gui.components.base_popup import BasePopup from gui.elements.button import Button from gui.elements.object import QObject from gui.objects_map import names -class SigningPhrasePopup(QObject): +class SigningPhrasePopup(BasePopup): def __init__(self): - super().__init__(names.signPhrase_Ok_Button) + super().__init__() self.ok_got_it_button = Button(names.signPhrase_Ok_Button) @allure.step('Confirm signing phrase in popup') diff --git a/test/e2e/gui/main_window.py b/test/e2e/gui/main_window.py index e0ca76d2992..81a54c114b8 100644 --- a/test/e2e/gui/main_window.py +++ b/test/e2e/gui/main_window.py @@ -184,7 +184,7 @@ def sign_up(self, user_account: UserAccount): confirm_password_view = create_password_view.create_password(user_account.password) confirm_password_view.confirm_password(user_account.password) if configs.system.get_platform() == "Darwin": - BiometricsView().wait_until_appears().prefer_password() + BiometricsView().wait_until_appears().maybe_later() SplashScreen().wait_until_appears().wait_until_hidden() YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next() if configs.system.get_platform() == "Darwin": diff --git a/test/e2e/gui/objects_map/names.py b/test/e2e/gui/objects_map/names.py index 187c7039042..ba9d5d1fa62 100644 --- a/test/e2e/gui/objects_map/names.py +++ b/test/e2e/gui/objects_map/names.py @@ -13,7 +13,7 @@ # Common names settingsSave_StatusButton = {"container": statusDesktop_mainWindow, "objectName": "settingsDirtyToastMessageSaveButton", "type": "StatusButton", "visible": True} -mainWindow_Save_changes_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow, "objectName": "settingsDirtyToastMessageSaveButton", "type": "StatusButton", "visible": True} +mainWindow_Save_changes_StatusButton = {"container": statusDesktop_mainWindow, "objectName": "settingsDirtyToastMessageSaveButton", "type": "StatusButton", "visible": True} closeCrossPopupButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "headerActionsCloseButton", "type": "StatusFlatRoundButton", "visible": True} # Main right panel @@ -254,7 +254,7 @@ selected_tags_text = {"container": statusDesktop_mainWindow_overlay, "type": "StatusBaseText", "unnamed": 1, "visible": True} # Signing phrase popup -signPhrase_Ok_Button = {"container": statusDesktop_mainWindow, "type": "StatusFlatButton", "objectName": "signPhraseModalOkButton", "visible": True} +signPhrase_Ok_Button = {"container": statusDesktop_mainWindow_overlay, "objectName": "signPhraseModalOkButton", "type": "StatusFlatButton", "visible": True} # Sign transaction popup cancel_transaction_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "cancelButton", "text": "Cancel", "type": "StatusButton", "visible": True} diff --git a/test/e2e/gui/objects_map/onboarding_names.py b/test/e2e/gui/objects_map/onboarding_names.py index 3098a291366..4288c00e765 100644 --- a/test/e2e/gui/objects_map/onboarding_names.py +++ b/test/e2e/gui/objects_map/onboarding_names.py @@ -107,9 +107,13 @@ profileImageCropper = {"container": statusDesktop_mainWindow, "objectName": "imageCropWorkflow", "type": "ImageCropWorkflow", "visible": True} # Create Password View -mainWindow_CreatePasswordView = {"container": statusDesktop_mainWindow, "type": "CreatePasswordView", "unnamed": 1, "visible": True} -mainWindow_passwordViewNewPassword = {"container": mainWindow_CreatePasswordView, "objectName": "passwordViewNewPassword", "type": "StatusPasswordInput", "visible": True} -mainWindow_passwordViewNewPasswordConfirm = {"container": mainWindow_CreatePasswordView, "objectName": "passwordViewNewPasswordConfirm", "type": "StatusPasswordInput", "visible": True} +mainWindow_CreatePasswordView = {"container": onboardingLayout, "type": "CreatePasswordPage", "unnamed": 1, "visible": True} +choosePasswordField = {"container": mainWindow_CreatePasswordView, "objectName": "passwordViewNewPassword", "type": "StatusPasswordInput", "visible": True} +repeatPasswordField = {"container": mainWindow_CreatePasswordView, "objectName": "passwordViewNewPasswordConfirm", "type": "StatusPasswordInput", "visible": True} +confirmPasswordButton = {"container": mainWindow_CreatePasswordView, "objectName": "btnConfirmPassword", "type": "StatusButton", "visible": True} + + + mainWindow_Create_password_StatusButton = {"checkable": False, "container": mainWindow_CreatePasswordView, "objectName": "onboardingCreatePasswordButton", "type": "StatusButton", "visible": True} mainWindow_view_PasswordView = {"container": statusDesktop_mainWindow, "id": "view", "type": "PasswordView", "unnamed": 1, "visible": True} mainWindow_RowLayout = {"container": statusDesktop_mainWindow, "type": "PassIncludesIndicator", "unnamed": 1, "visible": True} @@ -136,7 +140,7 @@ loginView_addExistingUserItem_AccountMenuItemPanel = {"container": statusDesktop_mainWindow_overlay, "objectName": "LoginView_addExistingUserItem", "type": "AccountMenuItemPanel", "visible": True} mainWindowUsePasswordInsteadStatusBaseText = {"container": statusDesktop_mainWindow, "text": "Use password instead", "type": "StatusBaseText", "unnamed": 1, "visible": True} -# Touch ID Auth View -mainWindow_TouchIDAuthView = {"container": statusDesktop_mainWindow, "type": "TouchIDAuthView", "unnamed": 1, "visible": True} -mainWindow_touchIdYesUseTouchIDButton = {"container": statusDesktop_mainWindow, "objectName": "touchIdYesUseTouchIDButton", "type": "StatusButton", "visible": True} -mainWindow_touchIdIPreferToUseMyPasswordText = {"container": statusDesktop_mainWindow, "objectName": "touchIdIPreferToUseMyPasswordText", "type": "StatusBaseText"} +# Enable biometrics view +enableBiometricsView = {"container": onboardingLayout, "type": "EnableBiometricsPage", "unnamed": 1, "visible": True} +enableBiometricsButton = {"container": enableBiometricsView, "objectName": "btnEnableBiometrics", "type": "StatusButton", "visible": True} +dontEnableBiometricsButton = {"container": enableBiometricsView, "objectName": "btnDontEnableBiometrics", "type": "StatusFlatButton", "visible": True} \ No newline at end of file diff --git a/test/e2e/gui/screens/onboarding.py b/test/e2e/gui/screens/onboarding.py index 9625b67645e..608baa380e8 100755 --- a/test/e2e/gui/screens/onboarding.py +++ b/test/e2e/gui/screens/onboarding.py @@ -455,8 +455,11 @@ class CreatePasswordView(OnboardingView): def __init__(self): super(CreatePasswordView, self).__init__(onboarding_names.mainWindow_CreatePasswordView) - self._new_password_text_field = TextEdit(onboarding_names.mainWindow_passwordViewNewPassword) - self._confirm_password_text_field = TextEdit(onboarding_names.mainWindow_passwordViewNewPasswordConfirm) + self.choose_password_field = TextEdit(onboarding_names.choosePasswordField) + self.repeat_password_field = TextEdit(onboarding_names.repeatPasswordField) + self.confirm_password_button = Button(onboarding_names.confirmPasswordButton) + + # TODO: revisit and remove if obsolete self._create_button = Button(onboarding_names.mainWindow_Create_password_StatusButton) self._password_view_object = QObject(onboarding_names.mainWindow_view_PasswordView) self._strength_indicator = QObject( @@ -466,6 +469,25 @@ def __init__(self): self._show_icon = QObject(onboarding_names.mainWindow_show_icon_StatusIcon) self._hide_icon = QObject(onboarding_names.mainWindow_hide_icon_StatusIcon) + @allure.step('Set password and open Confirmation password view') + def create_password(self, value: str) -> 'SplashScreen': + self.set_password_in_first_field(value) + self.set_password_in_confirmation_field(value) + self.confirm_password_button.click() + if configs.system.get_platform() == "Darwin": + assert BiometricsView().wait_until_appears().yes_use_biometrics_button.is_visible, f"Use biometrics button is not found" + BiometricsView().wait_until_appears().maybe_later() + return SplashScreen() + + @allure.step('Fill in choose password field') + def set_password_in_first_field(self, value: str): + self.choose_password_field.text = value + + @allure.step('Set password in confirmation field') + def set_password_in_confirmation_field(self, value: str): + self.repeat_password_field.text = value + + @allure.step('Get password content from first field') def get_password_from_first_field(self) -> str: return str(self._new_password_text_field.object.displayText) @@ -516,20 +538,9 @@ def click_hide_icon(self, index): hide_icons = driver.findAllObjects(self._hide_icon.real_name) driver.mouseClick(hide_icons[index]) - @allure.step('Set password in first field') - def set_password_in_first_field(self, value: str): - self._new_password_text_field.text = value - @allure.step('Set password in confirmation field') - def set_password_in_confirmation_field(self, value: str): - self._confirm_password_text_field.text = value - @allure.step('Set password and open Confirmation password view') - def create_password(self, value: str) -> 'ConfirmPasswordView': - self.set_password_in_first_field(value) - self.set_password_in_confirmation_field(value) - self.click_create_password() - return ConfirmPasswordView().wait_until_appears() + def click_create_password(self): self._create_button.click() @@ -590,19 +601,15 @@ def get_password_from_confirmation_again_field(self) -> str: class BiometricsView(OnboardingView): def __init__(self): - super(BiometricsView, self).__init__(onboarding_names.mainWindow_TouchIDAuthView) - self._yes_use_touch_id_button = Button(onboarding_names.mainWindow_touchIdYesUseTouchIDButton) - self._prefer_password_button = Button(onboarding_names.mainWindow_touchIdIPreferToUseMyPasswordText) + super(BiometricsView, self).__init__(onboarding_names.enableBiometricsView) + self.yes_use_biometrics_button = Button(onboarding_names.enableBiometricsButton) + self.maybe_later_button = Button(onboarding_names.dontEnableBiometricsButton) - @allure.step('Select prefer password') - def prefer_password(self): - self._prefer_password_button.click() + @allure.step('Select maybe later option') + def maybe_later(self): + self.maybe_later_button.click() self.wait_until_hidden() - @allure.step('Verify TouchID button') - def is_touch_id_button_visible(self): - return self._yes_use_touch_id_button.is_visible - class LoginView(QObject): diff --git a/test/e2e/gui/screens/settings_profile.py b/test/e2e/gui/screens/settings_profile.py index 7ef86c54a84..8eccbfa37f9 100644 --- a/test/e2e/gui/screens/settings_profile.py +++ b/test/e2e/gui/screens/settings_profile.py @@ -19,7 +19,7 @@ def __init__(self): super().__init__(settings_names.mainWindow_MyProfileView) self._scroll_view = Scroll(settings_names.settingsContentBase_ScrollView) self._display_name_text_field = TextEdit(settings_names.displayName_TextEdit) - self._save_button = Button(names.mainWindow_Save_changes_StatusButton) + self.save_changes_button = Button(names.mainWindow_Save_changes_StatusButton) self._bio_text_field = TextEdit(settings_names.bio_TextEdit) self._add_more_links_label = TextLabel(settings_names.addMoreSocialLinks) self._links_list = QObject(names.linksView) diff --git a/test/e2e/helpers/OnboardingHelper.py b/test/e2e/helpers/OnboardingHelper.py index fcd1cfa67ca..0f2eb0bc223 100644 --- a/test/e2e/helpers/OnboardingHelper.py +++ b/test/e2e/helpers/OnboardingHelper.py @@ -31,7 +31,7 @@ def finalize_onboarding_and_login(profile_view, user_account): confirm_password_view = create_password_view.create_password(user_account.password) confirm_password_view.confirm_password(user_account.password) if configs.system.get_platform() == "Darwin": - BiometricsView().wait_until_appears().prefer_password() + BiometricsView().wait_until_appears().maybe_later() SplashScreen().wait_until_appears().wait_until_hidden() next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next() if configs.system.get_platform() == "Darwin": diff --git a/test/e2e/tests/crtitical_tests_prs/test_onboarding_generate_account_back_up_seed.py b/test/e2e/tests/crtitical_tests_prs/test_onboarding_generate_account_back_up_seed.py index f2f78d375aa..ad7a1a3678e 100755 --- a/test/e2e/tests/crtitical_tests_prs/test_onboarding_generate_account_back_up_seed.py +++ b/test/e2e/tests/crtitical_tests_prs/test_onboarding_generate_account_back_up_seed.py @@ -16,6 +16,7 @@ from gui.components.splash_screen import SplashScreen from gui.screens.onboarding import WelcomeToStatusView, BiometricsView, \ YourEmojihashAndIdenticonRingView +from scripts.utils.generators import random_password_string @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703421', 'Generate new keys') @@ -32,65 +33,69 @@ ]) def test_generate_account_back_up_seed_sign_out(aut, main_window, user_account, user_image: str, zoom: int, shift): + + password = random_password_string() + with step('Click generate new keys and open profile view'): - # BeforeStartedPopUp().get_started() profile_view = WelcomeToStatusView().wait_until_appears().open_create_your_profile_view() - profile_view.open_password_view() - - - - with step('Type in the display name on the profile view'): - profile_view.set_display_name(user_account.name) - assert profile_view.get_display_name() == user_account.name, \ - f'Display name is empty or was not filled in' - assert not profile_view.get_error_message, \ - f'Error message {profile_view.get_error_message} is present when it should not' - - with step('Click plus button and add user picture'): - profile_view.set_profile_picture(configs.testpath.TEST_IMAGES / user_image) - PictureEditPopup().set_zoom_shift_for_picture(zoom=zoom, shift=shift) - assert profile_view.get_profile_image is not None, f'Profile picture was not set / applied' - assert profile_view.is_next_button_enabled is True, \ - f'Next button is not enabled on profile screen' - - with step('Open password set up view, fill in the form and click back'): - create_password_view = profile_view.next() - assert not create_password_view.is_create_password_button_enabled, \ - f'Create password button is enabled when it should not' - confirm_password_view = create_password_view.create_password(user_account.password) - confirm_password_view.back() - assert create_password_view.get_password_from_first_field is not None, \ - f'Password field lost its value when clicking back button' - assert create_password_view.get_password_from_confirmation_field is not None, \ - f'Password confirmation field lost its value when clicking back button' - - with step('Click create password and open password confirmation screen'): - confirm_password_view = create_password_view.click_create_password() - assert not confirm_password_view.is_confirm_password_button_enabled, \ - f'Finalise Status password creation button is enabled when it should not' - - with step('Confirm password and login'): - confirm_password_view.confirm_password(user_account.password) - if configs.system.get_platform() == "Darwin": - assert BiometricsView().is_touch_id_button_visible(), f"TouchID button is not found" - BiometricsView().wait_until_appears().prefer_password() - SplashScreen().wait_until_appears().wait_until_hidden() - - with step('Verify emojihash and identicon ring profile screen appeared and capture the details'): - emoji_hash_identicon_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present() - chat_key = emoji_hash_identicon_view.get_chat_key - assert len(chat_key) == 49 - assert emoji_hash_identicon_view._identicon_ring.is_visible, f'Identicon ring is not present when it should' - - with step('Click Start using Status'): - next_view = emoji_hash_identicon_view.next() - if configs.system.get_platform() == "Darwin": - next_view.start_using_status() - SplashScreen().wait_until_appears().wait_until_hidden() - if not configs.system.TEST_MODE and not configs._local.DEV_BUILD: - BetaConsentPopup().confirm() - assert SigningPhrasePopup().ok_got_it_button.is_visible - SigningPhrasePopup().confirm_phrase() + create_password_view = profile_view.open_password_view() + splash_screen = create_password_view.create_password(value=password) + splash_screen.wait_until_appears().wait_until_hidden() + signing_phrase = SigningPhrasePopup().wait_until_appears() + signing_phrase.confirm_phrase() + + # with step('Type in the display name on the profile view'): + # profile_view.set_display_name(user_account.name) + # assert profile_view.get_display_name() == user_account.name, \ + # f'Display name is empty or was not filled in' + # assert not profile_view.get_error_message, \ + # f'Error message {profile_view.get_error_message} is present when it should not' + + # with step('Click plus button and add user picture'): + # profile_view.set_profile_picture(configs.testpath.TEST_IMAGES / user_image) + # PictureEditPopup().set_zoom_shift_for_picture(zoom=zoom, shift=shift) + # assert profile_view.get_profile_image is not None, f'Profile picture was not set / applied' + # assert profile_view.is_next_button_enabled is True, \ + # f'Next button is not enabled on profile screen' + + # with step('Open password set up view, fill in the form and click back'): + # create_password_view = profile_view.next() + # assert not create_password_view.is_create_password_button_enabled, \ + # f'Create password button is enabled when it should not' + # confirm_password_view = create_password_view.create_password(user_account.password) + # confirm_password_view.back() + # assert create_password_view.get_password_from_first_field is not None, \ + # f'Password field lost its value when clicking back button' + # assert create_password_view.get_password_from_confirmation_field is not None, \ + # f'Password confirmation field lost its value when clicking back button' + + # with step('Click create password and open password confirmation screen'): + # confirm_password_view = create_password_view.click_create_password() + # assert not confirm_password_view.is_confirm_password_button_enabled, \ + # f'Finalise Status password creation button is enabled when it should not' + # + # with step('Confirm password and login'): + # confirm_password_view.confirm_password(user_account.password) + # if configs.system.get_platform() == "Darwin": + # assert BiometricsView().is_touch_id_button_visible(), f"TouchID button is not found" + # BiometricsView().wait_until_appears().prefer_password() + # SplashScreen().wait_until_appears().wait_until_hidden() + + # with step('Verify emojihash and identicon ring profile screen appeared and capture the details'): + # emoji_hash_identicon_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present() + # chat_key = emoji_hash_identicon_view.get_chat_key + # assert len(chat_key) == 49 + # assert emoji_hash_identicon_view._identicon_ring.is_visible, f'Identicon ring is not present when it should' + # + # with step('Click Start using Status'): + # next_view = emoji_hash_identicon_view.next() + # if configs.system.get_platform() == "Darwin": + # next_view.start_using_status() + # SplashScreen().wait_until_appears().wait_until_hidden() + # if not configs.system.TEST_MODE and not configs._local.DEV_BUILD: + # BetaConsentPopup().confirm() + # assert SigningPhrasePopup().ok_got_it_button.is_visible + # SigningPhrasePopup().confirm_phrase() with step('Verify that user avatar background color'): avatar_color = str(main_window.left_panel.profile_button.object.identicon.asset.color.name).upper() @@ -99,34 +104,38 @@ def test_generate_account_back_up_seed_sign_out(aut, main_window, user_account, with step('Open online identifier and check the data'): online_identifier = main_window.left_panel.open_online_identifier() - assert online_identifier.get_user_name == user_account.name, \ - f'Display name in online identifier is wrong, current: {online_identifier.get_user_name}, expected: {user_account.name}' + # assert online_identifier.get_user_name == user_account.name, \ + # f'Display name in online identifier is wrong, current: {online_identifier.get_user_name}, expected: {user_account.name}' assert online_identifier._identicon_ring.is_visible, \ f'Identicon ring is not present when it should' assert str(online_identifier.object.compressedPubKey) is not None, \ f'Public key is not present' - assert chat_key in online_identifier.copy_link_to_profile(), f'Public keys should match when they dont' + # assert chat_key in online_identifier.copy_link_to_profile(), f'Public keys should match when they dont' with step('Open user profile from online identifier and check the data'): online_identifier = main_window.left_panel.open_online_identifier() profile_popup = online_identifier.open_profile_popup_from_online_identifier() - profile_popup_user_name = profile_popup.user_name - profile_popup_chat_key = profile_popup.copy_chat_key - assert profile_popup_user_name == user_account.name, \ - f'Display name in user profile is wrong, current: {profile_popup_user_name}, expected: {user_account.name}' - assert profile_popup_chat_key == chat_key, \ - f'Chat key in user profile is wrong, current: {profile_popup_chat_key}, expected: {chat_key}' + # profile_popup_user_name = profile_popup.user_name + # profile_popup_chat_key = profile_popup.copy_chat_key + # assert profile_popup_user_name == user_account.name, \ + # f'Display name in user profile is wrong, current: {profile_popup_user_name}, expected: {user_account.name}' + # assert profile_popup_chat_key == chat_key, \ + # f'Chat key in user profile is wrong, current: {profile_popup_chat_key}, expected: {chat_key}' 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() assert share_profile_popup.is_profile_qr_code_visibile, f'QR code is not displayed' - assert chat_key in profile_link, f'Profile link is wrong {profile_link}, it does not contain correct chat key' + # assert chat_key in profile_link, f'Profile link is wrong {profile_link}, it does not contain correct chat key' share_profile_popup.close() with step('Click left panel and open settings'): main_window.left_panel.click() settings = main_window.left_panel.open_settings() + profile = settings.left_panel.open_profile_settings() + profile.set_name(user_account.name) + profile.save_changes_button.click() + assert driver.waitFor(lambda: settings.left_panel.settings_section_back_up_seed_option.wait_until_appears, configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f"Back up seed option is not present" if not configs.system.TEST_MODE and not configs._local.DEV_BUILD: diff --git a/test/e2e/tests/onboarding/test_onboarding_negative_scenarios.py b/test/e2e/tests/onboarding/test_onboarding_negative_scenarios.py index d1ea1b9fe13..84f113f5a53 100644 --- a/test/e2e/tests/onboarding/test_onboarding_negative_scenarios.py +++ b/test/e2e/tests/onboarding/test_onboarding_negative_scenarios.py @@ -41,7 +41,7 @@ def test_login_with_wrong_password(aut: AUT, main_window, error: str): confirm_password_view = create_password_view.create_password(user_one.password) confirm_password_view.confirm_password(user_one.password) if configs.system.get_platform() == "Darwin": - BiometricsView().wait_until_appears().prefer_password() + BiometricsView().wait_until_appears().maybe_later() SplashScreen().wait_until_appears().wait_until_hidden() next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next() if configs.system.get_platform() == "Darwin":