1212from gui .main_window import MainWindow
1313
1414pytestmark = marks
15+
16+
1517@allure .testcase ('https://ethstatus.testrail.net/index.php?/cases/view/703028' , 'Manage a custom generated account' )
1618@pytest .mark .case (703028 )
1719@pytest .mark .parametrize ('user_account' , [constants .user .user_account_one ])
18- @pytest .mark .parametrize ('derivation_path, generated_address_index, name, color, emoji, emoji_unicode' , [
19- pytest .param ('Ethereum' , '5' , 'Ethereum' , '#216266' , 'sunglasses' , '1f60e' ),
20- pytest .param ('Ethereum Testnet (Ropsten)' , '10' , 'Ethereum Testnet ' , '#7140fd' , 'sunglasses' , '1f60e' ),
21- pytest .param ('Ethereum (Ledger)' , '15' , 'Ethereum Ledger' , '#2a799b' , 'sunglasses' , '1f60e' ),
22- pytest .param ('Ethereum (Ledger Live/KeepKey)' , '20' , 'Ethereum Ledger Live' , '#7140fd' , 'sunglasses' , '1f60e' ),
23- pytest .param ('N/A' , '95' , 'Custom path' , '#216266' , 'sunglasses' , '1f60e' )
20+ @pytest .mark .parametrize ('derivation_path, generated_address_index, name, color, emoji, emoji_unicode, new_name, new_color, new_emoji, new_emoji_unicode' ,
21+ [
22+ pytest .param ('Ethereum' , '5' , 'Ethereum' , '#216266' , 'sunglasses' , '1f60e' , 'EthEdited' , '#216266' , 'thumbsup' , '1f44d' ),
23+ pytest .param ('Ethereum Testnet (Ropsten)' , '10' , 'Ethereum Testnet ' , '#7140fd' , 'sunglasses' , '1f60e' , 'RopstenEdited' , '#216266' , 'thumbsup' , '1f44d' ),
24+ pytest .param ('Ethereum (Ledger)' , '15' , 'Ethereum Ledger' , '#2a799b' , 'sunglasses' , '1f60e' , 'LedgerEdited' , '#216266' , 'thumbsup' , '1f44d' ),
25+ pytest .param ('Ethereum (Ledger Live/KeepKey)' , '20' , 'Ethereum Ledger Live' , '#7140fd' , 'sunglasses' , '1f60e' , 'LiveEdited' , '#216266' , 'thumbsup' , '1f44d' ),
26+ pytest .param ('N/A' , '95' , 'Custom path' , '#216266' , 'sunglasses' , '1f60e' , 'CustomEdited' , '#216266' , 'thumbsup' , '1f44d' )
2427])
25- @pytest .mark .skip (reason = 'https://github.com/status-im/desktop-qa-automation/issues/220' )
26- @pytest .mark .xfail (reason = "https://github.com/status-im/status-desktop/issues/12914" )
2728def test_plus_button_manage_generated_account_custom_derivation_path (main_screen : MainWindow , user_account ,
2829 derivation_path : str , generated_address_index : int ,
29- name : str , color : str , emoji : str , emoji_unicode : str ):
30+ name : str , color : str , emoji : str ,
31+ emoji_unicode : str ,
32+ new_name : str , new_color : str , new_emoji : str ,
33+ new_emoji_unicode : str ):
3034 with step ('Create generated wallet account' ):
3135 wallet = main_screen .left_panel .open_wallet ()
3236 SigningPhrasePopup ().wait_until_appears ().confirm_phrase ()
@@ -35,28 +39,41 @@ def test_plus_button_manage_generated_account_custom_derivation_path(main_screen
3539 generated_address_index ,
3640 user_account .password ).save ()
3741
42+
43+ with step ('Verify that the account is correctly displayed in accounts list' ):
44+ expected_account = constants .user .account_list_item (name , color .lower (), emoji_unicode )
45+ started_at = time .monotonic ()
46+ while expected_account not in wallet .left_panel .accounts :
47+ time .sleep (1 )
48+ if time .monotonic () - started_at > 15 :
49+ raise LookupError (f'Account { expected_account } not found in { wallet .left_panel .accounts } ' )
50+
3851 with step ('Verify toast message notification when adding account' ):
3952 assert len (ToastMessage ().get_toast_messages ) == 1 , \
4053 f"Multiple toast messages appeared"
4154 message = ToastMessage ().get_toast_messages [0 ]
4255 assert message == f'"{ name } " successfully added'
4356
57+ with step ('Edit wallet account' ):
58+ account_popup = wallet .left_panel .open_edit_account_popup_from_context_menu (name )
59+ account_popup .set_name (new_name ).set_emoji (new_emoji ).set_color (new_color ).save ()
60+
4461 with step ('Verify that the account is correctly displayed in accounts list' ):
45- expected_account = constants .user .account_list_item (name , color .lower (), emoji_unicode )
62+ expected_account = constants .user .account_list_item (new_name , new_color .lower (), new_emoji_unicode )
4663 started_at = time .monotonic ()
4764 while expected_account not in wallet .left_panel .accounts :
4865 time .sleep (1 )
4966 if time .monotonic () - started_at > 15 :
5067 raise LookupError (f'Account { expected_account } not found in { wallet .left_panel .accounts } ' )
5168
5269 with step ('Delete wallet account with agreement' ):
53- wallet .left_panel .delete_account_from_context_menu (name ).agree_and_confirm ()
70+ wallet .left_panel .delete_account_from_context_menu (new_name ).agree_and_confirm ()
5471
5572 with step ('Verify toast message notification when removing account' ):
5673 messages = ToastMessage ().get_toast_messages
57- assert f'"{ name } " successfully removed' in messages , \
74+ assert f'"{ new_name } " successfully removed' in messages , \
5875 f"Toast message about account removal is not correct or not present. Current list of messages: { messages } "
5976
6077 with step ('Verify that the account is not displayed in accounts list' ):
61- assert driver .waitFor (lambda : name not in [account .name for account in wallet .left_panel .accounts ], 10000 ), \
62- f'Account with { name } is still displayed even it should not be'
78+ assert driver .waitFor (lambda : new_name not in [account .name for account in wallet .left_panel .accounts ], 10000 ), \
79+ f'Account with { new_name } is still displayed even it should not be'
0 commit comments