chore(@onborading): added several verifications (#117)

This commit is contained in:
Anastasiya Semenkevich 2023-09-22 06:58:45 +03:00 committed by GitHub
parent f5f94a70d4
commit 230fe2aa02
8 changed files with 43 additions and 26 deletions

View File

@ -3,6 +3,7 @@ import allure
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
class BeforeStartedPopUp(BasePopup):
@ -12,6 +13,8 @@ class BeforeStartedPopUp(BasePopup):
self._acknowledge_checkbox = CheckBox('acknowledge_checkbox')
self._terms_of_use_checkBox = CheckBox('termsOfUseCheckBox_StatusCheckBox')
self._get_started_button = Button('getStartedStatusButton_StatusButton')
self._terms_of_use_link = QObject('termsOfUseLink_StatusBaseText')
self._privacy_policy_link = QObject('privacyPolicyLink_StatusBaseText')
@property
@allure.step('Get visible attribute')
@ -22,5 +25,7 @@ class BeforeStartedPopUp(BasePopup):
def get_started(self):
self._acknowledge_checkbox.set(True)
self._terms_of_use_checkBox.set(True, x=10)
assert self._terms_of_use_link.is_visible, f"Terms of use link is missing"
assert self._privacy_policy_link.is_visible, f"Privacy Policy link is missing"
self._get_started_button.click()
self.wait_until_hidden()

View File

@ -5,13 +5,13 @@ from gui.elements.qt.button import Button
from gui.elements.qt.check_box import CheckBox
class WelcomeStatusPopup(BasePopup):
class BetaConsentPopup(BasePopup):
def __init__(self):
self._agree_to_use_checkbox = CheckBox('agreeToUse_StatusCheckBox')
self._ready_to_use_checkbox = CheckBox('readyToUse_StatusCheckBox')
self._ready_to_use_button = Button('i_m_ready_to_use_Status_Desktop_Beta_StatusButton')
super(WelcomeStatusPopup, self).__init__()
super(BetaConsentPopup, self).__init__()
@allure.step('Confirm all')
def confirm(self):

View File

@ -9,7 +9,7 @@ import driver
from constants import UserAccount
from gui.components.community.invite_contacts import InviteContactsPopup
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
from gui.components.onboarding.welcome_status_popup import WelcomeStatusPopup
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
from gui.components.splash_screen import SplashScreen
from gui.components.user_canvas import UserCanvas
from gui.elements.qt.button import Button
@ -18,7 +18,7 @@ from gui.elements.qt.window import Window
from gui.screens.community import CommunityScreen
from gui.screens.community_portal import CommunitiesPortal
from gui.screens.messages import MessagesScreen
from gui.screens.onboarding import AllowNotificationsView, WelcomeView, TouchIDAuthView, LoginView
from gui.screens.onboarding import AllowNotificationsView, WelcomeToStatusView, BiometricsView, LoginView
from gui.screens.settings import SettingsScreen
from gui.screens.wallet import WalletScreen
from scripts.tools.image import Image
@ -135,7 +135,7 @@ class MainWindow(Window):
if configs.system.IS_MAC:
AllowNotificationsView().wait_until_appears().allow()
BeforeStartedPopUp().get_started()
wellcome_screen = WelcomeView().wait_until_appears()
wellcome_screen = WelcomeToStatusView().wait_until_appears()
profile_view = wellcome_screen.get_keys().generate_new_keys()
profile_view.set_display_name(user_account.name)
details_view = profile_view.next()
@ -143,10 +143,10 @@ class MainWindow(Window):
confirm_password_view = create_password_view.create_password(user_account.password)
confirm_password_view.confirm_password(user_account.password)
if configs.system.IS_MAC:
TouchIDAuthView().wait_until_appears().prefer_password()
BiometricsView().wait_until_appears().prefer_password()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.DEV_BUILD:
WelcomeStatusPopup().confirm()
BetaConsentPopup().confirm()
return self
@allure.step('Log in user')
@ -154,7 +154,7 @@ class MainWindow(Window):
LoginView().log_in(user_account)
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.DEV_BUILD:
WelcomeStatusPopup().wait_until_appears().confirm()
BetaConsentPopup().wait_until_appears().confirm()
return self
@allure.step('Authorize user')

View File

@ -15,6 +15,8 @@ o_StatusListView = {"container": statusDesktop_mainWindow_overlay, "type": "Stat
acknowledge_checkbox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "objectName": "acknowledgeCheckBox", "type": "StatusCheckBox", "visible": True}
termsOfUseCheckBox_StatusCheckBox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "objectName":"termsOfUseCheckBox", "type": "StatusCheckBox", "visible": True}
getStartedStatusButton_StatusButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "getStartedStatusButton", "type": "StatusButton", "visible": True}
termsOfUseLink_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "objectName": "termsOfUseLink", "type": "StatusBaseText", "visible": True}
privacyPolicyLink_StatusBaseText = {"container": statusDesktop_mainWindow_overlay, "objectName": "privacyPolicyLink", "type": "StatusBaseText", "visible": True}
# Back Up Your Seed Phrase Popup
o_PopupItem = {"container": statusDesktop_mainWindow_overlay, "type": "PopupItem", "unnamed": 1, "visible": True}

