diff --git a/gui/components/wallet/wallet_account_popups.py b/gui/components/wallet/wallet_account_popups.py index 1130bb9..5fba3c2 100644 --- a/gui/components/wallet/wallet_account_popups.py +++ b/gui/components/wallet/wallet_account_popups.py @@ -104,7 +104,7 @@ class AccountPopup(BasePopup): def set_derivation_path(self, value: str, index: int, password: str): self._edit_derivation_path_button.hover().click() AuthenticatePopup().wait_until_appears().authenticate(password) - if value in [_.value for _ in constants.wallet.DerivationPath]: + if value in [_.value for _ in DerivationPath]: self._derivation_path_combobox_button.click() self._derivation_path_list_item.real_name['title'] = value self._derivation_path_list_item.click() diff --git a/tests/communities/test_communities.py b/tests/communities/test_communities.py index 512f3b2..e2254d0 100644 --- a/tests/communities/test_communities.py +++ b/tests/communities/test_communities.py @@ -14,7 +14,6 @@ from gui.screens.community import CommunityScreen from scripts.tools import image - @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703084', 'Create community') @pytest.mark.case(703084) @pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/167") @@ -28,15 +27,15 @@ def test_create_community(user_account, main_screen: MainWindow, params): with step('Verify community parameters in community overview'): # TODO: change image comparison https://github.com/status-im/desktop-qa-automation/issues/263 # with step('Icon is correct'): - # community_icon = main_screen.left_panel.get_community_logo(params['name']) - # image.compare(community_icon, 'button_logo.png', timout_sec=5) + # community_icon = main_screen.left_panel.get_community_logo(params['name']) + # image.compare(community_icon, 'button_logo.png', timout_sec=5) with step('Name is correct'): assert community_screen.left_panel.name == params['name'] with step('Members count is correct'): assert '1' in community_screen.left_panel.members # TODO: change image comparison https://github.com/status-im/desktop-qa-automation/issues/263 # with step('Logo is correct'): - # image.compare(community_screen.left_panel.logo, 'logo.png') + # image.compare(community_screen.left_panel.logo, 'logo.png') with step('Verify community parameters in community settings view'): community_setting = community_screen.left_panel.open_community_settings() @@ -133,12 +132,12 @@ def test_edit_community(main_screen: MainWindow, params): # TODO: change image comparison https://github.com/status-im/desktop-qa-automation/issues/263 # with step('Icon is correct'): # community_icon = main_screen.left_panel.get_community_logo(params['name']) - # image.compare(community_icon, 'button_updated_logo.png') + # image.compare(community_icon, 'button_updated_logo.png') with step('Name is correct'): assert community_screen.left_panel.name == params['name'] # TODO: change image comparison https://github.com/status-im/desktop-qa-automation/issues/263 # with step('Logo is correct'): - # image.compare(community_screen.left_panel.logo, 'updated_logo.png') + # image.compare(community_screen.left_panel.logo, 'updated_logo.png') with step('Verify community parameters in community settings screen'): settings_screen = main_screen.left_panel.open_settings() diff --git a/tests/settings/settings_keycard/test_redirect_to_keycard_settings_from_wallet.py b/tests/settings/settings_keycard/test_redirect_to_keycard_settings_from_wallet.py new file mode 100644 index 0000000..47e53db --- /dev/null +++ b/tests/settings/settings_keycard/test_redirect_to_keycard_settings_from_wallet.py @@ -0,0 +1,25 @@ +import allure +import pytest +from allure_commons._allure import step + +from gui.components.signing_phrase_popup import SigningPhrasePopup +from gui.main_window import MainWindow +from gui.screens.settings_keycard import KeycardSettingsView + + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703514', + 'Choosing Use Keycard when adding account') +@pytest.mark.case(703514) +@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") +def test_use_keycard_when_adding_account(main_screen: MainWindow): + with step('Choose continue in keycard settings'): + wallet = main_screen.left_panel.open_wallet() + SigningPhrasePopup().wait_until_appears().confirm_phrase() + account_popup = wallet.left_panel.open_add_account_popup() + account_popup.continue_in_keycard_settings() + account_popup.wait_until_hidden() + + with (step('Verify that keycard settings view opened and all keycard settings available')): + keycard_view = KeycardSettingsView() + keycard_view.check_keycard_screen_loaded() + keycard_view.all_keycard_options_available() diff --git a/tests/settings/test_sign_out_and_quit.py b/tests/settings/test_settings_sign_out_and_quit.py similarity index 100% rename from tests/settings/test_sign_out_and_quit.py rename to tests/settings/test_settings_sign_out_and_quit.py diff --git a/tests/wallet_main_screen/test_context_menu_edit_default_account.py b/tests/wallet_main_screen/test_context_menu_edit_default_account.py new file mode 100644 index 0000000..20b77f7 --- /dev/null +++ b/tests/wallet_main_screen/test_context_menu_edit_default_account.py @@ -0,0 +1,39 @@ +import time + +import allure +import pytest +from allure_commons._allure import step + +import constants +from gui.components.signing_phrase_popup import SigningPhrasePopup +from gui.main_window import MainWindow + + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703022', 'Edit default wallet account') +@pytest.mark.case(703022) +@pytest.mark.parametrize('name, new_name, new_color, new_emoji, new_emoji_unicode', [ + pytest.param('Status account', 'MyPrimaryAccount', '#216266', 'sunglasses', '1f60e') +]) +def test_context_menu_edit_default_account(main_screen: MainWindow, name: str, new_name: str, new_color: str, new_emoji: str, + new_emoji_unicode: str): + with step('Select wallet account'): + wallet = main_screen.left_panel.open_wallet() + SigningPhrasePopup().wait_until_appears().confirm_phrase() + wallet.left_panel.select_account(name) + + with step("Verify default status account can't be deleted"): + context_menu = wallet.left_panel._open_context_menu_for_account(name) + assert not context_menu.is_delete_account_option_present(), \ + f"Delete option should not be present for Status account" + + with step('Edit wallet account'): + account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) + account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') diff --git a/tests/wallet_main_screen/test_context_menu_manage_watched_address.py b/tests/wallet_main_screen/test_context_menu_manage_watched_address.py new file mode 100644 index 0000000..505f3e5 --- /dev/null +++ b/tests/wallet_main_screen/test_context_menu_manage_watched_address.py @@ -0,0 +1,52 @@ +import time + +import allure +import pytest +from allure_commons._allure import step + +import constants +from gui.components.signing_phrase_popup import SigningPhrasePopup +from gui.components.toast_message import ToastMessage +from gui.main_window import MainWindow + + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703026', + 'Manage a watch-only account from context menu option') +@pytest.mark.case(703026) +@pytest.mark.parametrize('address, name, color, emoji, emoji_unicode, new_name, new_color,' + 'new_emoji, new_emoji_unicode', [ + pytest.param('0xea123F7beFF45E3C9fdF54B324c29DBdA14a639A', 'AccWatch1', '#2a4af5', + 'sunglasses', '1f60e', 'AccWatch1edited', '#216266', 'thumbsup', '1f44d') + ]) +def test_manage_watch_only_account_context_menu(main_screen: MainWindow, address: str, color: str, emoji: str, + emoji_unicode: str, + name: str, new_name: str, new_color: str, new_emoji: str, + new_emoji_unicode: str): + with step('Open wallet main screen and close signing phrase dialog'): + wallet = main_screen.left_panel.open_wallet() + SigningPhrasePopup().wait_until_appears().confirm_phrase() + + with step('Create watched address from context menu'): + account_popup = wallet.left_panel.select_add_watched_address_from_context_menu() + account_popup.set_name(name).set_emoji(emoji).set_color(color).set_eth_address(address).save() + account_popup.wait_until_hidden() + + with step('Verify toast message notification when adding account'): + assert len(ToastMessage().get_toast_messages) == 1, \ + f"Multiple toast messages appeared" + message = ToastMessage().get_toast_messages[0] + assert message == f'"{name}" successfully added' + + with step('Right click recently watched address and select edit option'): + account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) + + with step('Set new name, emoji and color for account and save'): + account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') diff --git a/tests/wallet_main_screen/test_wallet_main_can_add_account_after_restart.py b/tests/wallet_main_screen/test_plus_button_add_account_after_restart.py similarity index 100% rename from tests/wallet_main_screen/test_wallet_main_can_add_account_after_restart.py rename to tests/wallet_main_screen/test_plus_button_add_account_after_restart.py diff --git a/tests/wallet_main_screen/test_wlt_main_add_acc_manage_watched_address.py b/tests/wallet_main_screen/test_plus_button_add_watched_address.py similarity index 98% rename from tests/wallet_main_screen/test_wlt_main_add_acc_manage_watched_address.py rename to tests/wallet_main_screen/test_plus_button_add_watched_address.py index d30a358..af7603f 100644 --- a/tests/wallet_main_screen/test_wlt_main_add_acc_manage_watched_address.py +++ b/tests/wallet_main_screen/test_plus_button_add_watched_address.py @@ -18,7 +18,7 @@ from gui.main_window import MainWindow 'sunglasses', '1f60e') ]) @pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") -def test_wallet_add_acc_add_watched_address( +def test_plus_button_add_watched_address( main_screen: MainWindow, address: str, color: str, emoji: str, emoji_unicode: str, name: str): with step('Add watched address with plus action button'): diff --git a/tests/wallet_main_screen/test_plus_button_manage_account_added_for_imported_seed_phrase.py b/tests/wallet_main_screen/test_plus_button_manage_account_added_for_imported_seed_phrase.py new file mode 100644 index 0000000..aded7b3 --- /dev/null +++ b/tests/wallet_main_screen/test_plus_button_manage_account_added_for_imported_seed_phrase.py @@ -0,0 +1,72 @@ +import time + +import allure +import pytest +from allure import step + +import constants +import driver +from gui.components.signing_phrase_popup import SigningPhrasePopup +from gui.components.wallet.authenticate_popup import AuthenticatePopup +from gui.components.toast_message import ToastMessage +from gui.main_window import MainWindow + + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703036', + 'Manage an account created from the generated seed phrase') +@pytest.mark.case(703036) +@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('name, color, emoji, emoji_unicode, ' + 'new_name, new_color, new_emoji, new_emoji_unicode, keypair_name', [ + pytest.param('SPAcc', '#2a4af5', 'sunglasses', '1f60e', + 'SPAccedited', '#216266', 'thumbsup', '1f44d', 'SPKeyPair')]) +@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") +def test_plus_button_manage_account_added_for_imported_seed_phrase(main_screen: MainWindow, user_account, + name: str, color: str, emoji: str, emoji_unicode: str, + new_name: str, new_color: str, new_emoji: str, new_emoji_unicode: str, + keypair_name: str): + with step('Create generated seed phrase wallet account'): + wallet = main_screen.left_panel.open_wallet() + 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).set_origin_new_seed_phrase(keypair_name).save() + AuthenticatePopup().wait_until_appears().authenticate(user_account.password) + account_popup.wait_until_hidden() + + with step('Verify toast message notification when adding account'): + assert len(ToastMessage().get_toast_messages) == 1, \ + f"Multiple toast messages appeared" + message = ToastMessage().get_toast_messages[0] + assert message == f'"{name}" successfully added' + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') + + with step('Edit wallet account'): + account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) + account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') + + with step('Delete wallet account with agreement'): + wallet.left_panel.delete_account_from_context_menu(new_name).agree_and_confirm() + + with step('Verify toast message notification when removing account'): + messages = ToastMessage().get_toast_messages + assert f'"{new_name}" successfully removed' in messages, \ + f"Toast message about account removal is not correct or not present. Current list of messages: {messages}" + + with step('Verify that the account is not displayed in accounts list'): + assert driver.waitFor(lambda: new_name not in [account.name for account in wallet.left_panel.accounts], 10000), \ + f'Account with {new_name} is still displayed even it should not be' diff --git a/tests/wallet_main_screen/test_plus_button_manage_account_from_private_key.py b/tests/wallet_main_screen/test_plus_button_manage_account_from_private_key.py new file mode 100644 index 0000000..c42f82a --- /dev/null +++ b/tests/wallet_main_screen/test_plus_button_manage_account_from_private_key.py @@ -0,0 +1,81 @@ +import time + +import allure +import pytest +from allure_commons._allure import step + +import constants +import driver +from gui.components.signing_phrase_popup import SigningPhrasePopup +from gui.components.toast_message import ToastMessage +from gui.components.wallet.authenticate_popup import AuthenticatePopup +from gui.main_window import MainWindow + + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703029', 'Manage a private key imported account') +@pytest.mark.case(703029) +@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('address_pair', [constants.user.private_key_address_pair_1]) +@pytest.mark.parametrize('name, color, emoji, emoji_unicode, ' + 'new_name, new_color, new_emoji, new_emoji_unicode', [ + pytest.param('PrivKeyAcc1', '#2a4af5', 'sunglasses', '1f60e', + 'PrivKeyAcc1edited', '#216266', 'thumbsup', '1f44d') + ]) +@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") +def test_plus_button_manage_account_from_private_key(main_screen: MainWindow, user_account, address_pair, + name: str, color: str, emoji: str, emoji_unicode: str, + new_name: str, new_color: str, new_emoji: str, new_emoji_unicode: str): + with step('Import an account within private key'): + wallet = main_screen.left_panel.open_wallet() + 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).set_origin_private_key( + address_pair.private_key).save() + AuthenticatePopup().wait_until_appears().authenticate(user_account.password) + account_popup.wait_until_hidden() + + with step('Verify toast message notification when adding account'): + assert len(ToastMessage().get_toast_messages) == 1, \ + f"Multiple toast messages appeared" + message = ToastMessage().get_toast_messages[0] + assert message == f'"{name}" successfully added' + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') + + with step('Verify that importing private key reveals correct wallet address'): + settings_acc_view = ( + main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_account_in_settings(name)) + address = settings_acc_view.get_account_address_value() + assert address == address_pair.wallet_address, \ + f"Recovered account should have address {address_pair.wallet_address}, but has {address}" + + with step('Edit wallet account'): + main_screen.left_panel.open_wallet() + account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) + account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') + + with step('Delete wallet account'): + wallet.left_panel.delete_account_from_context_menu(new_name).confirm() + + with step('Verify toast message notification when removing account'): + messages = ToastMessage().get_toast_messages + assert f'"{new_name}" successfully removed' in messages, \ + f"Toast message about account removal is not correct or not present. Current list of messages: {messages}" + + with step('Verify that the account is not displayed in accounts list'): + assert driver.waitFor(lambda: new_name not in [account.name for account in wallet.left_panel.accounts], 10000), \ + f'Account with {new_name} is still displayed even it should not be' diff --git a/tests/wallet_main_screen/test_plus_button_manage_account_from_seed_phrase.py b/tests/wallet_main_screen/test_plus_button_manage_account_from_seed_phrase.py new file mode 100644 index 0000000..88275f2 --- /dev/null +++ b/tests/wallet_main_screen/test_plus_button_manage_account_from_seed_phrase.py @@ -0,0 +1,82 @@ +import time + +import allure +import pytest +from allure_commons._allure import step + +import constants +import driver +from gui.components.signing_phrase_popup import SigningPhrasePopup +from gui.components.toast_message import ToastMessage +from gui.components.wallet.authenticate_popup import AuthenticatePopup +from gui.main_window import MainWindow + + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703030', 'Manage a seed phrase imported account') +@pytest.mark.case(703030) +@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('name, color, emoji, emoji_unicode, ' + 'new_name, new_color, new_emoji, new_emoji_unicode, seed_phrase', [ + pytest.param('SPAcc24', '#2a4af5', 'sunglasses', '1f60e', + 'SPAcc24edited', '#216266', 'thumbsup', '1f44d', + 'elite dinosaur flavor canoe garbage palace antique dolphin virtual mixed sand ' + 'impact solution inmate hair pipe affair cage vote estate gloom lamp robust like'), + pytest.param('SPAcc18', '#2a4af5', 'sunglasses', '1f60e', + 'SPAcc18edited', '#216266', 'thumbsup', '1f44d', + 'kitten tiny cup admit cactus shrug shuffle accident century faith roof plastic ' + 'beach police barely vacant sign blossom'), + pytest.param('SPAcc12', '#2a4af5', 'sunglasses', '1f60e', + 'SPAcc12edited', '#216266', 'thumbsup', '1f44d', + 'pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial') + ]) +@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") +def test_plus_button_manage_account_from_seed_phrase(main_screen: MainWindow, user_account, + name: str, color: str, emoji: str, emoji_unicode: str, + new_name: str, new_color: str, new_emoji: str, new_emoji_unicode: str, + seed_phrase: str): + with step('Create imported seed phrase wallet account'): + wallet = main_screen.left_panel.open_wallet() + 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).set_origin_seed_phrase( + seed_phrase.split()).save() + AuthenticatePopup().wait_until_appears().authenticate(user_account.password) + account_popup.wait_until_hidden() + + with step('Verify toast message notification when adding account'): + assert len(ToastMessage().get_toast_messages) == 1, \ + f"Multiple toast messages appeared" + message = ToastMessage().get_toast_messages[0] + assert message == f'"{name}" successfully added' + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') + + with step('Edit wallet account'): + account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) + account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') + + with step('Delete wallet account with agreement'): + wallet.left_panel.delete_account_from_context_menu(new_name).agree_and_confirm() + + with step('Verify toast message notification when removing account'): + messages = ToastMessage().get_toast_messages + assert f'"{new_name}" successfully removed' in messages, \ + f"Toast message about account removal is not correct or not present. Current list of messages: {messages}" + + with step('Verify that the account is not displayed in accounts list'): + assert driver.waitFor(lambda: new_name not in [account.name for account in wallet.left_panel.accounts], 10000), \ + f'Account with {new_name} is still displayed even it should not be' diff --git a/tests/wallet_main_screen/test_plus_button_manage_generated_account.py b/tests/wallet_main_screen/test_plus_button_manage_generated_account.py new file mode 100644 index 0000000..5913fd3 --- /dev/null +++ b/tests/wallet_main_screen/test_plus_button_manage_generated_account.py @@ -0,0 +1,71 @@ +import time + +import allure +import pytest +from allure_commons._allure import step + +import constants +import driver +from gui.components.signing_phrase_popup import SigningPhrasePopup +from gui.components.toast_message import ToastMessage +from gui.components.wallet.authenticate_popup import AuthenticatePopup +from gui.main_window import MainWindow + + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703033', 'Manage a generated account') +@pytest.mark.case(703033) +@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('name, color, emoji, emoji_unicode, ' + 'new_name, new_color, new_emoji, new_emoji_unicode', [ + pytest.param('GenAcc1', '#2a4af5', 'sunglasses', '1f60e', + 'GenAcc1edited', '#216266', 'thumbsup', '1f44d') + ]) +@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") +def test_plus_button_manage_generated_account(main_screen: MainWindow, user_account, + color: str, emoji: str, emoji_unicode: str, + name: str, new_name: str, new_color: str, new_emoji: str, new_emoji_unicode: str): + with step('Create generated wallet account'): + wallet = main_screen.left_panel.open_wallet() + 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() + AuthenticatePopup().wait_until_appears().authenticate(user_account.password) + account_popup.wait_until_hidden() + + with step('Verify toast message notification when adding account'): + assert len(ToastMessage().get_toast_messages) == 1, \ + f"Multiple toast messages appeared" + message = ToastMessage().get_toast_messages[0] + assert message == f'"{name}" successfully added' + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') + + with step('Edit wallet account'): + account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) + account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') + + with step('Delete wallet account with agreement'): + wallet.left_panel.delete_account_from_context_menu(new_name).agree_and_confirm() + + with step('Verify toast message notification when removing account'): + messages = ToastMessage().get_toast_messages + assert f'"{new_name}" successfully removed' in messages, \ + f"Toast message about account removal is not correct or not present. Current list of messages: {messages}" + + with step('Verify that the account is not displayed in accounts list'): + assert driver.waitFor(lambda: new_name not in [account.name for account in wallet.left_panel.accounts], 10000), \ + f'Account with {new_name} is still displayed even it should not be' diff --git a/tests/wallet_main_screen/test_plus_button_manage_generated_account_custom_derivation_path.py b/tests/wallet_main_screen/test_plus_button_manage_generated_account_custom_derivation_path.py new file mode 100644 index 0000000..9542a38 --- /dev/null +++ b/tests/wallet_main_screen/test_plus_button_manage_generated_account_custom_derivation_path.py @@ -0,0 +1,61 @@ +import time + +import allure +import pytest +from allure_commons._allure import step + +import constants +import driver +from gui.components.signing_phrase_popup import SigningPhrasePopup +from gui.components.toast_message import ToastMessage +from gui.main_window import MainWindow + + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703028', 'Manage a custom generated account') +@pytest.mark.case(703028) +@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('derivation_path, generated_address_index, name, color, emoji, emoji_unicode', [ + pytest.param('Ethereum', '5', 'Ethereum', '#216266', 'sunglasses', '1f60e'), + pytest.param('Ethereum Testnet (Ropsten)', '10', 'Ethereum Testnet ', '#7140fd', 'sunglasses', '1f60e'), + pytest.param('Ethereum (Ledger)', '15', 'Ethereum Ledger', '#2a799b', 'sunglasses', '1f60e'), + pytest.param('Ethereum (Ledger Live/KeepKey)', '20', 'Ethereum Ledger Live', '#7140fd', 'sunglasses', '1f60e'), + pytest.param('N/A', '95', 'Custom path', '#216266', 'sunglasses', '1f60e') +]) +#@pytest.mark.skip(reason='https://github.com/status-im/desktop-qa-automation/issues/220') +#@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") +def test_plus_button_manage_generated_account_custom_derivation_path(main_screen: MainWindow, user_account, + derivation_path: str, generated_address_index: int, + name: str, color: str, emoji: str, emoji_unicode: str): + with step('Create generated wallet account'): + wallet = main_screen.left_panel.open_wallet() + 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).set_derivation_path(derivation_path, + generated_address_index, + user_account.password).save() + + with step('Verify toast message notification when adding account'): + assert len(ToastMessage().get_toast_messages) == 1, \ + f"Multiple toast messages appeared" + message = ToastMessage().get_toast_messages[0] + assert message == f'"{name}" successfully added' + + with step('Verify that the account is correctly displayed in accounts list'): + expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) + started_at = time.monotonic() + while expected_account not in wallet.left_panel.accounts: + time.sleep(1) + if time.monotonic() - started_at > 15: + raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') + + with step('Delete wallet account with agreement'): + wallet.left_panel.delete_account_from_context_menu(name).agree_and_confirm() + + with step('Verify toast message notification when removing account'): + messages = ToastMessage().get_toast_messages + assert f'"{name}" successfully removed' in messages, \ + f"Toast message about account removal is not correct or not present. Current list of messages: {messages}" + + with step('Verify that the account is not displayed in accounts list'): + assert driver.waitFor(lambda: name not in [account.name for account in wallet.left_panel.accounts], 10000), \ + f'Account with {name} is still displayed even it should not be' diff --git a/tests/wallet_main_screen/test_wallet_main_saved_addresses.py b/tests/wallet_main_screen/test_saved_addresses.py similarity index 100% rename from tests/wallet_main_screen/test_wallet_main_saved_addresses.py rename to tests/wallet_main_screen/test_saved_addresses.py diff --git a/tests/wallet_main_screen/test_wallet_main_manage_accounts.py b/tests/wallet_main_screen/test_wallet_main_manage_accounts.py deleted file mode 100644 index 5044970..0000000 --- a/tests/wallet_main_screen/test_wallet_main_manage_accounts.py +++ /dev/null @@ -1,407 +0,0 @@ -import time - -import allure -import pytest -from allure import step - -import constants -import driver -from gui.components.signing_phrase_popup import SigningPhrasePopup -from gui.components.wallet.authenticate_popup import AuthenticatePopup -from gui.components.toast_message import ToastMessage -from gui.main_window import MainWindow -from gui.screens.settings_keycard import KeycardSettingsView - - -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703022', 'Edit default wallet account') -@pytest.mark.case(703022) -@pytest.mark.parametrize('name, new_name, new_color, new_emoji, new_emoji_unicode', [ - pytest.param('Status account', 'MyPrimaryAccount', '#216266', 'sunglasses', '1f60e') -]) -def test_edit_default_wallet_account(main_screen: MainWindow, name: str, new_name: str, new_color: str, new_emoji: str, - new_emoji_unicode: str): - with step('Select wallet account'): - wallet = main_screen.left_panel.open_wallet() - SigningPhrasePopup().wait_until_appears().confirm_phrase() - wallet.left_panel.select_account(name) - - with step("Verify default status account can't be deleted"): - context_menu = wallet.left_panel._open_context_menu_for_account(name) - assert not context_menu.is_delete_account_option_present(), \ - f"Delete option should not be present for Status account" - - with step('Edit wallet account'): - account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) - account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703026', - 'Manage a watch-only account from context menu option') -@pytest.mark.case(703026) -@pytest.mark.parametrize('address, name, color, emoji, emoji_unicode, new_name, new_color,' - 'new_emoji, new_emoji_unicode', [ - pytest.param('0xea123F7beFF45E3C9fdF54B324c29DBdA14a639A', 'AccWatch1', '#2a4af5', - 'sunglasses', '1f60e', 'AccWatch1edited', '#216266', 'thumbsup', '1f44d') - ]) -def test_manage_watch_only_account_context_menu(main_screen: MainWindow, address: str, color: str, emoji: str, - emoji_unicode: str, - name: str, new_name: str, new_color: str, new_emoji: str, - new_emoji_unicode: str): - with step('Create watch-only wallet account via context menu'): - wallet = main_screen.left_panel.open_wallet() - SigningPhrasePopup().wait_until_appears().confirm_phrase() - account_popup = wallet.left_panel.select_add_watched_address_from_context_menu() - account_popup.set_name(name).set_emoji(emoji).set_color(color).set_eth_address(address).save() - account_popup.wait_until_hidden() - - with step('Verify toast message notification when adding account'): - assert len(ToastMessage().get_toast_messages) == 1, \ - f"Multiple toast messages appeared" - message = ToastMessage().get_toast_messages[0] - assert message == f'"{name}" successfully added' - - with step('Edit wallet account'): - account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) - account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703033', 'Manage a generated account') -@pytest.mark.case(703033) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) -@pytest.mark.parametrize('name, color, emoji, emoji_unicode, ' - 'new_name, new_color, new_emoji, new_emoji_unicode', [ - pytest.param('GenAcc1', '#2a4af5', 'sunglasses', '1f60e', - 'GenAcc1edited', '#216266', 'thumbsup', '1f44d') - ]) -@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") -def test_manage_generated_account(main_screen: MainWindow, user_account, - color: str, emoji: str, emoji_unicode: str, - name: str, new_name: str, new_color: str, new_emoji: str, new_emoji_unicode: str): - with step('Create generated wallet account'): - wallet = main_screen.left_panel.open_wallet() - 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() - AuthenticatePopup().wait_until_appears().authenticate(user_account.password) - account_popup.wait_until_hidden() - - with step('Verify toast message notification when adding account'): - assert len(ToastMessage().get_toast_messages) == 1, \ - f"Multiple toast messages appeared" - message = ToastMessage().get_toast_messages[0] - assert message == f'"{name}" successfully added' - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - with step('Edit wallet account'): - account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) - account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - with step('Delete wallet account with agreement'): - wallet.left_panel.delete_account_from_context_menu(new_name).agree_and_confirm() - - with step('Verify toast message notification when removing account'): - messages = ToastMessage().get_toast_messages - assert f'"{new_name}" successfully removed' in messages, \ - f"Toast message about account removal is not correct or not present. Current list of messages: {messages}" - - with step('Verify that the account is not displayed in accounts list'): - assert driver.waitFor(lambda: new_name not in [account.name for account in wallet.left_panel.accounts], 10000), \ - f'Account with {new_name} is still displayed even it should not be' - - -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703028', 'Manage a custom generated account') -@pytest.mark.case(703028) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) -@pytest.mark.parametrize('derivation_path, generated_address_index, name, color, emoji, emoji_unicode', [ - pytest.param('Ethereum', '5', 'Ethereum', '#216266', 'sunglasses', '1f60e'), - pytest.param('Ethereum Testnet (Ropsten)', '10', 'Ethereum Testnet ', '#7140fd', 'sunglasses', '1f60e'), - pytest.param('Ethereum (Ledger)', '15', 'Ethereum Ledger', '#2a799b', 'sunglasses', '1f60e'), - pytest.param('Ethereum (Ledger Live/KeepKey)', '20', 'Ethereum Ledger Live', '#7140fd', 'sunglasses', '1f60e'), - pytest.param('N/A', '95', 'Custom path', '#216266', 'sunglasses', '1f60e') -]) -@pytest.mark.skip(reason='https://github.com/status-im/desktop-qa-automation/issues/220') -@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") -def test_manage_custom_generated_account(main_screen: MainWindow, user_account, - derivation_path: str, generated_address_index: int, - name: str, color: str, emoji: str, emoji_unicode: str): - with step('Create generated wallet account'): - wallet = main_screen.left_panel.open_wallet() - 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).set_derivation_path(derivation_path, - generated_address_index, - user_account.password).save() - - with step('Verify toast message notification when adding account'): - assert len(ToastMessage().get_toast_messages) == 1, \ - f"Multiple toast messages appeared" - message = ToastMessage().get_toast_messages[0] - assert message == f'"{name}" successfully added' - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - with step('Delete wallet account with agreement'): - wallet.left_panel.delete_account_from_context_menu(name).agree_and_confirm() - - with step('Verify toast message notification when removing account'): - messages = ToastMessage().get_toast_messages - assert f'"{name}" successfully removed' in messages, \ - f"Toast message about account removal is not correct or not present. Current list of messages: {messages}" - - with step('Verify that the account is not displayed in accounts list'): - assert driver.waitFor(lambda: name not in [account.name for account in wallet.left_panel.accounts], 10000), \ - f'Account with {name} is still displayed even it should not be' - - -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703029', 'Manage a private key imported account') -@pytest.mark.case(703029) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) -@pytest.mark.parametrize('address_pair', [constants.user.private_key_address_pair_1]) -@pytest.mark.parametrize('name, color, emoji, emoji_unicode, ' - 'new_name, new_color, new_emoji, new_emoji_unicode', [ - pytest.param('PrivKeyAcc1', '#2a4af5', 'sunglasses', '1f60e', - 'PrivKeyAcc1edited', '#216266', 'thumbsup', '1f44d') - ]) -@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") -def test_private_key_imported_account(main_screen: MainWindow, user_account, address_pair, - name: str, color: str, emoji: str, emoji_unicode: str, - new_name: str, new_color: str, new_emoji: str, new_emoji_unicode: str): - with step('Import an account within private key'): - wallet = main_screen.left_panel.open_wallet() - 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).set_origin_private_key( - address_pair.private_key).save() - AuthenticatePopup().wait_until_appears().authenticate(user_account.password) - account_popup.wait_until_hidden() - - with step('Verify toast message notification when adding account'): - assert len(ToastMessage().get_toast_messages) == 1, \ - f"Multiple toast messages appeared" - message = ToastMessage().get_toast_messages[0] - assert message == f'"{name}" successfully added' - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - with step('Verify that importing private key reveals correct wallet address'): - settings_acc_view = ( - main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_account_in_settings(name)) - address = settings_acc_view.get_account_address_value() - assert address == address_pair.wallet_address, \ - f"Recovered account should have address {address_pair.wallet_address}, but has {address}" - - with step('Edit wallet account'): - main_screen.left_panel.open_wallet() - account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) - account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - with step('Delete wallet account'): - wallet.left_panel.delete_account_from_context_menu(new_name).confirm() - - with step('Verify toast message notification when removing account'): - messages = ToastMessage().get_toast_messages - assert f'"{new_name}" successfully removed' in messages, \ - f"Toast message about account removal is not correct or not present. Current list of messages: {messages}" - - with step('Verify that the account is not displayed in accounts list'): - assert driver.waitFor(lambda: new_name not in [account.name for account in wallet.left_panel.accounts], 10000), \ - f'Account with {new_name} is still displayed even it should not be' - - -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703030', 'Manage a seed phrase imported account') -@pytest.mark.case(703030) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) -@pytest.mark.parametrize('name, color, emoji, emoji_unicode, ' - 'new_name, new_color, new_emoji, new_emoji_unicode, seed_phrase', [ - pytest.param('SPAcc24', '#2a4af5', 'sunglasses', '1f60e', - 'SPAcc24edited', '#216266', 'thumbsup', '1f44d', - 'elite dinosaur flavor canoe garbage palace antique dolphin virtual mixed sand ' - 'impact solution inmate hair pipe affair cage vote estate gloom lamp robust like'), - pytest.param('SPAcc18', '#2a4af5', 'sunglasses', '1f60e', - 'SPAcc18edited', '#216266', 'thumbsup', '1f44d', - 'kitten tiny cup admit cactus shrug shuffle accident century faith roof plastic ' - 'beach police barely vacant sign blossom'), - pytest.param('SPAcc12', '#2a4af5', 'sunglasses', '1f60e', - 'SPAcc12edited', '#216266', 'thumbsup', '1f44d', - 'pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial') - ]) -@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") -def test_seed_phrase_imported_account(main_screen: MainWindow, user_account, - name: str, color: str, emoji: str, emoji_unicode: str, - new_name: str, new_color: str, new_emoji: str, new_emoji_unicode: str, - seed_phrase: str): - with step('Create imported seed phrase wallet account'): - wallet = main_screen.left_panel.open_wallet() - 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).set_origin_seed_phrase( - seed_phrase.split()).save() - AuthenticatePopup().wait_until_appears().authenticate(user_account.password) - account_popup.wait_until_hidden() - - with step('Verify toast message notification when adding account'): - assert len(ToastMessage().get_toast_messages) == 1, \ - f"Multiple toast messages appeared" - message = ToastMessage().get_toast_messages[0] - assert message == f'"{name}" successfully added' - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - with step('Edit wallet account'): - account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) - account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - with step('Delete wallet account with agreement'): - wallet.left_panel.delete_account_from_context_menu(new_name).agree_and_confirm() - - with step('Verify toast message notification when removing account'): - messages = ToastMessage().get_toast_messages - assert f'"{new_name}" successfully removed' in messages, \ - f"Toast message about account removal is not correct or not present. Current list of messages: {messages}" - - with step('Verify that the account is not displayed in accounts list'): - assert driver.waitFor(lambda: new_name not in [account.name for account in wallet.left_panel.accounts], 10000), \ - f'Account with {new_name} is still displayed even it should not be' - - -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703036', - 'Manage an account created from the generated seed phrase') -@pytest.mark.case(703036) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) -@pytest.mark.parametrize('name, color, emoji, emoji_unicode, ' - 'new_name, new_color, new_emoji, new_emoji_unicode, keypair_name', [ - pytest.param('SPAcc', '#2a4af5', 'sunglasses', '1f60e', - 'SPAccedited', '#216266', 'thumbsup', '1f44d', 'SPKeyPair')]) -@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") -def test_seed_phrase_generated_account(main_screen: MainWindow, user_account, - name: str, color: str, emoji: str, emoji_unicode: str, - new_name: str, new_color: str, new_emoji: str, new_emoji_unicode: str, - keypair_name: str): - with step('Create generated seed phrase wallet account'): - wallet = main_screen.left_panel.open_wallet() - 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).set_origin_new_seed_phrase(keypair_name).save() - AuthenticatePopup().wait_until_appears().authenticate(user_account.password) - account_popup.wait_until_hidden() - - with step('Verify toast message notification when adding account'): - assert len(ToastMessage().get_toast_messages) == 1, \ - f"Multiple toast messages appeared" - message = ToastMessage().get_toast_messages[0] - assert message == f'"{name}" successfully added' - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - with step('Edit wallet account'): - account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) - account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save() - - with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode) - started_at = time.monotonic() - while expected_account not in wallet.left_panel.accounts: - time.sleep(1) - if time.monotonic() - started_at > 15: - raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') - - with step('Delete wallet account with agreement'): - wallet.left_panel.delete_account_from_context_menu(new_name).agree_and_confirm() - - with step('Verify toast message notification when removing account'): - messages = ToastMessage().get_toast_messages - assert f'"{new_name}" successfully removed' in messages, \ - f"Toast message about account removal is not correct or not present. Current list of messages: {messages}" - - with step('Verify that the account is not displayed in accounts list'): - assert driver.waitFor(lambda: new_name not in [account.name for account in wallet.left_panel.accounts], 10000), \ - f'Account with {new_name} is still displayed even it should not be' - - -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703514', - 'Choosing Use Keycard when adding account') -@pytest.mark.case(703514) -@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914") -def test_use_keycard_when_adding_account(main_screen: MainWindow): - with step('Choose continue in keycard settings'): - wallet = main_screen.left_panel.open_wallet() - SigningPhrasePopup().wait_until_appears().confirm_phrase() - account_popup = wallet.left_panel.open_add_account_popup() - account_popup.continue_in_keycard_settings() - account_popup.wait_until_hidden() - - with (step('Verify that keycard settings view opened and all keycard settings available')): - keycard_view = KeycardSettingsView() - keycard_view.check_keycard_screen_loaded() - keycard_view.all_keycard_options_available()