diff --git a/constants/user.py b/constants/user.py index 2a64078..26bfa40 100644 --- a/constants/user.py +++ b/constants/user.py @@ -32,8 +32,27 @@ community_user_2 = UserAccount('community_user_2', 'vSq5T702_p', [ 'will', 'horn', 'tail', 'stock', 'puzzle', 'warfare', 'pledge', 'uniform', 'ozone', 'taste', 'someone', 'silk' ], '0x935034600f2ba486324cee6ae3f96ad8c8915ac6') -user_for_syncing = UserAccount(''.join((random.choices(string.ascii_letters + - string.digits, k=24))), '1vTC2,4R1=', [], '') +user_with_random_attributes_1 = UserAccount( +''.join((random.choice( + string.ascii_letters + string.digits + random.choice('_- ')) + for i in range(5, 25)) + ).strip(' '), + ''.join((random.choice( + string.ascii_letters + string.digits + string.punctuation) + for _ in range(10, 28)) + ), [], '' +) + +user_with_random_attributes_2 = UserAccount( +''.join((random.choice( + string.ascii_letters + string.digits + random.choice('_- ')) + for i in range(5, 25)) + ).strip(' '), + ''.join((random.choice( + string.ascii_letters + string.digits + string.punctuation) + for _ in range(10, 28)) + ), [], '' +) user_account_one_changed_password = UserAccount('squisher', 'NewPassword@12345', [], '') user_account_one_changed_name = UserAccount('NewUserName', '0000000000', [], '') diff --git a/tests/messages/test_messaging_1x1_chat.py b/tests/messages/test_messaging_1x1_chat.py index eb5a54b..c47e4ac 100644 --- a/tests/messages/test_messaging_1x1_chat.py +++ b/tests/messages/test_messaging_1x1_chat.py @@ -20,8 +20,8 @@ pytestmark = marks @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703087', '1-1 Chat') @pytest.mark.case(703087) def test_1x1_chat(multiple_instances): - user_one: UserAccount = constants.user_account_one - user_two: UserAccount = constants.user_account_two + user_one: UserAccount = constants.user_with_random_attributes_1 + user_two: UserAccount = constants.user_with_random_attributes_2 main_window = MainWindow() messages_screen = MessagesScreen() emoji = 'sunglasses' diff --git a/tests/onboarding/test_onboarding_syncing.py b/tests/onboarding/test_onboarding_syncing.py index 3d7a698..e42efbd 100644 --- a/tests/onboarding/test_onboarding_syncing.py +++ b/tests/onboarding/test_onboarding_syncing.py @@ -36,7 +36,7 @@ def sync_screen(main_window) -> SyncCodeView: @pytest.mark.case(703592) @pytest.mark.critical def test_sync_device_during_onboarding(multiple_instances): - user: UserAccount = constants.user_for_syncing + user: UserAccount = constants.user_with_random_attributes_1 main_window = MainWindow() with multiple_instances(user_data=None) as aut_one, multiple_instances(user_data=None) as aut_two: diff --git a/tests/onboarding/test_password_strength.py b/tests/onboarding/test_password_strength.py index ffd943e..947b4c8 100644 --- a/tests/onboarding/test_password_strength.py +++ b/tests/onboarding/test_password_strength.py @@ -26,7 +26,7 @@ def keys_screen(main_window) -> KeysView: @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/702989', 'Strength of the password') @pytest.mark.case(702989) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/13783") def test_check_password_strength_and_login(keys_screen, main_window, user_account): values = [('abcdefghij', very_weak_lower_elements), diff --git a/tests/online_identifier/test_online_identifier.py b/tests/online_identifier/test_online_identifier.py index 62def19..773ac69 100644 --- a/tests/online_identifier/test_online_identifier.py +++ b/tests/online_identifier/test_online_identifier.py @@ -20,7 +20,7 @@ pytestmark = marks @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703007', 'Change own display name from online identifier') @pytest.mark.case(703007) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @pytest.mark.parametrize('new_name', [pytest.param('NewUserName')]) def test_change_own_display_name(main_screen: MainWindow, user_account, new_name): with step('Open own profile popup and check name of user is correct'): @@ -42,8 +42,8 @@ def test_change_own_display_name(main_screen: MainWindow, user_account, new_name @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703004', 'Switch state to automatic') @pytest.mark.case(703002, 703003, 703004) def test_switch_state_to_offline_online_automatic(multiple_instances): - user_one: UserAccount = constants.user_account_one - user_two: UserAccount = constants.user_account_two + user_one: UserAccount = constants.user_with_random_attributes_1 + user_two: UserAccount = constants.user_with_random_attributes_2 community_params = deepcopy(constants.community_params) community_params['name'] = f'{datetime.now():%d%m%Y_%H%M%S}' main_screen = MainWindow() diff --git a/tests/settings/settings_keycard/test_unlock_keycard.py b/tests/settings/settings_keycard/test_unlock_keycard.py index c4574e1..cdff042 100644 --- a/tests/settings/settings_keycard/test_unlock_keycard.py +++ b/tests/settings/settings_keycard/test_unlock_keycard.py @@ -16,7 +16,7 @@ pytestmark = marks @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704607', 'Unlock Keycard') @pytest.mark.case(704607) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/274") def test_unlock_keycard_using_correct_puk(main_screen: MainWindow, user_account): main_screen.prepare() @@ -90,7 +90,7 @@ def test_unlock_keycard_using_correct_puk(main_screen: MainWindow, user_account) @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704608', 'Unlock Keycard: incorrect PUK') @pytest.mark.case(704608) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/274") def test_unlock_keycard_using_incorrect_puk(main_screen: MainWindow, user_account): main_screen.prepare() diff --git a/tests/settings/settings_messaging/test_messaging_settings_accept_request.py b/tests/settings/settings_messaging/test_messaging_settings_accept_request.py index 2fd5527..8836acb 100644 --- a/tests/settings/settings_messaging/test_messaging_settings_accept_request.py +++ b/tests/settings/settings_messaging/test_messaging_settings_accept_request.py @@ -17,8 +17,8 @@ pytestmark = marks @pytest.mark.case(703011) # TODO: reason='https://github.com/status-im/desktop-qa-automation/issues/346' def test_messaging_settings_accepting_request(multiple_instances): - user_one: UserAccount = constants.user_account_one - user_two: UserAccount = constants.user_account_two + user_one: UserAccount = constants.user_with_random_attributes_1 + user_two: UserAccount = constants.user_with_random_attributes_2 main_window = MainWindow() with (multiple_instances(user_data=None) as aut_one, multiple_instances(user_data=None) as aut_two): diff --git a/tests/settings/settings_messaging/test_messaging_settings_identity_verification.py b/tests/settings/settings_messaging/test_messaging_settings_identity_verification.py index 26285fe..10675ac 100644 --- a/tests/settings/settings_messaging/test_messaging_settings_identity_verification.py +++ b/tests/settings/settings_messaging/test_messaging_settings_identity_verification.py @@ -17,8 +17,8 @@ pytestmark = marks @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704611', 'Reply to identity request') @pytest.mark.case(704611) def test_messaging_settings_identity_verification(multiple_instances): - user_one: UserAccount = constants.user_account_one - user_two: UserAccount = constants.user_account_two + user_one: UserAccount = constants.user_with_random_attributes_1 + user_two: UserAccount = constants.user_with_random_attributes_2 main_window = MainWindow() with multiple_instances(user_data=None) as aut_one, multiple_instances(user_data=None) as aut_two: diff --git a/tests/settings/settings_messaging/test_messaging_settings_reject_request.py b/tests/settings/settings_messaging/test_messaging_settings_reject_request.py index df49be2..65c0550 100644 --- a/tests/settings/settings_messaging/test_messaging_settings_reject_request.py +++ b/tests/settings/settings_messaging/test_messaging_settings_reject_request.py @@ -11,11 +11,13 @@ from gui.main_window import MainWindow pytestmark = marks -@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704610', 'Reject a contact request with a chat key') + +@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704610', + 'Reject a contact request with a chat key') @pytest.mark.case(704610) def test_messaging_settings_rejecting_request(multiple_instances): - user_one: UserAccount = constants.user_account_one - user_two: UserAccount = constants.user_account_two + user_one: UserAccount = constants.user_with_random_attributes_1 + user_two: UserAccount = constants.user_with_random_attributes_2 main_window = MainWindow() with multiple_instances(user_data=None) as aut_one, multiple_instances(user_data=None) as aut_two: diff --git a/tests/settings/settings_wallet/test_wallet_settings_acct_interactions_delete_account.py b/tests/settings/settings_wallet/test_wallet_settings_acct_interactions_delete_account.py index ac51e3f..ff3ebe5 100644 --- a/tests/settings/settings_wallet/test_wallet_settings_acct_interactions_delete_account.py +++ b/tests/settings/settings_wallet/test_wallet_settings_acct_interactions_delete_account.py @@ -15,11 +15,13 @@ from gui.main_window import MainWindow from gui.screens.settings_wallet import WalletSettingsView pytestmark = marks + + @pytest.mark.critical @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704454', 'Account view interactions: Delete generated account') @pytest.mark.case(704454) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @pytest.mark.parametrize('account_name, color, emoji, emoji_unicode', [ pytest.param(''.join(random.choices(string.ascii_letters + diff --git a/tests/settings/settings_wallet/test_wallet_settings_add_account.py b/tests/settings/settings_wallet/test_wallet_settings_add_account.py index a1048c2..09acdb9 100644 --- a/tests/settings/settings_wallet/test_wallet_settings_add_account.py +++ b/tests/settings/settings_wallet/test_wallet_settings_add_account.py @@ -18,7 +18,7 @@ pytestmark = marks @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/edit/703598', 'Add new account from wallet settings screen') @pytest.mark.case(703598) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @pytest.mark.parametrize('account_name, color, emoji, emoji_unicode', [ pytest.param(''.join(random.choices(string.ascii_letters + diff --git a/tests/wallet_main_screen/wallet: plus button/test_plus_button_add_account_after_restart.py b/tests/wallet_main_screen/wallet: plus button/test_plus_button_add_account_after_restart.py index c1c1462..ab10cf5 100644 --- a/tests/wallet_main_screen/wallet: plus button/test_plus_button_add_account_after_restart.py +++ b/tests/wallet_main_screen/wallet: plus button/test_plus_button_add_account_after_restart.py @@ -13,10 +13,12 @@ from gui.components.toast_message import ToastMessage from gui.main_window import MainWindow pytestmark = marks + + @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704459', 'User can add one more account after restarting the app') @pytest.mark.case(704459) -@pytest.mark.parametrize('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @pytest.mark.parametrize('name, color, emoji, emoji_unicode,', [ pytest.param('GenAcc1', '#2a4af5', 'sunglasses', '1f60e') @@ -79,4 +81,3 @@ def test_add_generated_account_restart_add_again( 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/wallet: plus button/test_plus_button_manage_account_added_for_new_generated_seed.py b/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_added_for_new_generated_seed.py index 0f3b772..8221fc9 100644 --- a/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_added_for_new_generated_seed.py +++ b/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_added_for_new_generated_seed.py @@ -18,7 +18,7 @@ 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('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @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', diff --git a/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_from_private_key.py b/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_from_private_key.py index f1b4bc2..eeda093 100644 --- a/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_from_private_key.py +++ b/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_from_private_key.py @@ -17,7 +17,7 @@ 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('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @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', [ diff --git a/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_from_seed_phrase.py b/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_from_seed_phrase.py index 6bfbb80..98d6f7a 100644 --- a/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_from_seed_phrase.py +++ b/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_account_from_seed_phrase.py @@ -17,7 +17,7 @@ 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('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @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', diff --git a/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_generated_account.py b/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_generated_account.py index 668e42e..bc276e9 100644 --- a/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_generated_account.py +++ b/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_generated_account.py @@ -13,9 +13,11 @@ from gui.components.wallet.authenticate_popup import AuthenticatePopup from gui.main_window import MainWindow pytestmark = marks + + @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('user_account', [constants.user.user_with_random_attributes_1]) @pytest.mark.parametrize('name, color, emoji, emoji_unicode, ' 'new_name, new_color, new_emoji, new_emoji_unicode', [ pytest.param('GenAcc1', '#2a4af5', 'sunglasses', '1f60e', @@ -23,7 +25,8 @@ pytestmark = marks ]) 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): + 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() diff --git a/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_generated_account_custom_derivation_path.py b/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_generated_account_custom_derivation_path.py index 4efd88b..98bb430 100644 --- a/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_generated_account_custom_derivation_path.py +++ b/tests/wallet_main_screen/wallet: plus button/test_plus_button_manage_generated_account_custom_derivation_path.py @@ -8,7 +8,6 @@ from tests.wallet_main_screen import marks 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 pytestmark = marks @@ -16,7 +15,7 @@ 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('user_account', [constants.user.user_account_one]) +@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1]) @pytest.mark.parametrize('derivation_path, generated_address_index, name, color, emoji, emoji_unicode, new_name, new_color, new_emoji, new_emoji_unicode', [ pytest.param('Ethereum', '5', 'Ethereum', '#216266', 'sunglasses', '1f60e', 'EthEdited', '#216266', 'thumbsup', '1f44d'),