2023-08-29 14:43:00 +00:00
|
|
|
import allure
|
|
|
|
|
2024-07-10 10:00:25 +00:00
|
|
|
import configs.system
|
2023-09-22 08:44:29 +00:00
|
|
|
from gui.components.back_up_your_seed_phrase_popup import BackUpYourSeedPhrasePopUp
|
2023-10-06 08:33:42 +00:00
|
|
|
from gui.elements.object import QObject
|
2023-10-30 08:59:01 +00:00
|
|
|
from gui.elements.scroll import Scroll
|
2024-07-09 10:05:39 +00:00
|
|
|
from gui.objects_map import settings_names
|
2024-05-02 15:04:06 +00:00
|
|
|
from gui.screens.settings_advanced import AdvancedSettingsView
|
2023-10-13 15:55:44 +00:00
|
|
|
from gui.screens.settings_communities import CommunitiesSettingsView
|
2023-12-11 07:20:57 +00:00
|
|
|
from gui.screens.settings_ens_usernames import ENSSettingsView
|
2023-11-02 13:51:38 +00:00
|
|
|
from gui.screens.settings_keycard import KeycardSettingsView
|
2023-10-13 15:55:44 +00:00
|
|
|
from gui.screens.settings_messaging import MessagingSettingsView
|
|
|
|
from gui.screens.settings_profile import ProfileSettingsView
|
|
|
|
from gui.screens.settings_syncing import SyncingSettingsView
|
|
|
|
from gui.screens.settings_wallet import WalletSettingsView
|
2024-02-10 10:02:47 +00:00
|
|
|
from gui.screens.settings_password import ChangePasswordView
|
2023-12-01 04:32:44 +00:00
|
|
|
from gui.components.settings.sign_out_popup import SignOutPopup
|
2024-07-10 10:00:25 +00:00
|
|
|
|
2024-08-07 16:19:18 +00:00
|
|
|
from scripts.utils.decorators import handle_settings_opening
|
2023-08-29 14:43:00 +00:00
|
|
|
|
|
|
|
|
2023-09-11 18:24:13 +00:00
|
|
|
class LeftPanel(QObject):
|
2023-08-29 14:43:00 +00:00
|
|
|
|
|
|
|
def __init__(self):
|
2024-07-09 10:05:39 +00:00
|
|
|
super().__init__(settings_names.mainWindow_LeftTabView)
|
|
|
|
self._settings_section_template = QObject(settings_names.scrollView_MenuItem_StatusNavigationListItem)
|
2024-07-10 05:00:53 +00:00
|
|
|
self._scroll = Scroll(settings_names.mainWindow_scrollView_StatusScrollView)
|
2024-07-10 10:00:25 +00:00
|
|
|
self.settings_section_back_up_seed_option = QObject(settings_names.settingsBackUpSeedPhraseOption)
|
2024-07-09 10:05:39 +00:00
|
|
|
self._settings_section_wallet_option = QObject(settings_names.settingsWalletOption)
|
2023-08-29 14:43:00 +00:00
|
|
|
|
2024-07-19 06:43:44 +00:00
|
|
|
@allure.step('Wait until appears {0}')
|
|
|
|
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
|
|
|
|
self._settings_section_template.wait_until_appears(timeout_msec)
|
|
|
|
return self
|
|
|
|
|
2023-10-02 09:21:12 +00:00
|
|
|
def _open_settings(self, object_name: str):
|
|
|
|
self._settings_section_template.real_name['objectName'] = object_name
|
2023-10-30 08:59:01 +00:00
|
|
|
if not self._settings_section_template.is_visible:
|
2024-07-10 05:00:53 +00:00
|
|
|
self._scroll.vertical_scroll_down(self._settings_section_template)
|
2023-08-29 14:43:00 +00:00
|
|
|
self._settings_section_template.click()
|
|
|
|
|
2023-09-11 18:24:13 +00:00
|
|
|
@allure.step('Open messaging settings')
|
2024-07-10 10:00:25 +00:00
|
|
|
@handle_settings_opening(MessagingSettingsView, '4-AppMenuItem')
|
|
|
|
def open_messaging_settings(self, click_attempts: int = 2) -> 'MessagingSettingsView':
|
2024-07-19 06:43:44 +00:00
|
|
|
assert MessagingSettingsView().wait_until_appears(), 'Messaging settings view was not opened'
|
2023-09-11 18:24:13 +00:00
|
|
|
return MessagingSettingsView()
|
|
|
|
|
2023-08-29 14:43:00 +00:00
|
|
|
@allure.step('Open communities settings')
|
2024-08-05 10:55:28 +00:00
|
|
|
@handle_settings_opening(CommunitiesSettingsView, '12-AppMenuItem')
|
2023-12-12 14:05:33 +00:00
|
|
|
def open_communities_settings(self, attempts: int = 2) -> 'CommunitiesSettingsView':
|
2024-07-10 10:00:25 +00:00
|
|
|
assert CommunitiesSettingsView().exists, 'Community settings view was not opened'
|
|
|
|
return CommunitiesSettingsView()
|
2023-08-29 14:43:00 +00:00
|
|
|
|
2023-09-15 04:17:07 +00:00
|
|
|
@allure.step('Open wallet settings')
|
2024-07-10 10:00:25 +00:00
|
|
|
@handle_settings_opening(WalletSettingsView, '5-AppMenuItem')
|
|
|
|
def open_wallet_settings(self, click_attempts: int = 2) -> 'WalletSettingsView':
|
2024-07-19 06:43:44 +00:00
|
|
|
assert WalletSettingsView().wait_until_appears(), 'Wallet settings view was not opened'
|
2024-03-05 08:18:42 +00:00
|
|
|
return WalletSettingsView()
|
2023-09-15 04:17:07 +00:00
|
|
|
|
2023-09-20 11:35:56 +00:00
|
|
|
@allure.step('Open profile settings')
|
2024-07-10 10:00:25 +00:00
|
|
|
@handle_settings_opening(ProfileSettingsView, '0-MainMenuItem')
|
|
|
|
def open_profile_settings(self, click_attempts: int = 2) -> 'ProfileSettingsView':
|
|
|
|
assert ProfileSettingsView().exists, 'Profile settings view was not opened'
|
2023-09-20 11:35:56 +00:00
|
|
|
return ProfileSettingsView()
|
|
|
|
|
2024-02-10 10:02:47 +00:00
|
|
|
@allure.step('Open password settings')
|
2024-07-10 10:00:25 +00:00
|
|
|
@handle_settings_opening(ChangePasswordView, '1-MainMenuItem')
|
|
|
|
def open_password_settings(self, click_attempts: int = 2) -> 'ChangePasswordView':
|
|
|
|
assert ChangePasswordView().exists, 'Password settings view was not opened'
|
2024-02-10 10:02:47 +00:00
|
|
|
return ChangePasswordView()
|
|
|
|
|
2023-09-22 08:44:29 +00:00
|
|
|
@allure.step('Choose back up seed phrase in settings')
|
2024-08-05 10:55:28 +00:00
|
|
|
@handle_settings_opening(BackUpYourSeedPhrasePopUp, '18-MainMenuItem')
|
2024-07-10 10:00:25 +00:00
|
|
|
def open_back_up_seed_phrase(self, click_attempts: int = 2) -> 'BackUpYourSeedPhrasePopUp':
|
|
|
|
assert BackUpYourSeedPhrasePopUp().exists, 'Back up your seed phrase modal was not opened'
|
2023-09-22 08:44:29 +00:00
|
|
|
return BackUpYourSeedPhrasePopUp()
|
|
|
|
|
2023-09-28 06:45:49 +00:00
|
|
|
@allure.step('Open syncing settings')
|
2024-07-10 10:00:25 +00:00
|
|
|
@handle_settings_opening(SyncingSettingsView, '9-MainMenuItem')
|
|
|
|
def open_syncing_settings(self, click_attempts: int = 2) -> 'SyncingSettingsView':
|
|
|
|
assert SyncingSettingsView().exists, 'Syncing settings view was not opened'
|
|
|
|
return SyncingSettingsView()
|
2023-09-28 06:45:49 +00:00
|
|
|
|
2023-10-30 08:59:01 +00:00
|
|
|
@allure.step('Choose sign out and quit in settings')
|
2024-08-05 10:55:28 +00:00
|
|
|
@handle_settings_opening(SignOutPopup, '17-ExtraMenuItem')
|
2024-07-10 10:00:25 +00:00
|
|
|
def open_sign_out_and_quit(self, click_attempts: int = 2) -> 'SignOutPopup':
|
|
|
|
assert SignOutPopup().exists, 'Sign out modal was not opened'
|
2023-12-01 04:32:44 +00:00
|
|
|
return SignOutPopup()
|
2023-10-30 08:59:01 +00:00
|
|
|
|
2023-11-02 13:51:38 +00:00
|
|
|
@allure.step('Open keycard settings')
|
2024-08-05 10:55:28 +00:00
|
|
|
@handle_settings_opening(KeycardSettingsView, '13-MainMenuItem')
|
2024-07-10 10:00:25 +00:00
|
|
|
def open_keycard_settings(self, click_attempts: int = 2) -> 'KeycardSettingsView':
|
2024-07-19 06:43:44 +00:00
|
|
|
assert KeycardSettingsView().wait_until_appears(), f'Keycard settings view was not opened'
|
2023-11-02 13:51:38 +00:00
|
|
|
return KeycardSettingsView()
|
|
|
|
|
2023-12-11 07:20:57 +00:00
|
|
|
@allure.step('Open ENS usernames settings')
|
2024-07-10 10:00:25 +00:00
|
|
|
@handle_settings_opening(ENSSettingsView, '3-MainMenuItem')
|
|
|
|
def open_ens_usernames_settings(self, click_attempts: int = 2) -> 'ENSSettingsView':
|
2024-07-31 05:18:37 +00:00
|
|
|
assert ENSSettingsView().wait_until_appears(), 'ENS settings view was not opened'
|
2023-12-11 07:20:57 +00:00
|
|
|
return ENSSettingsView()
|
|
|
|
|
2024-05-02 15:04:06 +00:00
|
|
|
@allure.step('Open advanced settings')
|
2024-08-05 10:55:28 +00:00
|
|
|
@handle_settings_opening(AdvancedSettingsView, '10-SettingsMenuItem')
|
2024-07-10 10:00:25 +00:00
|
|
|
def open_advanced_settings(self, click_attempts: int = 2) -> 'AdvancedSettingsView':
|
2024-09-06 10:44:49 +00:00
|
|
|
assert AdvancedSettingsView().wait_until_appears(), 'Advanced settings view was not opened'
|
2024-05-02 15:04:06 +00:00
|
|
|
return AdvancedSettingsView()
|
|
|
|
|
2023-08-29 14:43:00 +00:00
|
|
|
|
2023-09-11 18:24:13 +00:00
|
|
|
class SettingsScreen(QObject):
|
|
|
|
|
|
|
|
def __init__(self):
|
2024-07-09 10:05:39 +00:00
|
|
|
super().__init__(settings_names.mainWindow_ProfileLayout)
|
2023-09-11 18:24:13 +00:00
|
|
|
self.left_panel = LeftPanel()
|