chore(@back_up_seed_test): improve validations (#189)

This commit is contained in:
Anastasiya 2023-10-18 15:34:11 +03:00 committed by GitHub
parent e56307e38f
commit 733ccdfd92
3 changed files with 22 additions and 3 deletions

View File

@ -1,6 +1,23 @@
import allure
from gui.elements.button import Button
from gui.elements.object import QObject
class BackUpSeedPhraseBanner(QObject):
def __init__(self):
super(BackUpSeedPhraseBanner, self).__init__('mainWindow_secureYourSeedPhraseBanner_ModuleWarning')
self._back_up_seedBanner = QObject('mainWindow_secureYourSeedPhraseBanner_ModuleWarning')
self._back_up_seedButton = Button('mainWindow_secureYourSeedPhraseBanner_Button')
@allure.step('Verify banner presence')
def does_back_up_seed_banner_exist(self):
return self._back_up_seedBanner.exists
@allure.step('Verify back up now button on the banner')
def is_back_up_now_button_present(self):
return self._back_up_seedButton.is_visible
@allure.step('Wait until banner is hidden')
def wait_to_hide_the_banner(self):
self._back_up_seedBanner.wait_until_hidden()

View File

@ -290,6 +290,7 @@ settingsSave_StatusButton = {"container": statusDesktop_mainWindow, "objectName"
# Back up seed phrase banner
mainWindow_secureYourSeedPhraseBanner_ModuleWarning = {"container": statusDesktop_mainWindow, "objectName": "secureYourSeedPhraseBanner", "type": "ModuleWarning", "visible": True}
mainWindow_secureYourSeedPhraseBanner_Button = {"container": statusDesktop_mainWindow, "id": "button", "text": "Back up now", "type": "Button", "unnamed": 1, "visible": True}
# Sync new device popup
copy_SyncCodeStatusButton = {"container": statusDesktop_mainWindow_overlay, "objectName": "syncCodeCopyButton", "type": "StatusButton", "visible": True}

View File

@ -13,7 +13,8 @@ def test_back_up_seed_phrase(main_screen: MainWindow):
with step('Check back up seed phrase banner is visible for new account'):
settings = main_screen.left_panel.open_settings()
assert settings.left_panel.check_back_up_seed_option_present(), f"Back up seed option is not present"
#assert BackUpSeedPhraseBanner().is_visible, 'Secure your seed phrase banner is not present'
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'
with step('Open back up seed phrase in settings'):
back_up = settings.left_panel.open_back_up_seed_phrase()
@ -21,5 +22,5 @@ def test_back_up_seed_phrase(main_screen: MainWindow):
with step('Verify back up seed phrase banner disappeared'):
assert not settings.left_panel.check_back_up_seed_option_present(), f"Back up seed option is present"
#TODO: verification below is always returning true, need to debug later
#assert not driver.waitFor(lambda: BackUpSeedPhraseBanner().is_visible), 'Secure your seed phrase banner visible'
BackUpSeedPhraseBanner().wait_to_hide_the_banner()
assert not BackUpSeedPhraseBanner().does_back_up_seed_banner_exist(), "Back up seed banner is present"