diff --git a/test/e2e/conftest.py b/test/e2e/conftest.py index 671d028081..8ca77f5e87 100644 --- a/test/e2e/conftest.py +++ b/test/e2e/conftest.py @@ -32,8 +32,7 @@ pytest_plugins = [ def setup_session_scope( init_testrail_api, prepare_test_directory, - start_squish_server, - close_apps_before_start + start_squish_server ): LOG.info('Session startup...') yield diff --git a/test/e2e/driver/aut.py b/test/e2e/driver/aut.py index 20147b0b0e..7e5ef24fe1 100644 --- a/test/e2e/driver/aut.py +++ b/test/e2e/driver/aut.py @@ -1,3 +1,4 @@ +import os import time import allure @@ -96,6 +97,7 @@ class AUT: def startaut(self): LOG.info('Launching AUT: %s', self.path) self.port = local_system.find_free_port(configs.squish.AUT_PORT, 100) + command = [ str(configs.testpath.SQUISH_DIR / 'bin/startaut'), '--verbose', diff --git a/test/e2e/fixtures/aut.py b/test/e2e/fixtures/aut.py index 49ddf7b08a..d94e7172a8 100644 --- a/test/e2e/fixtures/aut.py +++ b/test/e2e/fixtures/aut.py @@ -92,14 +92,3 @@ def main_screen(user_account: UserAccount, main_window: MainWindow) -> MainWindo main_window.authorize_user(user_account) return main_window - -@pytest.fixture(scope="session") -def close_apps_before_start(): - if get_platform() == "Windows": - name = 'Status.exe' - else: - name = 'nim_status_client' - running_pids = get_pid_by_process_name(name) - if running_pids is not None: - for pid in running_pids: - kill_process(pid) diff --git a/test/e2e/gui/components/authenticate_popup.py b/test/e2e/gui/components/authenticate_popup.py index dbd5325020..5d7ecf0d3c 100644 --- a/test/e2e/gui/components/authenticate_popup.py +++ b/test/e2e/gui/components/authenticate_popup.py @@ -27,8 +27,7 @@ class AuthenticatePopup(BasePopup): def authenticate(self, password: str): self._password_text_edit.type_text(password) # TODO https://github.com/status-im/status-desktop/issues/15345 - self._primary_button.click(timeout=60) - self._authenticate_button.wait_until_hidden(10000) + self._primary_button.click() @allure.step('Check if authenticate button is present') def is_authenticate_button_visible(self): diff --git a/test/e2e/gui/components/profile_popup.py b/test/e2e/gui/components/profile_popup.py index 154c17fb6c..e7ff7957d7 100644 --- a/test/e2e/gui/components/profile_popup.py +++ b/test/e2e/gui/components/profile_popup.py @@ -118,7 +118,7 @@ class ProfilePopupFromMembers(ProfilePopup): @allure.step('Click review contact request button') def review_contact_request(self): - assert driver.waitFor(lambda: self._review_request_button.is_visible, 15000) + self._review_request_button.wait_until_appears(15000) self._review_request_button.click() return AcceptRequestFromProfile().wait_until_appears() diff --git a/test/e2e/gui/components/wallet/remove_wallet_account_popup.py b/test/e2e/gui/components/wallet/remove_wallet_account_popup.py index 04c6fa996c..45a6fef320 100644 --- a/test/e2e/gui/components/wallet/remove_wallet_account_popup.py +++ b/test/e2e/gui/components/wallet/remove_wallet_account_popup.py @@ -28,5 +28,5 @@ class RemoveWalletAccountPopup(BasePopup): @allure.step('Agree and confirm removing account') def agree_and_confirm(self): - self._have_pen_paper_checkbox.wait_until_appears().set(True) + self._have_pen_paper_checkbox.set(True) self.confirm() diff --git a/test/e2e/gui/components/wallet/wallet_account_popups.py b/test/e2e/gui/components/wallet/wallet_account_popups.py index da968e1fc3..51f36ee4b4 100644 --- a/test/e2e/gui/components/wallet/wallet_account_popups.py +++ b/test/e2e/gui/components/wallet/wallet_account_popups.py @@ -47,7 +47,7 @@ class AccountPopup(BasePopup): self._non_eth_checkbox = CheckBox(names.mainWallet_AddEditAccountPopup_NonEthDerivationPathCheckBox) def verify_add_account_popup_present(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC): - driver.waitFor(lambda: self._popup_header_title.exists, timeout_msec) + driver.waitFor(lambda: self._popup_header_title.is_visible, timeout_msec) assert (getattr(self._popup_header_title.object, 'text') == WalletScreensHeaders.WALLET_ADD_ACCOUNT_POPUP_TITLE.value), \ f"AccountPopup is not shown or has wrong title, \ diff --git a/test/e2e/gui/elements/object.py b/test/e2e/gui/elements/object.py index 58de63a318..1e2bbfbe16 100644 --- a/test/e2e/gui/elements/object.py +++ b/test/e2e/gui/elements/object.py @@ -21,7 +21,12 @@ class QObject: @property @allure.step('Get object {0}') def object(self): - return driver.waitForObject(self.real_name, configs.timeouts.UI_LOAD_TIMEOUT_MSEC) + try: + obj = driver.waitForObject(self.real_name, configs.timeouts.UI_LOAD_TIMEOUT_MSEC) + except LookupError: + raise LookupError(f"Object {self.real_name} was not found within {configs.timeouts.UI_LOAD_TIMEOUT_MSEC}") + return obj + def set_text_property(self, text): self.object.forceActiveFocus() diff --git a/test/e2e/gui/elements/text_edit.py b/test/e2e/gui/elements/text_edit.py index 028d727393..0ffdd5b31e 100644 --- a/test/e2e/gui/elements/text_edit.py +++ b/test/e2e/gui/elements/text_edit.py @@ -19,7 +19,8 @@ class TextEdit(QObject): @text.setter @allure.step('Type text {1} {0}') def text(self, value: str): - self.clear() + if self.text: + self.clear() self.type_text(value) assert driver.waitFor(lambda: self.text == value, configs.timeouts.UI_LOAD_TIMEOUT_MSEC), \ f'Type text failed, value in field: "{self.text}", expected: {value}' diff --git a/test/e2e/gui/main_window.py b/test/e2e/gui/main_window.py index ee0eef9b04..882c4ee4da 100644 --- a/test/e2e/gui/main_window.py +++ b/test/e2e/gui/main_window.py @@ -228,4 +228,5 @@ class MainWindow(Window): return ToastMessage().get_toast_messages() except LookupError as err: LOG.info(err) - assert time.monotonic() - started_at < timeout_msec, str(err) + if time.monotonic() - started_at > timeout_msec: + raise LookupError(f'Notifications are not found') diff --git a/test/e2e/gui/objects_map/names.py b/test/e2e/gui/objects_map/names.py index a5f91e4c2d..78338acc3d 100644 --- a/test/e2e/gui/objects_map/names.py +++ b/test/e2e/gui/objects_map/names.py @@ -106,7 +106,7 @@ copy_icon_CopyButton = {"container": ProfileContentItem, "objectName": "copy-ico request_ID_verification_StatusFlatButton = {"checkable": False, "container": ProfileContentItem, "objectName": "requestIDVerification_StatusItem", "type": "StatusFlatButton", "visible": True} send_Message_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "sendMessageButton", "type": "StatusButton", "visible": True} send_contact_request_StatusButton = {"checkable": False, "container": ProfileContentItem, "objectName": "profileDialog_sendContactRequestButton", "type": "StatusButton", "visible": True} -review_contact_request_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "objectName": "profileDialog_reviewContactRequestButton", "type": "StatusButton", "visible": True} +review_contact_request_StatusButton = {"checkable": False, "container": ProfileContentItem, "objectName": "profileDialog_reviewContactRequestButton", "type": "StatusButton", "visible": True} profileDialogView_ContentItem = {"container": statusDesktop_mainWindow_overlay, "objectName": "ProfileDialogView", "type": "ContentItem", "visible": True} menuButton_StatusFlatButton = {"checkable": False, "container": profileDialogView_ContentItem, "id": "menuButton", "type": "StatusFlatButton", "unnamed": 1, "visible": True} block_user_StatusMenuItem = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "enabled": True, "objectName": "blockUserStatusAction", "type": "StatusMenuItem", "visible": True} diff --git a/test/e2e/gui/screens/wallet.py b/test/e2e/gui/screens/wallet.py index 79eeab09c5..75c7262b45 100644 --- a/test/e2e/gui/screens/wallet.py +++ b/test/e2e/gui/screens/wallet.py @@ -50,7 +50,7 @@ class LeftPanel(QObject): def accounts(self) -> typing.List[constants.user.account_list_item]: if 'title' in self._wallet_account_item.real_name.keys(): del self._wallet_account_item.real_name['title'] - time.sleep(1) # to give a chance to build the list + time.sleep(1) # to give a chance for the left panel to refresh raw_data = driver.findAllObjects(self._wallet_account_item.real_name) accounts = [] if len(raw_data) > 0: @@ -98,8 +98,8 @@ class LeftPanel(QObject): existing_accounts_names = [account.name for account in account_items] if account_name in existing_accounts_names: self._wallet_account_item.real_name['title'] = account_name - time.sleep(0.5) self._wallet_account_item.click() + time.sleep(0.5) self._wallet_account_item.right_click() return ContextMenu() else: diff --git a/test/e2e/helpers/WalletHelper.py b/test/e2e/helpers/WalletHelper.py index 5deb2a7f07..d39bdf7026 100644 --- a/test/e2e/helpers/WalletHelper.py +++ b/test/e2e/helpers/WalletHelper.py @@ -9,6 +9,7 @@ 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) + AuthenticatePopup().wait_until_hidden() with step('Close signing phrase popup and open wallet send popup'): def open_send_modal_for_account(main_window, account_name): diff --git a/test/e2e/scripts/utils/generators.py b/test/e2e/scripts/utils/generators.py index fefb0b9b87..effd2367a1 100644 --- a/test/e2e/scripts/utils/generators.py +++ b/test/e2e/scripts/utils/generators.py @@ -65,7 +65,7 @@ def random_mnemonic(): return words -def random_wallet_account_name(): +def random_wallet_acc_keypair_name(): return ''.join((random.choice( string.ascii_letters + string.digits) for _ in range(5, 21))) diff --git a/test/e2e/tests/communities/test_communities_screens_overview.py b/test/e2e/tests/communities/test_communities_screens_overview.py index da33d3458a..a88c99fabd 100644 --- a/test/e2e/tests/communities/test_communities_screens_overview.py +++ b/test/e2e/tests/communities/test_communities_screens_overview.py @@ -38,7 +38,7 @@ def test_manage_community_screens_overview(main_screen: MainWindow): assert airdrops_screen.is_new_airdrop_button_present is True, \ f'New airdrop button should be disabled by default' with step('Airdrops welcome image source path is correct'): - assert AIRDROPS_WELCOME_IMAGE_PATH == str(airdrops_screen.airdrops_welcome_image_path) + assert AIRDROPS_WELCOME_IMAGE_PATH in str(airdrops_screen.airdrops_welcome_image_path) with step('Airdrops welcome title is correct'): assert airdrops_screen.airdrops_welcome_title == AirdropsElements.WELCOME_TITLE.value with step('Airdrops welcome subtitle is correct'): @@ -60,7 +60,7 @@ def test_manage_community_screens_overview(main_screen: MainWindow): assert tokens_screen.is_mint_token_button_present is True, \ f'Mint token button should be present' with step('Tokens welcome image path is correct'): - assert TOKENS_WELCOME_IMAGE_PATH == str(tokens_screen.tokens_welcome_image_path) + assert TOKENS_WELCOME_IMAGE_PATH in str(tokens_screen.tokens_welcome_image_path) with step('Tokens welcome title is correct'): assert tokens_screen.tokens_welcome_title == TokensElements.WELCOME_TITLE.value with step('Tokens welcome subtitle is correct'): @@ -83,7 +83,7 @@ def test_manage_community_screens_overview(main_screen: MainWindow): assert permissions_settings.is_add_new_permission_button_present is True, \ f'Add new permission button should be visible' with step('Permission welcome image source path is correct'): - assert PERMISSION_WELCOME_IMAGE_PATH == str(permissions_settings.permission_welcome_image_source) + assert PERMISSION_WELCOME_IMAGE_PATH in str(permissions_settings.permission_welcome_image_source) with step('Permission welcome title is correct'): assert permissions_settings.permission_welcome_title == PermissionsElements.WELCOME_TITLE.value with step('Permission welcome subtitle is correct'): diff --git a/test/e2e/tests/communities/test_communities_send_accept_decline_request_from_profile.py b/test/e2e/tests/communities/test_communities_send_accept_decline_request_from_profile.py index 665ea8daa5..a78d01e347 100644 --- a/test/e2e/tests/communities/test_communities_send_accept_decline_request_from_profile.py +++ b/test/e2e/tests/communities/test_communities_send_accept_decline_request_from_profile.py @@ -133,14 +133,14 @@ def test_communities_send_accept_decline_request_remove_contact_from_profile(mul assert driver.waitFor(lambda: not community_screen.left_panel.is_join_community_visible, configs.timeouts.UI_LOAD_TIMEOUT_MSEC), 'Join community button not hidden' - with step(f'User {user_one.name} send contact request to {user_three.name} from user profile'): + with step(f'User {user_one.name} send contact request to {user_three.name} from user profile from members list'): community_screen = main_screen.left_panel.select_community(community.name) profile_popup = community_screen.right_panel.click_member(user_three.name) profile_popup.send_request().send(f'Hello {user_three.name}') ProfilePopupFromMembers().wait_until_appears() main_screen.hide() - with step(f'User {user_three.name}, accept contact request from {user_one.name} from user profile'): + with step(f'User {user_three.name}, accept contact request from {user_one.name} from user profile from members list'): aut_three.attach() main_screen.prepare() community_screen = main_screen.left_panel.select_community(community.name) @@ -166,7 +166,8 @@ def test_communities_send_accept_decline_request_remove_contact_from_profile(mul with step(f'User {user_three.name}, decline contact request from user profile {user_one.name}'): aut_three.attach() main_screen.prepare() - profile_popup.review_contact_request().decline() + profile_decline = community_screen.right_panel.click_member(user_one.name) + profile_decline.review_contact_request().decline() with step(f'User {user_three.name} verify that send request button is available again in profile popup'): assert driver.waitFor(lambda: profile_popup.is_send_request_button_visible, diff --git a/test/e2e/tests/crtitical_tests_prs/test_add_edit_delete_generated_account.py b/test/e2e/tests/crtitical_tests_prs/test_add_edit_delete_generated_account.py index e4413cff39..e02e8fcfe0 100644 --- a/test/e2e/tests/crtitical_tests_prs/test_add_edit_delete_generated_account.py +++ b/test/e2e/tests/crtitical_tests_prs/test_add_edit_delete_generated_account.py @@ -6,7 +6,7 @@ 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 scripts.utils.generators import random_wallet_acc_keypair_name import constants import driver @@ -19,18 +19,10 @@ pytestmark = marks @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703033', 'Manage a generated account') @pytest.mark.case(703033) -@pytest.mark.parametrize('color, emoji, emoji_unicode, ' - 'new_color, new_emoji, new_emoji_unicode', [ - pytest.param('#2a4af5', 'sunglasses', '1f60e', - '#216266', 'thumbsup', '1f44d') - ]) @pytest.mark.critical -def test_add_edit_delete_generated_account(main_screen: MainWindow, user_account, - color: str, emoji: str, emoji_unicode: str, - new_color: str, new_emoji: str, - new_emoji_unicode: str): +def test_add_edit_delete_generated_account(main_screen: MainWindow, user_account,): with step('Create generated wallet account'): - name = random_wallet_account_name() + name = random_wallet_acc_keypair_name() wallet = main_screen.left_panel.open_wallet() SigningPhrasePopup().wait_until_appears().confirm_phrase() account_popup = wallet.left_panel.open_add_account_popup() @@ -53,9 +45,9 @@ def test_add_edit_delete_generated_account(main_screen: MainWindow, user_account raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}') with step('Edit wallet account'): - new_name = random_wallet_account_name() + new_name = random_wallet_acc_keypair_name() account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) - account_popup.set_name(new_name).set_color(new_color).save_changes() + account_popup.set_name(new_name).save_changes() with step('Verify that the account is correctly displayed in accounts list'): expected_account = constants.user.account_list_item(new_name, None, None) diff --git a/test/e2e/tests/settings/settings_wallet/test_wallet_rename_keypair.py b/test/e2e/tests/settings/settings_wallet/test_wallet_rename_keypair.py index 1421c9f314..9959206076 100644 --- a/test/e2e/tests/settings/settings_wallet/test_wallet_rename_keypair.py +++ b/test/e2e/tests/settings/settings_wallet/test_wallet_rename_keypair.py @@ -5,10 +5,9 @@ import allure import pytest from allure_commons._allure import step -from constants import RandomUser from constants.wallet import WalletRenameKeypair, WalletAccountPopup from helpers.WalletHelper import authenticate_with_password -from scripts.utils.generators import random_wallet_account_name +from scripts.utils.generators import random_wallet_acc_keypair_name from tests.wallet_main_screen import marks import constants @@ -35,7 +34,7 @@ def test_rename_keypair_test(main_screen: MainWindow, user_account, emoji: str, 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(random_wallet_account_name()).set_emoji(emoji) + account_popup.set_name(random_wallet_acc_keypair_name()).set_emoji(emoji) with step('Enter private key name less than 5 characters and verify that error appears'): pk_name_short = ''.join(random.choices(string.ascii_letters + string.digits, k=4)) diff --git a/test/e2e/tests/settings/settings_wallet/test_wallet_settings_networks_edit_network.py b/test/e2e/tests/settings/settings_wallet/test_wallet_settings_networks_edit_network.py index 9076497f75..5fd9fe58f5 100644 --- a/test/e2e/tests/settings/settings_wallet/test_wallet_settings_networks_edit_network.py +++ b/test/e2e/tests/settings/settings_wallet/test_wallet_settings_networks_edit_network.py @@ -19,6 +19,7 @@ pytestmark = marks pytest.param(WalletNetworkSettings.EDIT_NETWORK_LIVE_TAB.value), pytest.param(WalletNetworkSettings.EDIT_NETWORK_TEST_TAB.value) ]) +@pytest.mark.xfail(reason="https://github.com/status-im/status-desktop/issues/16613") def test_settings_networks_edit_restore_defaults(main_screen: MainWindow, network_tab: str): networks = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_networks() diff --git a/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_added_for_new_generated_seed.py b/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_added_for_new_generated_seed.py index 8e4e9279c7..28d6f80ddf 100644 --- a/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_added_for_new_generated_seed.py +++ b/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_added_for_new_generated_seed.py @@ -5,6 +5,7 @@ import pytest from allure import step from helpers.WalletHelper import authenticate_with_password +from scripts.utils.generators import random_wallet_acc_keypair_name from tests.wallet_main_screen import marks import constants @@ -17,18 +18,15 @@ pytestmark = marks @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('name, color, emoji, emoji_unicode, keypair_name', [ - pytest.param('SPAcc', '#2a4af5', 'sunglasses', '1f60e', - 'SPKeyPair')]) -def test_plus_button_manage_account_added_for_new_seed(main_screen: MainWindow, user_account, - name: str, color: str, emoji: str, - emoji_unicode: str, - keypair_name: str): +def test_plus_button_manage_account_added_for_new_seed(main_screen: MainWindow, user_account): + name = random_wallet_acc_keypair_name() + keypair_name = random_wallet_acc_keypair_name() + 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( + account_popup.set_name(name).set_origin_new_seed_phrase( keypair_name).save_changes() authenticate_with_password(user_account) account_popup.wait_until_hidden() @@ -40,7 +38,7 @@ def test_plus_button_manage_account_added_for_new_seed(main_screen: MainWindow, 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) + expected_account = constants.user.account_list_item(name, None, None) started_at = time.monotonic() while expected_account not in wallet.left_panel.accounts: time.sleep(1) diff --git a/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_from_private_key.py b/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_from_private_key.py index 39e82e4345..9854f868d3 100644 --- a/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_from_private_key.py +++ b/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_from_private_key.py @@ -5,6 +5,7 @@ import pytest from allure_commons._allure import step from helpers.WalletHelper import authenticate_with_password +from scripts.utils.generators import random_wallet_acc_keypair_name from tests.wallet_main_screen import marks import constants @@ -18,20 +19,16 @@ pytestmark = marks @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703029', 'Manage a private key imported account') @pytest.mark.case(703029) @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') - ]) -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): +def test_plus_button_manage_account_from_private_key(main_screen: MainWindow, user_account, address_pair): + + name = random_wallet_acc_keypair_name() + new_name = random_wallet_acc_keypair_name() + 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( + account_popup.set_name(name).set_origin_private_key( address_pair.private_key, address_pair.private_key[:5]).save_changes() authenticate_with_password(user_account) account_popup.wait_until_hidden() @@ -43,7 +40,7 @@ def test_plus_button_manage_account_from_private_key(main_screen: MainWindow, us 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) + expected_account = constants.user.account_list_item(name, None, None) started_at = time.monotonic() while expected_account not in wallet.left_panel.accounts: time.sleep(1) @@ -62,10 +59,10 @@ def test_plus_button_manage_account_from_private_key(main_screen: MainWindow, us 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_changes() + account_popup.set_name(new_name).save_changes() 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) + expected_account = constants.user.account_list_item(new_name, None, None) started_at = time.monotonic() while expected_account not in wallet.left_panel.accounts: time.sleep(1) diff --git a/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_from_seed_phrase.py b/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_from_seed_phrase.py index bd30188392..4d149c2f33 100644 --- a/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_from_seed_phrase.py +++ b/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_account_from_seed_phrase.py @@ -7,7 +7,7 @@ from allure_commons._allure import step from constants.wallet import WalletSeedPhrase from helpers.WalletHelper import authenticate_with_password -from scripts.utils.generators import random_mnemonic +from scripts.utils.generators import random_mnemonic, random_wallet_acc_keypair_name from tests.wallet_main_screen import marks import constants @@ -20,23 +20,16 @@ pytestmark = marks @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703030', 'Manage a seed phrase imported account') @pytest.mark.case(703030) -@pytest.mark.parametrize('name, color, emoji, emoji_unicode, ' - 'new_name, new_color, new_emoji, new_emoji_unicode', [ - pytest.param('SPAcc24', '#2a4af5', 'sunglasses', '1f60e', - 'SPAcc24edited', '#216266', 'thumbsup', '1f44d' - ) - ]) -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): +def test_plus_button_manage_account_from_seed_phrase(main_screen: MainWindow, user_account): + name = random_wallet_acc_keypair_name() + new_name = random_wallet_acc_keypair_name() + with step('Create imported seed phrase wallet account'): mnemonic_data = random_mnemonic() 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).open_add_new_account_popup().import_new_seed_phrase(mnemonic_data.split()) + account_popup.set_name(name).open_add_new_account_popup().import_new_seed_phrase(mnemonic_data.split()) account_popup.save_changes() authenticate_with_password(user_account) account_popup.wait_until_hidden() @@ -48,7 +41,7 @@ def test_plus_button_manage_account_from_seed_phrase(main_screen: MainWindow, us 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) + expected_account = constants.user.account_list_item(name, None, None) started_at = time.monotonic() while expected_account not in wallet.left_panel.accounts: time.sleep(1) @@ -63,7 +56,7 @@ def test_plus_button_manage_account_from_seed_phrase(main_screen: MainWindow, us with step('Try to re-import seed phrase and verify that correct error appears'): account_popup = wallet.left_panel.open_add_account_popup() - add_new_account = account_popup.set_name(name).set_emoji(emoji).set_color(color).open_add_new_account_popup() + add_new_account = account_popup.set_name(name).open_add_new_account_popup() add_new_account.enter_new_seed_phrase(mnemonic_data.split()) assert add_new_account.get_already_added_error() == WalletSeedPhrase.WALLET_SEED_PHRASE_ALREADY_ADDED.value @@ -73,13 +66,14 @@ def test_plus_button_manage_account_from_seed_phrase(main_screen: MainWindow, us with step('Add the same account again and check derivation path'): add_new_account_popup = wallet.left_panel.open_add_account_popup() - add_same_account = add_new_account_popup.set_name(name).set_emoji(emoji).set_color(color).open_add_new_account_popup() + add_same_account = add_new_account_popup.set_name(name).open_add_new_account_popup() add_same_account.import_new_seed_phrase(mnemonic_data.split()) add_new_account_popup.save_changes() authenticate_with_password(user_account) add_new_account_popup.wait_until_hidden() with step('Verify derivation path'): + wallet.left_panel.click() edit_account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name) edit_account_popup.copy_derivation_path_button.click() derivation_path = pyperclip.paste() diff --git a/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_generated_account_custom_derivation_path.py b/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_generated_account_custom_derivation_path.py index 690fa72082..06b3a3e8e1 100644 --- a/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_generated_account_custom_derivation_path.py +++ b/test/e2e/tests/wallet_main_screen/wallet - plus button/test_plus_button_manage_generated_account_custom_derivation_path.py @@ -6,7 +6,7 @@ import pytest from allure_commons._allure import step from constants.wallet import DerivationPathName -from scripts.utils.generators import random_wallet_account_name +from scripts.utils.generators import random_wallet_acc_keypair_name from tests.wallet_main_screen import marks import constants @@ -18,26 +18,20 @@ pytestmark = marks @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703028', 'Manage a custom generated account') @pytest.mark.case(703028) -@pytest.mark.parametrize( - 'color, emoji, emoji_unicode', - [ - pytest.param('#216266', 'sunglasses', '1f60e') - ]) -def test_plus_button_manage_generated_account_custom_derivation_path(main_screen: MainWindow, user_account, - color: str, emoji: str, - emoji_unicode: str): +@pytest.mark.xfail +def test_plus_button_manage_generated_account_custom_derivation_path(main_screen: MainWindow, user_account): with step('Create generated wallet account'): - name = random_wallet_account_name() + name = random_wallet_acc_keypair_name() 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( + account_popup.set_name(name).set_derivation_path( DerivationPathName.select_random_path_name().value, random.randrange(2, 100), user_account.password).save_changes() with step('Verify that the account is correctly displayed in accounts list'): - expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode) + expected_account = constants.user.account_list_item(name, None, None) started_at = time.monotonic() while expected_account not in wallet.left_panel.accounts: time.sleep(1) diff --git a/test/e2e/tests/wallet_main_screen/wallet - right click on account/test_context_menu_edit_default_account.py b/test/e2e/tests/wallet_main_screen/wallet - right click on account/test_context_menu_edit_default_account.py index 5af4f5cac3..63891b5fd2 100644 --- a/test/e2e/tests/wallet_main_screen/wallet - right click on account/test_context_menu_edit_default_account.py +++ b/test/e2e/tests/wallet_main_screen/wallet - right click on account/test_context_menu_edit_default_account.py @@ -3,6 +3,9 @@ import time import allure import pytest from allure_commons._allure import step + +from constants.wallet import WalletNetworkSettings +from scripts.utils.generators import random_wallet_acc_keypair_name from tests.wallet_main_screen import marks import constants @@ -12,11 +15,11 @@ from gui.main_window import MainWindow pytestmark = marks @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('Account 1', '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): +def test_context_menu_edit_default_account(main_screen: MainWindow, user_account): + + name = WalletNetworkSettings.STATUS_ACCOUNT_DEFAULT_NAME.value + new_name = random_wallet_acc_keypair_name() + with step('Select wallet account'): wallet = main_screen.left_panel.open_wallet() SigningPhrasePopup().wait_until_appears().confirm_phrase() @@ -29,10 +32,10 @@ def test_context_menu_edit_default_account(main_screen: MainWindow, name: str, n 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_changes() + account_popup.set_name(new_name).save_changes() 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) + expected_account = constants.user.account_list_item(new_name, None, None) started_at = time.monotonic() while expected_account not in wallet.left_panel.accounts: time.sleep(1)