From a3fa0ebaa3501c513d022ee40aec83d7d9374e27 Mon Sep 17 00:00:00 2001 From: Valentina Novgorodtceva Date: Wed, 29 May 2024 19:45:06 +0700 Subject: [PATCH] chore: test send divided into 2 separate files --- .../test_footer_actions_send.py | 57 +------------- .../test_footer_actions_send_nft.py | 76 +++++++++++++++++++ 2 files changed, 77 insertions(+), 56 deletions(-) create mode 100644 test/e2e/tests/wallet_main_screen/wallet: footer actions/test_footer_actions_send_nft.py diff --git a/test/e2e/tests/wallet_main_screen/wallet: footer actions/test_footer_actions_send.py b/test/e2e/tests/wallet_main_screen/wallet: footer actions/test_footer_actions_send.py index 6b2320fd70..07e86e9667 100644 --- a/test/e2e/tests/wallet_main_screen/wallet: footer actions/test_footer_actions_send.py +++ b/test/e2e/tests/wallet_main_screen/wallet: footer actions/test_footer_actions_send.py @@ -11,8 +11,7 @@ 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.wallet.authenticate_popup import AuthenticatePopup -from gui.screens.onboarding import KeysView, AllowNotificationsView, WelcomeToStatusView, BiometricsView, \ - YourEmojihashAndIdenticonRingView +from gui.screens.onboarding import KeysView, WelcomeToStatusView, BiometricsView, YourEmojihashAndIdenticonRingView @pytest.fixture @@ -82,57 +81,3 @@ def test_wallet_send_0_eth(keys_screen, main_window, user_account, receiver_acco with step('Verify toast message with Transaction pending appears'): assert WalletTransactions.TRANSACTION_PENDING_TOAST_MESSAGE.value in ' '.join( main_window.wait_for_notification()) - - -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704602', - 'Send: can send ERC 721 token (collectible) to address pasted into receiver field with Simple flow') -@pytest.mark.case(704602) -@pytest.mark.transaction -@pytest.mark.parametrize('user_account', [constants.user.user_with_funds]) -@pytest.mark.parametrize('tab, receiver_account_address, amount, collectible', [ - pytest.param('Collectibles', constants.user.user_with_funds.status_address, 1, 'Panda') -]) -@pytest.mark.timeout(timeout=120) -def test_wallet_send_nft(keys_screen, main_window, user_account, tab, receiver_account_address, amount, collectible): - 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.IS_MAC: - BiometricsView().wait_until_appears().prefer_password() - SplashScreen().wait_until_appears().wait_until_hidden() - next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next() - if configs.system.IS_MAC: - next_view.start_using_status() - SplashScreen().wait_until_appears().wait_until_hidden() - if not configs.system.TEST_MODE: - BetaConsentPopup().confirm() - - 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() - - 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.is_mainnet_network_identified, configs.timeouts.UI_LOAD_TIMEOUT_SEC) - - with step('Enter password in authenticate popup'): - AuthenticatePopup().wait_until_appears().authenticate(user_account.password) - - with step('Verify toast message with Transaction pending appears'): - assert WalletTransactions.TRANSACTION_PENDING_TOAST_MESSAGE.value in ' '.join( - main_window.wait_for_notification()) diff --git a/test/e2e/tests/wallet_main_screen/wallet: footer actions/test_footer_actions_send_nft.py b/test/e2e/tests/wallet_main_screen/wallet: footer actions/test_footer_actions_send_nft.py new file mode 100644 index 0000000000..58e4d9a71b --- /dev/null +++ b/test/e2e/tests/wallet_main_screen/wallet: footer actions/test_footer_actions_send_nft.py @@ -0,0 +1,76 @@ +import allure +import pytest +from allure_commons._allure import step + +import configs +import constants +import driver +from constants.wallet import WalletTransactions +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.wallet.authenticate_popup import AuthenticatePopup +from gui.screens.onboarding import KeysView, WelcomeToStatusView, BiometricsView, YourEmojihashAndIdenticonRingView + + +@pytest.fixture +def keys_screen(main_window) -> KeysView: + with step('Open Generate new keys view'): + BeforeStartedPopUp().get_started() + welcome_screen = WelcomeToStatusView().wait_until_appears() + return welcome_screen.get_keys() + + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704602', + 'Send: can send ERC 721 token (collectible) to address pasted into receiver field with Simple flow') +@pytest.mark.case(704602) +@pytest.mark.transaction +@pytest.mark.parametrize('user_account', [constants.user.user_with_funds]) +@pytest.mark.parametrize('tab, receiver_account_address, amount, collectible', [ + pytest.param('Collectibles', constants.user.user_with_funds.status_address, 1, 'Panda') +]) +@pytest.mark.timeout(timeout=120) +def test_wallet_send_nft(keys_screen, main_window, user_account, tab, receiver_account_address, amount, collectible): + 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.IS_MAC: + BiometricsView().wait_until_appears().prefer_password() + SplashScreen().wait_until_appears().wait_until_hidden() + next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next() + if configs.system.IS_MAC: + next_view.start_using_status() + SplashScreen().wait_until_appears().wait_until_hidden() + if not configs.system.TEST_MODE: + BetaConsentPopup().confirm() + + 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() + + 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.is_mainnet_network_identified, configs.timeouts.UI_LOAD_TIMEOUT_SEC) + + with step('Enter password in authenticate popup'): + AuthenticatePopup().wait_until_appears().authenticate(user_account.password) + + with step('Verify toast message with Transaction pending appears'): + assert WalletTransactions.TRANSACTION_PENDING_TOAST_MESSAGE.value in ' '.join( + main_window.wait_for_notification())