chore: extract methods to helper class

This commit is contained in:
Anastasiya Semenkevich 2024-09-08 10:33:42 +03:00 committed by Anastasiya
parent e41b9ec12c
commit 2b0af81139
23 changed files with 168 additions and 241 deletions

View File

@ -58,6 +58,7 @@ def pytest_runtest_setup(item):
test_data.error = []
test_data.steps = []
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield

View File

@ -76,7 +76,7 @@ class AUT:
self.ctx = None
@allure.step('Attach Squish to Test Application')
def attach(self, timeout_sec: int = configs.timeouts.PROCESS_TIMEOUT_SEC):
def attach(self):
LOG.info('Attaching to AUT: localhost:%d', self.port)
try:

View File

@ -12,7 +12,7 @@ LOG = logging.getLogger(__name__)
class Scroll(QObject):
@allure.step('Scroll vertical down to object {1}')
def vertical_scroll_down(self, element: QObject, timeout_sec: int = 5, attempts: int = 2):
def vertical_scroll_down(self, element: QObject, timeout_sec: int = 5):
started_at = time.monotonic()
while not element.is_visible:
self.object.scrollPageDown()

View File

@ -0,0 +1,41 @@
from allure_commons._allure import step
import configs._local
import configs.system
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.screens.onboarding import WelcomeToStatusView, BiometricsView, YourEmojihashAndIdenticonRingView
with step('Open Generate new keys view'):
def open_generate_new_keys_view():
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
return keys_screen
with step('Import seed phrase and open profile view'):
def open_import_seed_view_and_do_import(keys_screen, seed_phrase, user_account):
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()
input_view.input_seed_phrase(seed_phrase.split(), True)
profile_view = input_view.import_seed_phrase()
profile_view.set_display_name(user_account.name)
return profile_view
with step('Finalize onboarding and open main screen'):
def finalize_onboarding_and_login(profile_view, user_account):
create_password_view = profile_view.next()
confirm_password_view = create_password_view.create_password(user_account.password)
confirm_password_view.confirm_password(user_account.password)
if configs.system.get_platform() == "Darwin":
BiometricsView().wait_until_appears().prefer_password()
SplashScreen().wait_until_appears().wait_until_hidden()
next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next()
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()

View File

@ -0,0 +1,6 @@
from allure_commons._allure import step
with step('Set testnet mode'):
def enable_testnet_mode(main_window):
wallet_settings = main_window.left_panel.open_settings().left_panel.open_wallet_settings()
wallet_settings.open_networks().switch_testnet_mode_toggle().turn_on_testnet_mode_in_testnet_modal()

View File

@ -0,0 +1,22 @@
from allure_commons._allure import step
import configs
import driver
from gui.components.authenticate_popup import AuthenticatePopup
from gui.components.signing_phrase_popup import SigningPhrasePopup
with step('Authenticate user action with password'):
def authenticate_with_password(user_account):
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
with step('Close signing phrase popup and open wallet send popup'):
def open_send_modal_for_account(main_window, account_name):
wallet = main_window.left_panel.open_wallet()
SigningPhrasePopup().wait_until_appears().confirm_phrase()
assert \
driver.waitFor(lambda: wallet.left_panel.is_total_balance_visible, configs.timeouts.UI_LOAD_TIMEOUT_SEC), \
f"Total balance is not visible"
wallet_account = wallet.left_panel.select_account(account_name)
send_popup = wallet_account.open_send_popup()
return send_popup

View File

View File

