mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-22 19:48:52 +00:00
Settings - set name, bio and social links and backup seed phrase (#116)
This commit is contained in:
parent
230fe2aa02
commit
45a701355a
2
test/e2e/constants/social_links.py
Normal file
2
test/e2e/constants/social_links.py
Normal file
@ -0,0 +1,2 @@
|
||||
# List of social links
|
||||
social_links = ['testerTwitter', 'status.im', 'testerGithub', 'testerTube', 'testerDiscord', 'testerTelegram', 'customLink', 'https://status.im/']
|
@ -11,7 +11,9 @@ user_account_two = UserAccount('athletic', '0000000000', [
|
||||
])
|
||||
user_account_three = UserAccount('nervous', '000000000', [])
|
||||
|
||||
user_account_one_changed = UserAccount('squisher', 'NewPassword@12345', [])
|
||||
user_account_one_changed_password = UserAccount('squisher', 'NewPassword@12345', [])
|
||||
|
||||
user_account_one_changed_name = UserAccount('NewUserName', '0000000000', [])
|
||||
|
||||
community_params = {
|
||||
'name': 'Name',
|
||||
|
@ -0,0 +1,6 @@
|
||||
from gui.elements.qt.object import QObject
|
||||
|
||||
|
||||
class BackUpSeedPhraseBanner(QObject):
|
||||
def __init__(self):
|
||||
super(BackUpSeedPhraseBanner, self).__init__('mainWindow_secureYourSeedPhraseBanner_ModuleWarning')
|
@ -1,8 +1,11 @@
|
||||
import re
|
||||
import time
|
||||
import typing
|
||||
|
||||
import allure
|
||||
|
||||
import configs
|
||||
import configs.timeouts
|
||||
import driver
|
||||
from gui.components.base_popup import BasePopup
|
||||
from gui.elements.qt.button import Button
|
||||
from gui.elements.qt.check_box import CheckBox
|
||||
@ -14,18 +17,20 @@ class BackUpYourSeedPhrasePopUp(BasePopup):
|
||||
|
||||
def __init__(self):
|
||||
super(BackUpYourSeedPhrasePopUp, self).__init__()
|
||||
self._i_have_a_pen_and_paper_check_box = CheckBox('mainWallet_AddEditAccountPopup_HavePenAndPaperCheckBox')
|
||||
self._i_know_where_i_ll_store_it_check_box = CheckBox(
|
||||
'mainWallet_AddEditAccountPopup_StoringSeedPhraseConfirmedCheckBox')
|
||||
self._i_am_ready_to_write_down_seed_phrase_check_box = CheckBox(
|
||||
'mainWallet_AddEditAccountPopup_SeedPhraseWrittenCheckBox')
|
||||
self._primary_button = Button('mainWallet_AddEditAccountPopup_PrimaryButton')
|
||||
self._reveal_seed_phrase_button = Button('mainWallet_AddEditAccountPopup_RevealSeedPhraseButton')
|
||||
self._seed_phrase_panel = QObject('confirmSeedPhrasePanel_StatusSeedPhraseInput')
|
||||
self._seed_phrase_word_component = QObject('mainWallet_AddEditAccountPopup_EnterSeedPhraseWordComponent')
|
||||
self._prove_word_seed_phrase_text_edit = TextEdit('mainWallet_AddEditAccountPopup_EnterSeedPhraseWord')
|
||||
self._acknowledge_check_box = CheckBox('mainWallet_AddEditAccountPopup_SeedBackupAknowledgeCheckBox')
|
||||
self._seed_phrase_name_text_edit = TextEdit('mainWallet_AddEditAccountPopup_GeneratedSeedPhraseKeyName')
|
||||
self._i_have_a_pen_and_paper_check_box = CheckBox('i_have_a_pen_and_paper_StatusCheckBox')
|
||||
self._i_know_where_i_ll_store_it_check_box = CheckBox('i_know_where_I_ll_store_it_StatusCheckBox')
|
||||
self._i_am_ready_to_write_down_seed_phrase_check_box = CheckBox('i_am_ready_to_write_down_StatusCheckBox')
|
||||
self._not_now_button = Button('not_Now_StatusButton')
|
||||
self._confirm_seed_phrase_button = Button('confirm_Seed_Phrase_StatusButton')
|
||||
self._reveal_seed_phrase_button = Button('reveal_seed_phrase_StatusButton')
|
||||
self._continue_button = Button('continue_StatusButton')
|
||||
self._seed_phrase_panel = QObject('backup_seed_phrase_popup_StatusSeedPhraseInput_placeholder')
|
||||
self._seed_phrase_first_word_component = QObject('confirmFirstWord')
|
||||
self._prove_first_word_seed_phrase_text_edit = TextEdit('confirmFirstWord_inputText')
|
||||
self._seed_phrase_second_word_component = QObject('confirmSecondWord')
|
||||
self._prove_second_word_seed_phrase_text_edit = TextEdit('confirmSecondWord_inputText')
|
||||
self._acknowledge_check_box = CheckBox('i_acknowledge_StatusCheckBox')
|
||||
self._complete_and_delete_button = Button('completeAndDeleteSeedPhraseButton')
|
||||
|
||||
@allure.step('Set have pen and paper checkbox')
|
||||
def set_have_pen_and_paper(self, value: bool):
|
||||
@ -42,13 +47,19 @@ class BackUpYourSeedPhrasePopUp(BasePopup):
|
||||
self._i_know_where_i_ll_store_it_check_box.set(value)
|
||||
return self
|
||||
|
||||
@allure.step('Click next button')
|
||||
def next(self):
|
||||
self._primary_button.click()
|
||||
@allure.step('Click confirm seed phrase button')
|
||||
def confirm_seed_phrase(self):
|
||||
self._confirm_seed_phrase_button.click()
|
||||
return self
|
||||
|
||||
@allure.step('Click continue seed phrase button')
|
||||
def continue_seed_phrase(self):
|
||||
self._continue_button.click()
|
||||
return self
|
||||
|
||||
@allure.step('Click reveal seed phrase button')
|
||||
def reveal_seed_phrase(self):
|
||||
time.sleep(1)
|
||||
self._reveal_seed_phrase_button.click()
|
||||
return self
|
||||
|
||||
@ -56,39 +67,46 @@ class BackUpYourSeedPhrasePopUp(BasePopup):
|
||||
def get_seed_phrases(self):
|
||||
phrases = []
|
||||
for phrase_n in range(1, 13):
|
||||
object_name = f'SeedPhraseWordAtIndex-{phrase_n}'
|
||||
object_name = f'ConfirmSeedPhrasePanel_StatusSeedPhraseInput_{phrase_n}'
|
||||
self._seed_phrase_panel.real_name['objectName'] = object_name
|
||||
phrases.append(str(self._seed_phrase_panel.object.textEdit.input.edit.text))
|
||||
return phrases
|
||||
|
||||
@allure.step('Confirm word in seed phrase')
|
||||
def confirm_word(self, seed_phrase: typing.List[str]):
|
||||
word_index = int(str(self._seed_phrase_word_component.object.label).split('Word #')[1])
|
||||
@allure.step('Confirm first word in seed phrase')
|
||||
def confirm_first_word(self, seed_phrase: typing.List[str]):
|
||||
word_index = int(re.findall(r'\d+', str(self._seed_phrase_first_word_component.object.titleText))[0])
|
||||
seed_word = seed_phrase[word_index - 1]
|
||||
self._prove_word_seed_phrase_text_edit.text = seed_word
|
||||
self._prove_first_word_seed_phrase_text_edit.text = seed_word
|
||||
return self
|
||||
|
||||
@allure.step('Confirm second word in seed phrase')
|
||||
def confirm_second_word(self, seed_phrase: typing.List[str]):
|
||||
word_index = int(re.findall(r'\d+', str(self._seed_phrase_second_word_component.object.titleText))[0])
|
||||
seed_word = seed_phrase[word_index - 1]
|
||||
self._prove_second_word_seed_phrase_text_edit.text = seed_word
|
||||
return self
|
||||
|
||||
@allure.step('Set aknowledge checkbox')
|
||||
def set_acknowledge(self, value: bool):
|
||||
time.sleep(1)
|
||||
self._acknowledge_check_box.set(value)
|
||||
return self
|
||||
|
||||
@allure.step('Set seed phrase name')
|
||||
def set_seed_phrase_name(self, value: str):
|
||||
self._seed_phrase_name_text_edit.text = value
|
||||
@allure.step('Complete and delete seed phrase')
|
||||
def complete_and_delete_seed_phrase(self):
|
||||
self._complete_and_delete_button.click()
|
||||
return self
|
||||
|
||||
@allure.step('Wait until hidden {0}')
|
||||
def wait_until_hidden(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
|
||||
self._seed_phrase_name_text_edit.wait_until_hidden()
|
||||
|
||||
@allure.step('Generate seed phrase')
|
||||
def generate_seed_phrase(self, name: str):
|
||||
@allure.step('Back up seed phrase')
|
||||
def back_up_seed_phrase(self):
|
||||
self.set_have_pen_and_paper(True).set_ready_to_write_seed_phrase(True).set_know_where_store_it(True)
|
||||
self.next().reveal_seed_phrase()
|
||||
self.confirm_seed_phrase()
|
||||
self.reveal_seed_phrase()
|
||||
seed_phrases = self.get_seed_phrases()
|
||||
self.next().confirm_word(seed_phrases)
|
||||
self.next().confirm_word(seed_phrases)
|
||||
self.next().set_acknowledge(True)
|
||||
self.next().set_seed_phrase_name(name)
|
||||
self.next().wait_until_hidden()
|
||||
self.confirm_seed_phrase()
|
||||
self.confirm_first_word(seed_phrases)
|
||||
self.continue_seed_phrase()
|
||||
self.confirm_second_word(seed_phrases)
|
||||
self.continue_seed_phrase()
|
||||
self.set_acknowledge(True)
|
||||
self.complete_and_delete_seed_phrase().wait_until_hidden()
|
||||
|
18
test/e2e/gui/components/settings/changes_detected_popup.py
Normal file
18
test/e2e/gui/components/settings/changes_detected_popup.py
Normal file
@ -0,0 +1,18 @@
|
||||
import allure
|
||||
|
||||
from gui.components.base_popup import BasePopup
|
||||
from gui.elements.qt.button import Button
|
||||
from gui.elements.qt.object import QObject
|
||||
from gui.elements.qt.text_edit import TextEdit
|
||||
|
||||
|
||||
class ChangesDetectedToastMessage(QObject):
|
||||
|
||||
def __init__(self):
|
||||
super(ChangesDetectedToastMessage, self).__init__('mainWindow_settingsDirtyToastMessage_SettingsDirtyToastMessage')
|
||||
self._save_button = Button('settingsSave_StatusButton')
|
||||
|
||||
@allure.step('Save changes')
|
||||
def save(self):
|
||||
self._save_button.click()
|
||||
self.wait_until_hidden()
|
43
test/e2e/gui/components/social_links_popup.py
Normal file
43
test/e2e/gui/components/social_links_popup.py
Normal file
@ -0,0 +1,43 @@
|
||||
import time
|
||||
import typing
|
||||
|
||||
import allure
|
||||
|
||||
from .base_popup import BasePopup
|
||||
from ..elements.qt.button import Button
|
||||
from ..elements.qt.object import QObject
|
||||
from ..elements.qt.text_edit import TextEdit
|
||||
|
||||
|
||||
class SocialLinksPopup(BasePopup):
|
||||
|
||||
def __init__(self):
|
||||
super(SocialLinksPopup, self).__init__()
|
||||
self._add_social_link_list_item = QObject('socialLink_StatusListItem')
|
||||
self._social_link_text_field = TextEdit('edit_TextEdit')
|
||||
self._add_button = Button('add_StatusButton')
|
||||
|
||||
@allure.step('Get social link')
|
||||
def _get_list_item(self, title: str) -> QObject:
|
||||
self._add_social_link_list_item.real_name['title'] = title
|
||||
return self._add_social_link_list_item
|
||||
|
||||
@allure.step('Get social link field')
|
||||
def _get_text_field(self, occurrence: int) -> QObject:
|
||||
key = 'occurrence'
|
||||
if occurrence:
|
||||
self._social_link_text_field.real_name[key] = occurrence + 1
|
||||
else:
|
||||
if key in self._social_link_text_field.real_name:
|
||||
del self._social_link_text_field.real_name[key]
|
||||
return self._social_link_text_field
|
||||
|
||||
@allure.step('Add link to link field')
|
||||
def add_link(self, network: str, links: typing.List[str]):
|
||||
self._get_list_item(network).click()
|
||||
time.sleep(0.5)
|
||||
for occurrence, link in enumerate(links):
|
||||
self._get_text_field(occurrence).text = link
|
||||
self._add_button.click()
|
||||
self.wait_until_hidden()
|
||||
|
100
test/e2e/gui/components/wallet/back_up_your_seed_phrase_popup.py
Normal file
100
test/e2e/gui/components/wallet/back_up_your_seed_phrase_popup.py
Normal file
@ -0,0 +1,100 @@
|
||||
import typing
|
||||
|
||||
import allure
|
||||
|
||||
import configs
|
||||
from driver.toplevel_window import set_focus
|
||||
from gui.components.base_popup import BasePopup
|
||||
from gui.elements.qt.button import Button
|
||||
from gui.elements.qt.check_box import CheckBox
|
||||
from gui.elements.qt.object import QObject
|
||||
from gui.elements.qt.text_edit import TextEdit
|
||||
|
||||
|
||||
class BackUpYourSeedPhrasePopUp(BasePopup):
|
||||
|
||||
def __init__(self):
|
||||
super(BackUpYourSeedPhrasePopUp, self).__init__()
|
||||
self._i_have_a_pen_and_paper_check_box = CheckBox('mainWallet_AddEditAccountPopup_HavePenAndPaperCheckBox')
|
||||
self._i_know_where_i_ll_store_it_check_box = CheckBox(
|
||||
'mainWallet_AddEditAccountPopup_StoringSeedPhraseConfirmedCheckBox')
|
||||
self._i_am_ready_to_write_down_seed_phrase_check_box = CheckBox(
|
||||
'mainWallet_AddEditAccountPopup_SeedPhraseWrittenCheckBox')
|
||||
self._primary_button = Button('mainWallet_AddEditAccountPopup_PrimaryButton')
|
||||
self._reveal_seed_phrase_button = Button('mainWallet_AddEditAccountPopup_RevealSeedPhraseButton')
|
||||
self._seed_phrase_panel = QObject('confirmSeedPhrasePanel_StatusSeedPhraseInput')
|
||||
self._seed_phrase_word_component = QObject('mainWallet_AddEditAccountPopup_EnterSeedPhraseWordComponent')
|
||||
self._prove_word_seed_phrase_text_edit = TextEdit('mainWallet_AddEditAccountPopup_EnterSeedPhraseWord')
|
||||
self._acknowledge_check_box = CheckBox('mainWallet_AddEditAccountPopup_SeedBackupAknowledgeCheckBox')
|
||||
self._seed_phrase_name_text_edit = TextEdit('mainWallet_AddEditAccountPopup_GeneratedSeedPhraseKeyName')
|
||||
self._complete_and_delete_button = Button('completeAndDeleteSeedPhraseButton')
|
||||
|
||||
@allure.step('Set have pen and paper checkbox')
|
||||
def set_have_pen_and_paper(self, value: bool):
|
||||
self._i_have_a_pen_and_paper_check_box.set(value)
|
||||
return self
|
||||
|
||||
@allure.step('Set ready to write checkbox')
|
||||
def set_ready_to_write_seed_phrase(self, value: bool):
|
||||
self._i_am_ready_to_write_down_seed_phrase_check_box.set(value)
|
||||
return self
|
||||
|
||||
@allure.step('Set know where will store it checkbox')
|
||||
def set_know_where_store_it(self, value: bool):
|
||||
self._i_know_where_i_ll_store_it_check_box.set(value)
|
||||
return self
|
||||
|
||||
@allure.step('Click next button')
|
||||
def next(self):
|
||||
self._primary_button.click()
|
||||
return self
|
||||
|
||||
@allure.step('Click reveal seed phrase button')
|
||||
def reveal_seed_phrase(self):
|
||||
self._reveal_seed_phrase_button.click()
|
||||
return self
|
||||
|
||||
@allure.step('Get seed phrases list')
|
||||
def get_seed_phrases(self):
|
||||
phrases = []
|
||||
for phrase_n in range(1, 13):
|
||||
object_name = f'SeedPhraseWordAtIndex-{phrase_n}'
|
||||
self._seed_phrase_panel.real_name['objectName'] = object_name
|
||||
phrases.append(str(self._seed_phrase_panel.object.textEdit.input.edit.text))
|
||||
return phrases
|
||||
|
||||
@allure.step('Confirm word in seed phrase')
|
||||
def confirm_word(self, seed_phrase: typing.List[str]):
|
||||
word_index = int(str(self._seed_phrase_word_component.object.label).split('Word #')[1])
|
||||
seed_word = seed_phrase[word_index - 1]
|
||||
self._prove_word_seed_phrase_text_edit.text = seed_word
|
||||
return self
|
||||
|
||||
@allure.step('Set aknowledge checkbox')
|
||||
def set_acknowledge(self, value: bool):
|
||||
self._acknowledge_check_box.set(value)
|
||||
return self
|
||||
|
||||
@allure.step('Set seed phrase name')
|
||||
def set_seed_phrase_name(self, value: str):
|
||||
self._seed_phrase_name_text_edit.text = value
|
||||
return self
|
||||
|
||||
def complete_and_delete_seed_phrase(self):
|
||||
self._complete_and_delete_button.click()
|
||||
return self
|
||||
|
||||
@allure.step('Wait until hidden {0}')
|
||||
def wait_until_hidden(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
|
||||
self._seed_phrase_name_text_edit.wait_until_hidden()
|
||||
|
||||
@allure.step('Generate seed phrase')
|
||||
def generate_seed_phrase(self, name: str):
|
||||
self.set_have_pen_and_paper(True).set_ready_to_write_seed_phrase(True).set_know_where_store_it(True)
|
||||
self.next().reveal_seed_phrase()
|
||||
seed_phrases = self.get_seed_phrases()
|
||||
self.next().confirm_word(seed_phrases)
|
||||
self.next().confirm_word(seed_phrases)
|
||||
self.next().set_acknowledge(True)
|
||||
self.next().set_seed_phrase_name(name)
|
||||
self.next().wait_until_hidden()
|
@ -6,7 +6,7 @@ from gui.components.wallet.authenticate_popup import AuthenticatePopup
|
||||
import configs
|
||||
import constants.wallet
|
||||
import driver
|
||||
from gui.components.back_up_your_seed_phrase_popup import BackUpYourSeedPhrasePopUp
|
||||
from gui.components.wallet.back_up_your_seed_phrase_popup import BackUpYourSeedPhrasePopUp
|
||||
from gui.components.base_popup import BasePopup
|
||||
from gui.components.emoji_popup import EmojiPopup
|
||||
from gui.elements.qt.button import Button
|
||||
|
@ -25,7 +25,7 @@ i_know_where_I_ll_store_it_StatusCheckBox = {"checkable": True, "container": sta
|
||||
i_am_ready_to_write_down_StatusCheckBox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "objectName": "Acknowledgements_writeDown", "type": "StatusCheckBox", "visible": True}
|
||||
not_Now_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "type": "StatusButton", "unnamed": 1, "visible": True}
|
||||
confirm_Seed_Phrase_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "BackupSeedModal_nextButton", "type": "StatusButton", "visible": True}
|
||||
backup_seed_phrase_popup_ConfirmSeedPhrasePanel_StatusSeedPhraseInput_placeholder = {"container": statusDesktop_mainWindow_overlay, "objectName": "ConfirmSeedPhrasePanel_StatusSeedPhraseInput_%WORD_NO%", "type": "StatusSeedPhraseInput", "visible": True}
|
||||
backup_seed_phrase_popup_StatusSeedPhraseInput_placeholder = {"container": statusDesktop_mainWindow_overlay, "objectName": "ConfirmSeedPhrasePanel_StatusSeedPhraseInput_%WORD_NO%", "type": "StatusSeedPhraseInput", "visible": True}
|
||||
reveal_seed_phrase_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "ConfirmSeedPhrasePanel_RevealSeedPhraseButton", "type": "StatusButton", "visible": True}
|
||||
blur_GaussianBlur = {"container": statusDesktop_mainWindow_overlay, "id": "blur", "type": "GaussianBlur", "unnamed": 1, "visible": True}
|
||||
confirmSeedPhrasePanel_StatusSeedPhraseInput = {"container": statusDesktop_mainWindow_overlay, "type": "StatusSeedPhraseInput", "visible": True}
|
||||
@ -272,3 +272,17 @@ change_password_menu_new_password = {"container": statusDesktop_mainWindow_overl
|
||||
change_password_menu_new_password_confirm = {"container": statusDesktop_mainWindow_overlay, "objectName": "passwordViewNewPasswordConfirm", "type": "StatusPasswordInput", "visible": True}
|
||||
change_password_menu_submit_button = {"container": statusDesktop_mainWindow_overlay, "objectName": "changePasswordModalSubmitButton", "type": "StatusButton", "visible": True}
|
||||
change_password_success_menu_sign_out_quit_button = {"container": statusDesktop_mainWindow_overlay, "objectName": "changePasswordSuccessModalSignOutAndQuitButton", "type": "StatusButton", "visible": True}
|
||||
|
||||
# Social Links Popup
|
||||
socialLink_StatusListItem = {"container": statusDesktop_mainWindow_overlay, "type": "StatusListItem", "title": "", "visible": True}
|
||||
placeholder_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "id": "placeholder", "type": "StatusBaseText", "unnamed": 1, "visible": True}
|
||||
o_StatusBackButton = {"container": statusDesktop_mainWindow_overlay, "type": "StatusBackButton", "unnamed": 1, "visible": True}
|
||||
linksView = {"container": statusDesktop_mainWindow, "id": "linksView", "type": "StatusListView", "unnamed": 1, "visible": True}
|
||||
edit_TextEdit = {"container": statusDesktop_mainWindow_overlay, "type": "TextEdit", "unnamed": 1, "visible": True}
|
||||
|
||||
# Changes detected popup
|
||||
mainWindow_settingsDirtyToastMessage_SettingsDirtyToastMessage = {"container": ":statusDesktop_mainWindow", "id": "settingsDirtyToastMessage", "type": "SettingsDirtyToastMessage", "unnamed": 1, "visible": True}
|
||||
settingsSave_StatusButton = {"container": statusDesktop_mainWindow, "objectName": "settingsDirtyToastMessageSaveButton", "type": "StatusButton", "visible": True}
|
||||
|
||||
# Back up seed phrase banner
|
||||
mainWindow_secureYourSeedPhraseBanner_ModuleWarning = {"container": statusDesktop_mainWindow, "objectName": "secureYourSeedPhraseBanner", "type": "ModuleWarning", "visible": True}
|
||||
|
@ -62,3 +62,6 @@ mainWindow_MyProfileView = {"container": statusDesktop_mainWindow, "type": "MyPr
|
||||
displayName_StatusInput = {"container": statusDesktop_mainWindow, "objectName": "displayNameInput", "type": "StatusInput", "visible": True}
|
||||
displayName_TextEdit = {"container": displayName_StatusInput, "type": "TextEdit", "unnamed": 1, "visible": True}
|
||||
change_password_button = {"container": statusDesktop_mainWindow, "type": "StatusButton", "objectName": "profileSettingsChangePasswordButton", "visible": True}
|
||||
bio_StatusInput = {"container": statusDesktop_mainWindow, "objectName": "bioInput", "type": "StatusInput", "visible": True}
|
||||
bio_TextEdit = {"container": bio_StatusInput, "type": "TextEdit", "unnamed": 1, "visible": True}
|
||||
addMoreSocialLinks = {"container": statusDesktop_mainWindow, "objectName": "addMoreSocialLinks", "type": "StatusLinkText", "visible": True}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import time
|
||||
import typing
|
||||
from objectmaphelper import RegularExpression
|
||||
|
||||
import allure
|
||||
|
||||
@ -8,8 +9,10 @@ import driver
|
||||
from constants import UserCommunityInfo, wallet_account_list_item
|
||||
from driver import objects_access
|
||||
from driver.objects_access import walk_children
|
||||
from gui.components.back_up_your_seed_phrase_popup import BackUpYourSeedPhrasePopUp
|
||||
from gui.components.change_password_popup import ChangePasswordPopup
|
||||
from gui.components.settings.send_contact_request_popup import SendContactRequest
|
||||
from gui.components.social_links_popup import SocialLinksPopup
|
||||
from gui.components.wallet.testnet_mode_popup import TestnetModePopup
|
||||
from gui.elements.qt.button import Button
|
||||
from gui.elements.qt.list import List
|
||||
@ -28,30 +31,35 @@ class LeftPanel(QObject):
|
||||
super().__init__('mainWindow_LeftTabView')
|
||||
self._settings_section_template = QObject('scrollView_MenuItem_StatusNavigationListItem')
|
||||
|
||||
def _open_settings(self, index: int, section_name: str):
|
||||
self._settings_section_template.real_name['objectName'] = f'{index}-{section_name}MenuItem'
|
||||
def _open_settings(self, index: int):
|
||||
self._settings_section_template.real_name['objectName'] = RegularExpression(f'{index}*')
|
||||
self._settings_section_template.click()
|
||||
|
||||
@allure.step('Open messaging settings')
|
||||
def open_messaging_settings(self) -> 'MessagingSettingsView':
|
||||
self._open_settings(3, 'App')
|
||||
self._open_settings(3)
|
||||
return MessagingSettingsView()
|
||||
|
||||
@allure.step('Open communities settings')
|
||||
def open_communities_settings(self) -> 'CommunitiesSettingsView':
|
||||
self._open_settings(12, 'App')
|
||||
self._open_settings(12)
|
||||
return CommunitiesSettingsView()
|
||||
|
||||
@allure.step('Open wallet settings')
|
||||
def open_wallet_settings(self):
|
||||
self._open_settings(4, 'App')
|
||||
self._open_settings(4)
|
||||
return WalletSettingsView()
|
||||
|
||||
@allure.step('Open profile settings')
|
||||
def open_profile_settings(self):
|
||||
self._open_settings(0, 'Main')
|
||||
self._open_settings(0)
|
||||
return ProfileSettingsView()
|
||||
|
||||
@allure.step('Choose back up seed phrase in settings')
|
||||
def open_back_up_seed_phrase(self):
|
||||
self._open_settings(15)
|
||||
return BackUpYourSeedPhrasePopUp()
|
||||
|
||||
|
||||
class SettingsScreen(QObject):
|
||||
|
||||
@ -68,6 +76,9 @@ class ProfileSettingsView(QObject):
|
||||
self._display_name_text_field = TextEdit('displayName_TextEdit')
|
||||
self._save_button = Button('settingsSave_StatusButton')
|
||||
self._change_password_button = Button('change_password_button')
|
||||
self._bio_text_field = TextEdit('bio_TextEdit')
|
||||
self._add_more_links_label = TextLabel('addMoreSocialLinks')
|
||||
self._links_list = QObject('linksView')
|
||||
|
||||
@property
|
||||
@allure.step('Get display name')
|
||||
@ -81,6 +92,75 @@ class ProfileSettingsView(QObject):
|
||||
self._display_name_text_field.text = value
|
||||
self.save_changes()
|
||||
|
||||
@property
|
||||
@allure.step('Get bio')
|
||||
def bio(self) -> str:
|
||||
self._scroll_view.vertical_scroll_to(self._bio_text_field)
|
||||
return self._bio_text_field.text
|
||||
|
||||
@bio.setter
|
||||
@allure.step('Set bio')
|
||||
def bio(self, value: str):
|
||||
self._scroll_view.vertical_scroll_to(self._bio_text_field)
|
||||
self._bio_text_field.text = value
|
||||
self.save_changes()
|
||||
|
||||
@property
|
||||
@allure.step('Get social links')
|
||||
def social_links(self) -> dict:
|
||||
self._scroll_view.vertical_scroll_to(self._add_more_links_label)
|
||||
links = {}
|
||||
for link_name in walk_children(driver.waitForObjectExists(self._links_list.real_name, configs.timeouts.UI_LOAD_TIMEOUT_MSEC)):
|
||||
if getattr(link_name, 'id', '') == 'draggableDelegate':
|
||||
for link_value in walk_children(link_name):
|
||||
if getattr(link_value, 'id', '') == 'textMouseArea':
|
||||
links[str(link_name.title)] = str(driver.object.parent(link_value).text)
|
||||
return links
|
||||
|
||||
@social_links.setter
|
||||
@allure.step('Set social links')
|
||||
def social_links(self, links):
|
||||
links = {
|
||||
'Twitter': [links[0]],
|
||||
'Personal site': [links[1]],
|
||||
'Github': [links[2]],
|
||||
'YouTube channel': [links[3]],
|
||||
'Discord handle': [links[4]],
|
||||
'Telegram handle': [links[5]],
|
||||
'Custom link': [links[6], links[7]],
|
||||
}
|
||||
|
||||
for network, link in links.items():
|
||||
social_links_popup = self.open_social_links_popup()
|
||||
social_links_popup.add_link(network, link)
|
||||
|
||||
@allure.step('Verify social links')
|
||||
def verify_social_links(self, links):
|
||||
twitter = links[0]
|
||||
personal_site = links[1]
|
||||
github = links[2]
|
||||
youtube = links[3]
|
||||
discord = links[4]
|
||||
telegram = links[5]
|
||||
custom_link_text = links[6]
|
||||
custom_link = links[7]
|
||||
|
||||
actual_links = self.social_links
|
||||
|
||||
assert actual_links['Twitter'] == twitter
|
||||
assert actual_links['Personal site'] == personal_site
|
||||
assert actual_links['Github'] == github
|
||||
assert actual_links['YouTube channel'] == youtube
|
||||
assert actual_links['Discord handle'] == discord
|
||||
assert actual_links['Telegram handle'] == telegram
|
||||
assert actual_links[custom_link_text] == custom_link
|
||||
|
||||
@allure.step('Open social links form')
|
||||
def open_social_links_popup(self):
|
||||
self._scroll_view.vertical_scroll_to(self._add_more_links_label)
|
||||
self._add_more_links_label.click()
|
||||
return SocialLinksPopup().wait_until_appears()
|
||||
|
||||
@allure.step('Save changes')
|
||||
def save_changes(self):
|
||||
self._save_button.click()
|
||||
|
@ -1,9 +1,14 @@
|
||||
import time
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
from allure import step
|
||||
|
||||
import constants
|
||||
from constants.social_links import social_links
|
||||
from driver.aut import AUT
|
||||
from gui.components.back_up_your_seed_phrase_banner import BackUpSeedPhraseBanner
|
||||
from gui.components.settings.changes_detected_popup import ChangesDetectedToastMessage
|
||||
from gui.main_window import MainWindow
|
||||
|
||||
pytestmark = allure.suite("Settings")
|
||||
@ -78,7 +83,7 @@ def test_switch_state_to_automatic(aut: AUT, main_screen: MainWindow, user_accou
|
||||
'Change the password and login with new password')
|
||||
@pytest.mark.case(703005)
|
||||
@pytest.mark.parametrize('user_account, user_account_new',
|
||||
[pytest.param(constants.user.user_account_one, constants.user.user_account_one_changed)])
|
||||
[pytest.param(constants.user.user_account_one, constants.user.user_account_one_changed_name)])
|
||||
def test_change_password_and_login(aut: AUT, main_screen: MainWindow, user_account, user_account_new):
|
||||
with step('Open profile settings and change password'):
|
||||
main_screen.left_panel.open_settings().left_panel.open_profile_settings().open_change_password_popup().change_password(
|
||||
@ -92,3 +97,45 @@ def test_change_password_and_login(aut: AUT, main_screen: MainWindow, user_accou
|
||||
user_canvas = main_screen.left_panel.open_user_canvas()
|
||||
profile_popup = user_canvas.open_profile_popup()
|
||||
assert profile_popup.user_name == user_account_new.name
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703001','Backup seed phrase')
|
||||
@pytest.mark.case(703001)
|
||||
def test_back_up_seed_phrase(main_screen: MainWindow):
|
||||
with step('Open back up seed phrase in settings'):
|
||||
settings = main_screen.left_panel.open_settings()
|
||||
back_up = settings.left_panel.open_back_up_seed_phrase()
|
||||
back_up.back_up_seed_phrase()
|
||||
with step('Verify back up seed phrase banner dissapeared'):
|
||||
assert not BackUpSeedPhraseBanner().is_visible, 'Secure your seed phrase banner visible'
|
||||
|
||||
|
||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703006',
|
||||
'Set display name, bio and social links')
|
||||
@pytest.mark.case(703006)
|
||||
@pytest.mark.parametrize('user_account, user_account_changed',
|
||||
[pytest.param(constants.user.user_account_one, constants.user.user_account_one_changed_name)])
|
||||
@pytest.mark.parametrize('bio, links', [pytest.param('This is my bio', constants.social_links.social_links)])
|
||||
def test_set_name_bio_social_links(main_screen: MainWindow, aut: AUT, user_account, user_account_changed, bio, links):
|
||||
with step('Open profile settings and check name, bio and links'):
|
||||
profile_settings = main_screen.left_panel.open_settings().left_panel.open_profile_settings()
|
||||
assert profile_settings.display_name == user_account.name
|
||||
assert profile_settings.bio == ''
|
||||
for value in profile_settings.social_links.values():
|
||||
assert value == ''
|
||||
|
||||
with step('Set new name, bio and links'):
|
||||
profile_settings.set_name(user_account_changed.name)
|
||||
profile_settings.bio = bio
|
||||
profile_settings.social_links = links
|
||||
ChangesDetectedToastMessage().save()
|
||||
|
||||
with step('Restart application'):
|
||||
aut.restart()
|
||||
main_screen.authorize_user(user_account_changed)
|
||||
|
||||
with step('Open profile settings and check new name, bio and links'):
|
||||
profile_settings = main_screen.left_panel.open_settings().left_panel.open_profile_settings()
|
||||
assert profile_settings.display_name == user_account_changed.name
|
||||
assert profile_settings.bio == bio
|
||||
profile_settings.verify_social_links(links)
|
||||
|
Loading…
x
Reference in New Issue
Block a user