From 7ec4230a32ff299d405fb089e2a2af4db6e4f90f Mon Sep 17 00:00:00 2001 From: Valentina Novgorodtceva Date: Wed, 17 Jul 2024 19:19:34 +0700 Subject: [PATCH] chore: fixes for new flow --- .../onboarding/share_usage_data_popup.py | 18 ++++++++++++++++++ test/e2e/gui/objects_map/names.py | 4 ++++ test/e2e/gui/objects_map/settings_names.py | 4 ++-- test/e2e/gui/screens/onboarding.py | 4 ++++ test/e2e/gui/screens/settings.py | 4 ++-- .../settings/test_settings_back_up_seed.py | 5 ++++- 6 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 test/e2e/gui/components/onboarding/share_usage_data_popup.py diff --git a/test/e2e/gui/components/onboarding/share_usage_data_popup.py b/test/e2e/gui/components/onboarding/share_usage_data_popup.py new file mode 100644 index 0000000000..2e090c0eb7 --- /dev/null +++ b/test/e2e/gui/components/onboarding/share_usage_data_popup.py @@ -0,0 +1,18 @@ +import allure + +from gui.components.base_popup import BasePopup +from gui.elements.button import Button +from gui.objects_map import names + + +class ShareUsageDataPopup(BasePopup): + + def __init__(self): + self._not_now_button = Button(names.not_now_StatusButton ) + self._share_usage_data_button = Button(names.share_usage_data_StatusButton) + super(ShareUsageDataPopup, self).__init__() + + @allure.step('Click not now button') + def skip(self): + self._not_now_button.click() + self.wait_until_hidden() diff --git a/test/e2e/gui/objects_map/names.py b/test/e2e/gui/objects_map/names.py index ad3ae0a4c1..348f4cc913 100644 --- a/test/e2e/gui/objects_map/names.py +++ b/test/e2e/gui/objects_map/names.py @@ -127,6 +127,10 @@ i_m_ready_to_use_Status_Desktop_Beta_StatusButton = {"container": statusDesktop_ headline_StatusTitleSubtitle = {"container": statusDesktop_mainWindow_overlay, "id": "headline", "type": "StatusTitleSubtitle", "unnamed": 1, "visible": True} keys_exist_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "type": "StatusBaseText", "unnamed": 1, "visible": True} +# Share Usage Data Popup +not_now_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "notShareMetricsButton", "type": "StatusButton", "visible": True} +share_usage_data_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "shareMetricsButton", "type": "StatusButton", "visible": True} + """ Communities """ # Create Community Banner diff --git a/test/e2e/gui/objects_map/settings_names.py b/test/e2e/gui/objects_map/settings_names.py index cec1df5797..c5dcddb35e 100644 --- a/test/e2e/gui/objects_map/settings_names.py +++ b/test/e2e/gui/objects_map/settings_names.py @@ -13,9 +13,9 @@ LeftTabView_ScrollView = {"container": mainWindow_LeftTabView, "type": "StatusSc LeftTabProfileMenu = {"container": LeftTabView_ScrollView, "objectName": "leftTabViewProfileMenu", "type": "MenuPanel", "visible": True} mainWindow_Settings_StatusNavigationPanelHeadline = {"container": mainWindow_LeftTabView, "type": "StatusNavigationPanelHeadline", "unnamed": 1, "visible": True} mainWindow_scrollView_StatusScrollView = {"container": mainWindow_LeftTabView, "id": "scrollView", "type": "StatusScrollView", "unnamed": 1, "visible": True} -scrollView_MenuItem_StatusNavigationListItem = {"container": LeftTabView_ScrollView, "type": "StatusNavigationListItem", "visible": True} +scrollView_MenuItem_StatusNavigationListItem = {"container": mainWindow_scrollView_StatusScrollView, "type": "StatusNavigationListItem", "visible": True} scrollView_Flickable = {"container": mainWindow_scrollView_StatusScrollView, "type": "Flickable", "unnamed": 1, "visible": True} -settingsBackUpSeedPhraseOption = {"container": LeftTabView_ScrollView, "objectName": "18-MainMenuItem", "type": "StatusNavigationListItem", "visible": True} +settingsBackUpSeedPhraseOption = {"container": mainWindow_scrollView_StatusScrollView, "objectName": "19-MainMenuItem", "type": "StatusNavigationListItem", "visible": True} settingsWalletOption = {"container": LeftTabView_ScrollView, "objectName": "5-AppMenuItem", "type": "StatusNavigationListItem", "visible": True} # Communities View diff --git a/test/e2e/gui/screens/onboarding.py b/test/e2e/gui/screens/onboarding.py index 427efdd525..86c4f561d2 100755 --- a/test/e2e/gui/screens/onboarding.py +++ b/test/e2e/gui/screens/onboarding.py @@ -13,6 +13,7 @@ import driver from constants import ColorCodes from driver.objects_access import walk_children from gui.components.onboarding.keys_already_exist_popup import KeysAlreadyExistPopup +from gui.components.onboarding.share_usage_data_popup import ShareUsageDataPopup from gui.components.os.open_file_dialogs import OpenFileDialog from gui.components.picture_edit_popup import PictureEditPopup from gui.components.splash_screen import SplashScreen @@ -83,16 +84,19 @@ class KeysView(OnboardingView): @allure.step('Open Profile view') def generate_new_keys(self) -> 'YourProfileView': self._generate_key_button.click() + ShareUsageDataPopup().skip() return YourProfileView().verify_profile_view_present() @allure.step('Open Keycard Init view') def generate_key_for_new_keycard(self) -> 'KeycardInitView': self._generate_key_for_new_keycard_button.click() + ShareUsageDataPopup().skip() return KeycardInitView().wait_until_appears() @allure.step('Open Import Seed Phrase view') def open_import_seed_phrase_view(self) -> 'ImportSeedPhraseView': self._import_seed_phrase_button.click() + ShareUsageDataPopup().skip() return ImportSeedPhraseView().wait_until_appears() @allure.step('Open Enter Seed Phrase view') diff --git a/test/e2e/gui/screens/settings.py b/test/e2e/gui/screens/settings.py index 4b9d7e811e..a4a7353f02 100644 --- a/test/e2e/gui/screens/settings.py +++ b/test/e2e/gui/screens/settings.py @@ -91,7 +91,7 @@ class LeftPanel(QObject): return ChangePasswordView() @allure.step('Choose back up seed phrase in settings') - @handle_settings_opening(BackUpYourSeedPhrasePopUp, '18-MainMenuItem') + @handle_settings_opening(BackUpYourSeedPhrasePopUp, '19-MainMenuItem') def open_back_up_seed_phrase(self, click_attempts: int = 2) -> 'BackUpYourSeedPhrasePopUp': assert BackUpYourSeedPhrasePopUp().exists, 'Back up your seed phrase modal was not opened' return BackUpYourSeedPhrasePopUp() @@ -103,7 +103,7 @@ class LeftPanel(QObject): return SyncingSettingsView() @allure.step('Choose sign out and quit in settings') - @handle_settings_opening(SignOutPopup, '17-ExtraMenuItem') + @handle_settings_opening(SignOutPopup, '18-ExtraMenuItem') def open_sign_out_and_quit(self, click_attempts: int = 2) -> 'SignOutPopup': assert SignOutPopup().exists, 'Sign out modal was not opened' return SignOutPopup() diff --git a/test/e2e/tests/settings/test_settings_back_up_seed.py b/test/e2e/tests/settings/test_settings_back_up_seed.py index eeda59aeeb..86649cc18f 100644 --- a/test/e2e/tests/settings/test_settings_back_up_seed.py +++ b/test/e2e/tests/settings/test_settings_back_up_seed.py @@ -1,6 +1,8 @@ import allure import pytest from allure_commons._allure import step + +import driver from . import marks import configs @@ -16,7 +18,8 @@ pytestmark = marks def test_back_up_seed_phrase(main_screen: MainWindow): with step('Check back up seed phrase option is visible for new account'): settings = main_screen.left_panel.open_settings() - assert settings.left_panel.settings_section_back_up_seed_option.exists, f"Back up seed option is not present" + 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: assert BackUpSeedPhraseBanner().does_back_up_seed_banner_exist(), "Back up seed banner is not present" assert BackUpSeedPhraseBanner().is_back_up_now_button_present(), 'Back up now button is not present'