@ -5,6 +5,7 @@ import pytest
from allure import step
from constants import RandomUser
from helpers.WalletHelper import authenticate_with_password
from tests.wallet_main_screen import marks
import constants
@ -39,7 +40,7 @@ def test_add_generated_account_restart_add_again(
SigningPhrasePopup().wait_until_appears().confirm_phrase()
account_popup = wallet.left_panel.open_add_account_popup()
account_popup.set_name(name).set_emoji(emoji).set_color(color).save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Verify toast message notification when adding account'):
@ -66,7 +67,7 @@ def test_add_generated_account_restart_add_again(
f"Signing phrase should not be present because it has been hidden in the first step"
account_popup = wallet.left_panel.open_add_account_popup()
account_popup.set_name(name2).set_emoji(emoji2).set_color(color2).save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Verify toast message notification when adding account'):

View File

@ -6,6 +6,7 @@ import pytest
from allure_commons._allure import step
from constants import RandomUser
from helpers.WalletHelper import authenticate_with_password
from tests.settings.settings_wallet import marks
import constants
@ -38,7 +39,7 @@ def test_delete_generated_account_from_wallet_settings(
with step('Add a new generated account from wallet settings screen'):
add_account_popup.set_name(account_name).set_emoji(emoji).set_color(color).save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
add_account_popup.wait_until_hidden()
with step('Open account details view for the generated account'):

View File

@ -5,6 +5,7 @@ import pytest
from allure_commons._allure import step
from constants import RandomUser
from helpers.WalletHelper import authenticate_with_password
from scripts.utils.generators import random_wallet_account_name
from tests.wallet_main_screen import marks
@ -36,7 +37,7 @@ def test_add_edit_delete_generated_account(main_screen: MainWindow, user_account
SigningPhrasePopup().wait_until_appears().confirm_phrase()
account_popup = wallet.left_panel.open_add_account_popup()
account_popup.set_name(name).set_emoji(emoji).set_color(color).save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Verify toast message notification when adding account'):

View File

@ -6,16 +6,13 @@ from constants import RandomUser
from constants.onboarding import KeysExistText
from constants.wallet import WalletNetworkSettings
from driver.aut import AUT
from helpers.OnboardingHelper import open_generate_new_keys_view, open_import_seed_view_and_do_import, \
finalize_onboarding_and_login
from scripts.utils.generators import random_mnemonic, get_wallet_address_from_mnemonic
from tests.onboarding import marks
import configs.system
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.screens.onboarding import BiometricsView, WelcomeToStatusView, \
YourEmojihashAndIdenticonRingView, LoginView
from gui.screens.onboarding import LoginView
pytestmark = marks
@ -25,32 +22,13 @@ pytestmark = marks
@pytest.mark.case(703040, 736372)
@pytest.mark.parametrize('user_account', [RandomUser()])
@pytest.mark.critical
# TODO: it may fail, https://github.com/status-im/status-desktop/issues/16291
def test_import_seed_phrase(main_window, aut: AUT, user_account):
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
with step('Open import seed phrase view and enter seed phrase'):
keys_screen = open_generate_new_keys_view()
seed_phrase = random_mnemonic()
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()
input_view.input_seed_phrase(seed_phrase.split(), autocomplete=True)
profile_view = input_view.import_seed_phrase()
profile_view.set_display_name(user_account.name)
with step('Finalize onboarding and open main screen'):
create_password_view = profile_view.next()
confirm_password_view = create_password_view.create_password(user_account.password)
confirm_password_view.confirm_password(user_account.password)
if configs.system.get_platform() == "Darwin":
BiometricsView().wait_until_appears().prefer_password()
SplashScreen().wait_until_appears().wait_until_hidden()
next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next()
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
profile_view = open_import_seed_view_and_do_import(keys_screen, seed_phrase, user_account)
finalize_onboarding_and_login(profile_view, user_account)
with (step('Verify that restored account reveals correct status wallet address')):
status_account_index = 0

View File

@ -5,6 +5,8 @@ import time
import allure
import pytest
from allure_commons._allure import step
from helpers.OnboardingHelper import open_generate_new_keys_view
from . import marks
import configs.system
@ -29,9 +31,7 @@ pytestmark = marks
def test_login_with_wrong_password(aut: AUT, main_window, error: str):
user_one: UserAccount = RandomUser()
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
keys_screen = open_generate_new_keys_view()
with step('Open generate keys view and set user name'):
profile_view = keys_screen.generate_new_keys()
@ -79,9 +79,7 @@ def test_login_with_wrong_password(aut: AUT, main_window, error: str):
OnboardingMessages.WRONG_LOGIN_SYMBOLS_NOT_ALLOWED.value)
])
def test_sign_up_with_wrong_name(aut: AUT, main_window, user_name, error):
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
keys_screen = open_generate_new_keys_view()
with step(f'Input name Athl'):
profile_view = keys_screen.generate_new_keys()
@ -105,9 +103,7 @@ def test_sign_up_with_wrong_name(aut: AUT, main_window, user_name, error):
pytest.param(OnboardingMessages.WRONG_PASSWORD.value),
])
def test_sign_up_with_wrong_password_length(user_account, error: str, aut: AUT, main_window):
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
keys_screen = open_generate_new_keys_view()
with step('Input correct user name'):
profile_view = keys_screen.generate_new_keys()
@ -129,9 +125,7 @@ def test_sign_up_with_wrong_password_length(user_account, error: str, aut: AUT,
@pytest.mark.parametrize('user_account', [
RandomUser()])
def test_sign_up_with_wrong_password_in_confirmation_field(user_account, aut: AUT, main_window):
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
keys_screen = open_generate_new_keys_view()
with step('Input correct user name'):
profile_view = keys_screen.generate_new_keys()
@ -155,9 +149,7 @@ def test_sign_up_with_wrong_password_in_confirmation_field(user_account, aut: AU
])
def test_sign_up_with_wrong_password_in_confirmation_again_field(user_account,
error: str, aut: AUT, main_window):
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
keys_screen = open_generate_new_keys_view()
with step('Input correct user name'):
profile_view = keys_screen.generate_new_keys()
@ -182,13 +174,11 @@ def test_sign_up_with_wrong_password_in_confirmation_again_field(user_account,
pytest.param('pelican chief sudden oval media rare swamp elephant lawsuit wheal knife initial'),
])
def test_sign_up_with_wrong_seed_phrase(seed_phrase: str, aut: AUT, main_window):
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
keys_screen = open_generate_new_keys_view()
with step('Open import seed phrase view and enter seed phrase'):
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()
input_view.input_seed_phrase(seed_phrase.split(), autocomplete=False)
input_view.input_seed_phrase(seed_phrase.split(), False)
with step('Verify that import button is disabled'):
assert input_view.is_import_button_enabled is False

