Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.

Commit abac56b

Browse files
committed
chore: update test with accounts with custom derivation paths
1 parent d902f1e commit abac56b

File tree

1 file changed

+33
-14
lines changed

1 file changed

+33
-14
lines changed

tests/wallet_main_screen/test_plus_button_manage_generated_account_custom_derivation_path.py

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,27 @@
1212
from gui.main_window import MainWindow
1313

1414
pytestmark = 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")
28+
# @pytest.mark.skip(reason='https://github.com/status-im/desktop-qa-automation/issues/220')
29+
# @pytest.mark.xfail(reason="https://github.com/status-im/status-desktop/issues/12914")
2730
def test_plus_button_manage_generated_account_custom_derivation_path(main_screen: MainWindow, user_account,
2831
derivation_path: str, generated_address_index: int,
29-
name: str, color: str, emoji: str, emoji_unicode: str):
32+
name: str, color: str, emoji: str,
33+
emoji_unicode: str,
34+
new_name: str, new_color: str, new_emoji: str,
35+
new_emoji_unicode: str):
3036
with step('Create generated wallet account'):
3137
wallet = main_screen.left_panel.open_wallet()
3238
SigningPhrasePopup().wait_until_appears().confirm_phrase()
@@ -35,28 +41,41 @@ def test_plus_button_manage_generated_account_custom_derivation_path(main_screen
3541
generated_address_index,
3642
user_account.password).save()
3743

44+
45+
with step('Verify that the account is correctly displayed in accounts list'):
46+
expected_account = constants.user.account_list_item(name, color.lower(), emoji_unicode)
47+
started_at = time.monotonic()
48+
while expected_account not in wallet.left_panel.accounts:
49+
time.sleep(1)
50+
if time.monotonic() - started_at > 15:
51+
raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}')
52+
3853
with step('Verify toast message notification when adding account'):
3954
assert len(ToastMessage().get_toast_messages) == 1, \
4055
f"Multiple toast messages appeared"
4156
message = ToastMessage().get_toast_messages[0]
4257
assert message == f'"{name}" successfully added'
4358

59+
with step('Edit wallet account'):
60+
account_popup = wallet.left_panel.open_edit_account_popup_from_context_menu(name)
61+
account_popup.set_name(new_name).set_emoji(new_emoji).set_color(new_color).save()
62+
4463
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)
64+
expected_account = constants.user.account_list_item(new_name, new_color.lower(), new_emoji_unicode)
4665
started_at = time.monotonic()
4766
while expected_account not in wallet.left_panel.accounts:
4867
time.sleep(1)
4968
if time.monotonic() - started_at > 15:
5069
raise LookupError(f'Account {expected_account} not found in {wallet.left_panel.accounts}')
5170

5271
with step('Delete wallet account with agreement'):
53-
wallet.left_panel.delete_account_from_context_menu(name).agree_and_confirm()
72+
wallet.left_panel.delete_account_from_context_menu(new_name).agree_and_confirm()
5473

5574
with step('Verify toast message notification when removing account'):
5675
messages = ToastMessage().get_toast_messages
57-
assert f'"{name}" successfully removed' in messages, \
76+
assert f'"{new_name}" successfully removed' in messages, \
5877
f"Toast message about account removal is not correct or not present. Current list of messages: {messages}"
5978

6079
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'
80+
assert driver.waitFor(lambda: new_name not in [account.name for account in wallet.left_panel.accounts], 10000), \
81+
f'Account with {new_name} is still displayed even it should not be'

0 commit comments

Comments
 (0)