View File

@ -83,4 +83,5 @@ accountsView_accountListPanel = {"container": statusDesktop_mainWindow, "objectN
# 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"}

View File

@ -32,16 +32,16 @@ class AllowNotificationsView(QObject):
self.wait_until_hidden()
class WelcomeView(QObject):
class WelcomeToStatusView(QObject):
def __init__(self):
super(WelcomeView, self).__init__('mainWindow_WelcomeView')
self._new_user_button = Button('mainWindow_I_am_new_to_Status_StatusBaseText')
self._existing_user_button = Button('mainWindow_I_already_use_Status_StatusBaseText')
super(WelcomeToStatusView, self).__init__('mainWindow_WelcomeView')
self._i_am_new_to_status_button = Button('mainWindow_I_am_new_to_Status_StatusBaseText')
self._i_already_use_status_button = Button('mainWindow_I_already_use_Status_StatusBaseText')
@allure.step('Open Keys view')
def get_keys(self) -> 'KeysView':
self._new_user_button.click()
self._i_am_new_to_status_button.click()
time.sleep(1)
return KeysView().wait_until_appears()
@ -81,9 +81,9 @@ class KeysView(OnboardingView):
return ImportSeedPhraseView().wait_until_appears()
@allure.step('Go back')
def back(self) -> WelcomeView:
def back(self) -> WelcomeToStatusView:
self._back_button.click()
return WelcomeView().wait_until_appears()
return WelcomeToStatusView().wait_until_appears()
class ImportSeedPhraseView(OnboardingView):
@ -313,10 +313,11 @@ class ConfirmPasswordView(OnboardingView):
return CreatePasswordView().wait_until_appears()
class TouchIDAuthView(OnboardingView):
class BiometricsView(OnboardingView):
def __init__(self):
super(TouchIDAuthView, self).__init__('mainWindow_TouchIDAuthView')
super(BiometricsView, self).__init__('mainWindow_TouchIDAuthView')
self._yes_use_touch_id_button = Button('mainWindow_touchIdYesUseTouchIDButton')
self._prefer_password_button = Button('mainWindow_touchIdIPreferToUseMyPasswordText')
@allure.step('Select prefer password')
@ -324,6 +325,11 @@ class TouchIDAuthView(OnboardingView):
self._prefer_password_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):

View File

@ -24,6 +24,7 @@ class WalletScreen(QObject):
super().__init__('mainWindow_WalletLayout')
self.left_panel = LeftPanel()
class LeftPanel(QObject):
def __init__(self):
@ -99,7 +100,7 @@ class LeftPanel(QObject):
return AccountPopup().wait_until_appears()
except AssertionError as err:
if attempt:
self.open_add_account_popup(attempt-1)
self.open_add_account_popup(attempt - 1)
else:
raise err
@ -125,6 +126,7 @@ class LeftPanel(QObject):
else:
raise
class SavedAdressesView(QObject):
def __init__(self):
@ -188,4 +190,4 @@ class WalletAccountView(QObject):
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._account_name_text_label.wait_until_appears(timeout_msec)
return self
return self

View File

@ -9,10 +9,10 @@ import constants
import driver
from driver.aut import AUT
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
from gui.components.onboarding.welcome_status_popup import WelcomeStatusPopup
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
from gui.components.picture_edit_popup import shift_image
from gui.components.splash_screen import SplashScreen
from gui.screens.onboarding import AllowNotificationsView, WelcomeView, TouchIDAuthView, KeysView
from gui.screens.onboarding import AllowNotificationsView, WelcomeToStatusView, BiometricsView, KeysView
from scripts.tools import image
_logger = logging.getLogger(__name__)
@ -25,7 +25,7 @@ def keys_screen(main_window) -> KeysView:
if configs.system.IS_MAC:
AllowNotificationsView().wait_until_appears().allow()
BeforeStartedPopUp().get_started()
wellcome_screen = WelcomeView().wait_until_appears()
wellcome_screen = WelcomeToStatusView().wait_until_appears()
return wellcome_screen.get_keys()
@ -73,10 +73,11 @@ def test_generate_new_keys(main_window, keys_screen, user_name: str, password, u
confirm_password_view = create_password_view.create_password(password)
confirm_password_view.confirm_password(password)
if configs.system.IS_MAC:
TouchIDAuthView().wait_until_appears().prefer_password()
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()
if not configs.DEV_BUILD:
WelcomeStatusPopup().confirm()
BetaConsentPopup().confirm()
with step('Open User Canvas and verify user info'):
@ -122,10 +123,10 @@ def test_import_seed_phrase(aut: AUT, keys_screen, main_window, user_account):
confirm_password_view = create_password_view.create_password(user_account.password)
confirm_password_view.confirm_password(user_account.password)
if configs.system.IS_MAC:
TouchIDAuthView().wait_until_appears().prefer_password()
BiometricsView().wait_until_appears().prefer_password()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.DEV_BUILD:
WelcomeStatusPopup().confirm()
BetaConsentPopup().confirm()
with step('Verify that the user logged in via seed phrase correctly'):
user_canvas = main_window.left_panel.open_user_canvas()