Chore/key card handler (#314)

* chore: fix seed phrase test and edit status account test

* chore: change the locator for profile layout

* chore: close Keycard Controller

---------

Co-authored-by: Anastasiya Semenkevich <anastasija.ig@gmail.com>
This commit is contained in:
Vladimir Druzhinin 2023-11-17 06:53:17 +01:00 committed by GitHub
parent 98ecaea67c
commit a9af83fda4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 4 deletions

View File

@ -16,6 +16,7 @@ from gui.components.user_canvas import UserCanvas
from gui.elements.button import Button
from gui.elements.object import QObject
from gui.elements.window import Window
from gui.mocked_keycard_controller import MockedKeycardController
from gui.screens.community import CommunityScreen
from gui.screens.community_portal import CommunitiesPortal
from gui.screens.messages import MessagesScreen
@ -115,7 +116,7 @@ class LeftPanel(QObject):
InviteContactsPopup().wait_until_appears().invite(contacts, message)
@allure.step('Open settings')
def open_settings(self) -> CommunitiesPortal:
def open_settings(self) -> SettingsScreen:
self._settings_button.click()
return SettingsScreen().wait_until_appears()
@ -137,6 +138,10 @@ class MainWindow(Window):
super(MainWindow, self).__init__('statusDesktop_mainWindow')
self.left_panel = LeftPanel()
def prepare(self) -> 'Window':
MockedKeycardController().wait_until_appears().hide()
return super().prepare()
@allure.step('Sign Up user')
def sign_up(self, user_account: UserAccount = constants.user.user_account_one):
if configs.system.IS_MAC:
@ -154,6 +159,7 @@ class MainWindow(Window):
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
BetaConsentPopup().confirm()
MockedKeycardController().wait_until_appears().hide()
return self
@allure.step('Log in user')
@ -162,6 +168,7 @@ class MainWindow(Window):
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
BetaConsentPopup().confirm()
MockedKeycardController().wait_until_appears().hide()
return self
@allure.step('Authorize user')

View File

@ -3,6 +3,7 @@ import typing
import allure
import configs
import driver
from gui.elements.button import Button
from gui.elements.object import QObject
@ -33,6 +34,10 @@ class MockedKeycardController(Window):
self._field_object = QObject('keycard_edit_TextEdit')
self._scroll = Scroll('keycardFlickable')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._plugin_reader_button.wait_until_appears()
return self
@property
@allure.step('Get text fields')
def get_text_fields(self) -> typing.List[str]:

View File

@ -1,7 +1,7 @@
from gui.objects_map.main_names import statusDesktop_mainWindow
from objectmaphelper import *
mainWindow_ProfileLayout = {"container": statusDesktop_mainWindow, "type": "ProfileLayout", "unnamed": 1, "visible": True}
mainWindow_ProfileLayout = {"container": statusDesktop_mainWindow, "objectName": "profileStatusSectionLayout", "type": "StatusSectionLayout", "visible": True}
mainWindow_StatusSectionLayout_ContentItem = {"container": mainWindow_ProfileLayout, "objectName": "StatusSectionLayout", "type": "ContentItem", "visible": True}
settingsContentBase_ScrollView = {"container": statusDesktop_mainWindow, "objectName": "settingsContentBaseScrollView", "type": "StatusScrollView", "visible": True}
settingsContentBaseScrollView_Flickable = {"container": settingsContentBase_ScrollView, "type": "Flickable", "unnamed": 1, "visible": True}
@ -17,6 +17,7 @@ scrollView_Flickable = {"container": mainWindow_scrollView_StatusScrollView, "ty
mainWindow_CommunitiesView = {"container": statusDesktop_mainWindow, "type": "CommunitiesView", "unnamed": 1, "visible": True}
mainWindow_settingsContentBaseScrollView_StatusScrollView = {"container": mainWindow_CommunitiesView, "objectName": "settingsContentBaseScrollView", "type": "StatusScrollView", "visible": True}
settingsContentBaseScrollView_listItem_StatusListItem = {"container": mainWindow_settingsContentBaseScrollView_StatusScrollView, "id": "listItem", "type": "StatusListItem", "unnamed": 1, "visible": True}
# Templates to generate Real Name in test
settings_iconOrImage_StatusSmartIdenticon = {"id": "iconOrImage", "type": "StatusSmartIdenticon", "unnamed": 1, "visible": True}
settings_Name_StatusTextWithLoadingState = {"type": "StatusTextWithLoadingState", "unnamed": 1, "visible": True}

View File

@ -10,6 +10,8 @@ from driver.aut import AUT
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
from gui.components.splash_screen import SplashScreen
from gui.main_window import LeftPanel
from gui.mocked_keycard_controller import MockedKeycardController
from gui.screens.onboarding import BiometricsView, AllowNotificationsView, WelcomeToStatusView, KeysView
@ -47,10 +49,11 @@ def test_import_seed_phrase(aut: AUT, keys_screen, main_window, user_account, au
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE:
BetaConsentPopup().confirm()
MockedKeycardController().wait_until_appears().hide()
with (step('Verify that restored account reveals correct status wallet address')):
status_acc_view = (
main_window.left_panel.open_settings().left_panel.open_wallet_settings().open_status_account_in_settings())
LeftPanel().open_settings().left_panel.open_wallet_settings().open_status_account_in_settings())
address = status_acc_view.get_account_address_value()
assert address == user_account.status_address, \
f"Recovered account should have address {user_account.status_address}, but has {address}"

View File

@ -7,6 +7,7 @@ from allure_commons._allure import step
from constants.wallet import WalletNetworkSettings, DerivationPath, WalletAccountSettings
from gui.main_window import MainWindow
from gui.screens.settings import SettingsScreen
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704433',
@ -26,7 +27,7 @@ def test_settings_edit_status_account(main_screen: MainWindow, new_name):
when display name is {profile_display_name}"
status_acc_view = (
main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_status_account_in_settings())
SettingsScreen().left_panel.open_wallet_settings().open_status_account_in_settings())
with step('Check the default values on the account details view for Status account'):
assert status_acc_view.get_account_name_value() == WalletNetworkSettings.STATUS_ACCOUNT_DEFAULT_NAME.value, \