View File

@ -3,6 +3,7 @@ import pytest
from allure_commons._allure import step
from constants import UserAccount, RandomUser
from helpers.OnboardingHelper import open_generate_new_keys_view
from scripts.utils.generators import random_name_string, random_password_string
from . import marks
@ -30,9 +31,7 @@ def test_check_password_strength_and_login(main_window, user_account):
('+1_3!48aTq', great_elements)]
expected_password = ""
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
keys_screen = open_generate_new_keys_view()
with step('Input correct user name'):
profile_view = keys_screen.generate_new_keys()

View File

@ -8,6 +8,7 @@ from allure_commons._allure import step
from constants import RandomUser
from constants.wallet import WalletRenameKeypair, WalletAccountPopup
from gui.components.authenticate_popup import AuthenticatePopup
from helpers.WalletHelper import authenticate_with_password
from tests.wallet_main_screen import marks
import constants
@ -39,7 +40,7 @@ def test_rename_keypair_test(main_screen: MainWindow, user_account, name: str, c
SigningPhrasePopup().wait_until_appears().confirm_phrase()
account_popup = wallet.left_panel.open_add_account_popup()
account_popup.set_name(name).set_emoji(emoji).save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('To create imported seed phrase account open add account popup and set name, emoji and color'):
@ -55,7 +56,7 @@ def test_rename_keypair_test(main_screen: MainWindow, user_account, name: str, c
with step('Enter seed phrase name with more than 5 characters and continue creating of seed phrase account'):
new_account_popup.enter_seed_phrase_name(seed_phrase_name).click_continue()
account_popup.save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('To import an account within private key open add account popup and set name, emoji and color'):
@ -71,7 +72,7 @@ def test_rename_keypair_test(main_screen: MainWindow, user_account, name: str, c
with step('Enter private key name more than 5 characters and continue creating of import private key account'):
new_account_popup.enter_private_key_name(address_pair.private_key[:5]).click_continue()
account_popup.save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Open wallet settings and verify Status keypair title'):

View File

@ -2,6 +2,7 @@ import allure
import pytest
from allure_commons._allure import step
from helpers.WalletHelper import authenticate_with_password
from . import marks
import configs
@ -56,7 +57,7 @@ def test_change_account_order_by_drag_and_drop(main_screen: MainWindow, user_acc
account_popup.set_name(account[0]).set_emoji(account[1])
colors.append(account_popup.set_random_color())
account_popup.save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Verify accounts in wallet settings'):

View File

@ -7,6 +7,7 @@ import pytest
from allure_commons._allure import step
from constants import UserAccount, RandomUser
from helpers.WalletHelper import authenticate_with_password
from scripts.utils.generators import random_name_string, random_password_string
from constants.wallet import WalletAccountPopup
from . import marks
@ -43,7 +44,7 @@ def test_add_new_account_from_wallet_settings(
assert add_account_popup.get_error_message() == WalletAccountPopup.WALLET_ACCOUNT_NAME_MIN.value
add_account_popup.set_name(account_name).set_emoji(emoji).set_color(color).save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
add_account_popup.wait_until_hidden()
with step('Verify toast message notification when adding account'):

View File

@ -7,15 +7,14 @@ import driver
from configs import WALLET_SEED
from configs.timeouts import UI_LOAD_TIMEOUT_SEC
from constants import ReturningUser
from helpers.OnboardingHelper import open_generate_new_keys_view, open_import_seed_view_and_do_import, \
finalize_onboarding_and_login
from helpers.SettingsHelper import enable_testnet_mode
from helpers.WalletHelper import authenticate_with_password
from scripts.utils.generators import random_ens_string
from constants.wallet import WalletTransactions
from tests.settings import marks
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.components.authenticate_popup import AuthenticatePopup
from gui.components.wallet.send_popup import SendPopup
from gui.screens.onboarding import WelcomeToStatusView, BiometricsView, YourEmojihashAndIdenticonRingView
from gui.screens.settings_ens_usernames import ENSRegisteredView
pytestmark = marks
@ -29,40 +28,16 @@ pytestmark = marks
def test_ens_name_purchase(main_window, user_account, ens_name):
user_account = ReturningUser(
seed_phrase=WALLET_SEED.split(),
seed_phrase=WALLET_SEED,
status_address='0x44ddd47a0c7681a5b0fa080a56cbb7701db4bb43')
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
with step('Open import seed phrase view and enter seed phrase'):
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()
input_view.input_seed_phrase(user_account.seed_phrase, True)
profile_view = input_view.import_seed_phrase()
profile_view.set_display_name(user_account.name)
with step('Finalize onboarding and open main screen'):
create_password_view = profile_view.next()
confirm_password_view = create_password_view.create_password(user_account.password)
confirm_password_view.confirm_password(user_account.password)
if configs.system.get_platform() == "Darwin":
BiometricsView().wait_until_appears().prefer_password()
SplashScreen().wait_until_appears().wait_until_hidden()
next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next()
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
with step('Set testnet mode'):
settings = main_window.left_panel.open_settings()
wallet_settings = settings.left_panel.open_wallet_settings()
wallet_settings.open_networks().switch_testnet_mode_toggle().turn_on_testnet_mode_in_testnet_modal()
keys_screen = open_generate_new_keys_view()
profile_view = open_import_seed_view_and_do_import(keys_screen, user_account.seed_phrase, user_account)
finalize_onboarding_and_login(profile_view, user_account)
enable_testnet_mode(main_window)
with step('Open ENS usernames settings and enter user name'):
settings = main_window.left_panel.open_settings()
ens_settings = settings.left_panel.open_ens_usernames_settings().start()
ens_settings.enter_user_name(ens_name)
if driver.waitFor(lambda: 'Username already taken :(' in ens_settings.ens_text_notes(), UI_LOAD_TIMEOUT_SEC):
@ -78,8 +53,7 @@ def test_ens_name_purchase(main_window, user_account, ens_name):
register_ens._send_button.click()
assert driver.waitFor(lambda: SendPopup()._mainnet_network.is_visible, configs.timeouts.UI_LOAD_TIMEOUT_SEC)
with step('Enter password in authenticate popup'):
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
with step('Verify toast message with Transaction pending appears'):
assert WalletTransactions.TRANSACTION_PENDING_TOAST_MESSAGE.value in ' '.join(

View File

@ -11,6 +11,9 @@ import driver
from configs import WALLET_SEED
from constants import ReturningUser
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
from helpers.OnboardingHelper import open_generate_new_keys_view, open_import_seed_view_and_do_import, \
finalize_onboarding_and_login
from helpers.SettingsHelper import enable_testnet_mode
from tests.communities import marks
from constants.community_settings import MintOwnerTokensElements
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
@ -26,41 +29,18 @@ pytestmark = marks
@pytest.mark.transaction
def test_mint_owner_and_tokenmaster_tokens(main_window, user_account):
user_account = ReturningUser(
seed_phrase=WALLET_SEED.split(),
seed_phrase=WALLET_SEED,
status_address='0x44ddd47a0c7681a5b0fa080a56cbb7701db4bb43')
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
with step('Open import seed phrase view and enter seed phrase'):
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()
input_view.input_seed_phrase(user_account.seed_phrase, True)
profile_view = input_view.import_seed_phrase()
profile_view.set_display_name(user_account.name)
with step('Finalize onboarding and open main screen'):
create_password_view = profile_view.next()
confirm_password_view = create_password_view.create_password(user_account.password)
confirm_password_view.confirm_password(user_account.password)
if configs.system.get_platform() == "Darwin":
BiometricsView().wait_until_appears().prefer_password()
SplashScreen().wait_until_appears().wait_until_hidden()
next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next()
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
keys_screen = open_generate_new_keys_view()
profile_view = open_import_seed_view_and_do_import(keys_screen, user_account.seed_phrase, user_account)
finalize_onboarding_and_login(profile_view, user_account)
with step('Enable creation of community option'):
settings = main_window.left_panel.open_settings()
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
with step('Set testnet mode'):
settings = main_window.left_panel.open_settings()
wallet_settings = settings.left_panel.open_wallet_settings()
wallet_settings.open_networks().switch_testnet_mode_toggle().turn_on_testnet_mode_in_testnet_modal()
enable_testnet_mode(main_window)
with step('Switch manage community on testnet option'):
settings = main_window.left_panel.open_settings()

View File

@ -6,13 +6,11 @@ import configs
import driver
from configs import WALLET_SEED
from constants import ReturningUser
from constants.wallet import WalletTransactions, WalletAddress
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
from gui.components.signing_phrase_popup import SigningPhrasePopup
from gui.components.splash_screen import SplashScreen
from gui.components.authenticate_popup import AuthenticatePopup
from gui.screens.onboarding import WelcomeToStatusView, BiometricsView, YourEmojihashAndIdenticonRingView
from constants.wallet import WalletTransactions, WalletAddress, WalletNetworkSettings
from helpers.OnboardingHelper import open_generate_new_keys_view, open_import_seed_view_and_do_import, \
finalize_onboarding_and_login
from helpers.SettingsHelper import enable_testnet_mode
from helpers.WalletHelper import authenticate_with_password, open_send_modal_for_account
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704527',
@ -25,60 +23,21 @@ from gui.screens.onboarding import WelcomeToStatusView, BiometricsView, YourEmoj
@pytest.mark.timeout(timeout=120)
def test_wallet_send_0_eth(main_window, user_account, receiver_account_address, amount, asset):
user_account = ReturningUser(
seed_phrase=WALLET_SEED.split(),
seed_phrase=WALLET_SEED,
status_address='0x44ddd47a0c7681a5b0fa080a56cbb7701db4bb43')
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
keys_screen = open_generate_new_keys_view()
profile_view = open_import_seed_view_and_do_import(keys_screen, user_account.seed_phrase, user_account)
finalize_onboarding_and_login(profile_view, user_account)
enable_testnet_mode(main_window)
with step('Open import seed phrase view and enter seed phrase'):
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()
input_view.input_seed_phrase(user_account.seed_phrase, True)
profile_view = input_view.import_seed_phrase()
profile_view.set_display_name(user_account.name)
send_popup = open_send_modal_for_account(
main_window, account_name=WalletNetworkSettings.STATUS_ACCOUNT_DEFAULT_NAME)
with step('Finalize onboarding and open main screen'):
create_password_view = profile_view.next()
confirm_password_view = create_password_view.create_password(user_account.password)
confirm_password_view.confirm_password(user_account.password)
if configs.system.get_platform() == "Darwin":
BiometricsView().wait_until_appears().prefer_password()
SplashScreen().wait_until_appears().wait_until_hidden()
next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next()
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
with step('Verify that restored account reveals correct status wallet address'):
wallet_settings = main_window.left_panel.open_settings().left_panel.open_wallet_settings()
status_acc_view = wallet_settings.open_account_in_settings('Account 1', '0')
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}"
status_acc_view.click_back_button()
with step('Set testnet mode'):
wallet_settings.open_networks().switch_testnet_mode_toggle().turn_on_testnet_mode_in_testnet_modal()
with step('Open send popup'):
wallet = main_window.left_panel.open_wallet()
SigningPhrasePopup().wait_until_appears().confirm_phrase()
assert \
driver.waitFor(lambda: wallet.left_panel.is_total_balance_visible, configs.timeouts.UI_LOAD_TIMEOUT_SEC), \
f"Total balance is not visible"
wallet_account = wallet.left_panel.select_account('Account 1')
send_popup = wallet_account.open_send_popup()
with step('Enter asset, amount and address and click send and verify Mainnet network is shown'):
send_popup.send(receiver_account_address, amount, asset)
assert driver.waitFor(lambda: send_popup._mainnet_network.is_visible, configs.timeouts.UI_LOAD_TIMEOUT_SEC)
with step('Enter password in authenticate popup'):
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
with step('Verify toast message with Transaction pending appears'):
assert WalletTransactions.TRANSACTION_PENDING_TOAST_MESSAGE.value in ' '.join(
main_window.wait_for_notification())

View File

@ -6,13 +6,12 @@ import configs
import driver
from configs import WALLET_SEED
from constants import ReturningUser
from constants.wallet import WalletTransactions
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
from constants.wallet import WalletTransactions, WalletNetworkSettings
from gui.components.signing_phrase_popup import SigningPhrasePopup
from gui.components.splash_screen import SplashScreen
from gui.components.authenticate_popup import AuthenticatePopup
from gui.screens.onboarding import WelcomeToStatusView, BiometricsView, YourEmojihashAndIdenticonRingView
from helpers.OnboardingHelper import open_generate_new_keys_view, open_import_seed_view_and_do_import, \
finalize_onboarding_and_login
from helpers.SettingsHelper import enable_testnet_mode
from helpers.WalletHelper import authenticate_with_password, open_send_modal_for_account
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704602',
@ -26,54 +25,23 @@ from gui.screens.onboarding import WelcomeToStatusView, BiometricsView, YourEmoj
@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/14862")
@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/14509")
def test_wallet_send_nft(main_window, user_account, tab, receiver_account_address, amount, collectible):
with step('Open Generate new keys view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
with step('Open import seed phrase view and enter seed phrase'):
user_account = ReturningUser(
seed_phrase=WALLET_SEED.split(),
seed_phrase=WALLET_SEED,
status_address='0x44ddd47a0c7681a5b0fa080a56cbb7701db4bb43')
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()
input_view.input_seed_phrase(user_account.seed_phrase, True)
profile_view = input_view.import_seed_phrase()
profile_view.set_display_name(user_account.name)
keys_screen = open_generate_new_keys_view()
profile_view = open_import_seed_view_and_do_import(keys_screen, user_account.seed_phrase, user_account)
finalize_onboarding_and_login(profile_view, user_account)
with step('Finalize onboarding and open main screen'):
create_password_view = profile_view.next()
confirm_password_view = create_password_view.create_password(user_account.password)
confirm_password_view.confirm_password(user_account.password)
if configs.system.get_platform() == "Darwin":
BiometricsView().wait_until_appears().prefer_password()
SplashScreen().wait_until_appears().wait_until_hidden()
next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next()
if configs.system.get_platform() == "Darwin":
next_view.start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
enable_testnet_mode(main_window)
with step('Set testnet mode'):
wallet_settings = main_window.left_panel.open_settings().left_panel.open_wallet_settings()
wallet_settings.open_networks().switch_testnet_mode_toggle().turn_on_testnet_mode_in_testnet_modal()
send_popup = open_send_modal_for_account(
main_window, account_name=WalletNetworkSettings.STATUS_ACCOUNT_DEFAULT_NAME)
with step('Open send popup'):
wallet = main_window.left_panel.open_wallet()
SigningPhrasePopup().wait_until_appears().confirm_phrase()
assert driver.waitFor(lambda: wallet.left_panel.is_total_balance_visible, configs.timeouts.UI_LOAD_TIMEOUT_SEC)
f"Total balance is not visible"
wallet_account = wallet.left_panel.select_account('Account 1')
send_popup = wallet_account.open_send_popup()
with step('Enter asset, amount and address on Collectibles tab, click send and verify Mainnet network is shown'):
send_popup.send(receiver_account_address, amount, collectible, tab)
assert driver.waitFor(lambda: send_popup._mainnet_network.is_visible, configs.timeouts.UI_LOAD_TIMEOUT_SEC)
with step('Enter password in authenticate popup'):
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
with step('Verify toast message with Transaction pending appears'):
assert WalletTransactions.TRANSACTION_PENDING_TOAST_MESSAGE.value in ' '.join(
main_window.wait_for_notification())

View File

@ -5,6 +5,7 @@ import pytest
from allure import step
from constants import RandomUser
from helpers.WalletHelper import authenticate_with_password
from tests.wallet_main_screen import marks
import constants
@ -32,7 +33,7 @@ def test_plus_button_manage_account_added_for_new_seed(main_screen: MainWindow,
account_popup = wallet.left_panel.open_add_account_popup()
account_popup.set_name(name).set_emoji(emoji).set_color(color).set_origin_new_seed_phrase(
keypair_name).save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Verify toast message notification when adding account'):

View File

@ -5,6 +5,7 @@ import pytest
from allure_commons._allure import step
from constants import UserAccount, RandomUser
from helpers.WalletHelper import authenticate_with_password
from scripts.utils.generators import random_password_string
from tests.wallet_main_screen import marks
@ -36,7 +37,7 @@ def test_plus_button_manage_account_from_private_key(main_screen: MainWindow, us
account_popup = wallet.left_panel.open_add_account_popup()
account_popup.set_name(name).set_emoji(emoji).set_color(color).set_origin_private_key(
address_pair.private_key, address_pair.private_key[:5]).save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Verify toast message notification when adding account'):

View File

@ -6,6 +6,7 @@ from allure_commons._allure import step
from constants import RandomUser
from constants.wallet import WalletSeedPhrase
from helpers.WalletHelper import authenticate_with_password
from scripts.utils.generators import random_mnemonic
from tests.wallet_main_screen import marks
@ -40,7 +41,7 @@ def test_plus_button_manage_account_from_seed_phrase(main_screen: MainWindow, us
account_popup.set_name(name).set_emoji(emoji).set_color(
color).open_add_new_account_popup().import_new_seed_phrase(mnemonic_data.split())
account_popup.save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Verify toast message notification when adding account'):
@ -86,7 +87,7 @@ def test_plus_button_re_importing_seed_phrase(main_screen: MainWindow, user_acco
account_popup.set_name(name).set_emoji(emoji).set_color(
color).open_add_new_account_popup().import_new_seed_phrase(seed_phrase.split())
account_popup.save_changes()
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
authenticate_with_password(user_account)
account_popup.wait_until_hidden()
with step('Try to re-import seed phrase and verify that correct error appears'):