2023-09-14 03:52:27 +00:00
|
|
|
import allure
|
|
|
|
import pytest
|
|
|
|
from allure import step
|
2023-12-07 16:47:34 +00:00
|
|
|
from . import marks
|
2023-09-14 03:52:27 +00:00
|
|
|
|
|
|
|
import configs
|
|
|
|
import driver
|
|
|
|
from gui.components.signing_phrase_popup import SigningPhrasePopup
|
|
|
|
from gui.main_window import MainWindow
|
|
|
|
|
2023-12-07 16:47:34 +00:00
|
|
|
pytestmark = marks
|
2023-09-14 03:52:27 +00:00
|
|
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703021', 'Manage a saved address')
|
|
|
|
@pytest.mark.case(703021)
|
|
|
|
@pytest.mark.parametrize('name, address, new_name', [
|
|
|
|
pytest.param('Saved address name before', '0x8397bc3c5a60a1883174f722403d63a8833312b7', 'Saved address name after'),
|
|
|
|
pytest.param('Ens name before', 'nastya.stateofus.eth', 'Ens name after')
|
|
|
|
])
|
2023-11-30 11:27:35 +00:00
|
|
|
@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12914")
|
2023-09-14 03:52:27 +00:00
|
|
|
def test_manage_saved_address(main_screen: MainWindow, name: str, address: str, new_name: str):
|
|
|
|
with step('Add new address'):
|
|
|
|
wallet = main_screen.left_panel.open_wallet()
|
|
|
|
SigningPhrasePopup().wait_until_appears().confirm_phrase()
|
|
|
|
wallet.left_panel.open_saved_addresses().open_add_address_popup().add_saved_address(name, address)
|
|
|
|
|
|
|
|
with step('Verify that saved address is in the list of saved addresses'):
|
|
|
|
assert driver.waitFor(
|
|
|
|
lambda: name in wallet.left_panel.open_saved_addresses().address_names,
|
|
|
|
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f'Address: {name} not found'
|
|
|
|
|
|
|
|
with step('Edit saved address to new name'):
|
|
|
|
wallet.left_panel.open_saved_addresses().open_edit_address_popup(name).edit_saved_address(new_name, address)
|
|
|
|
|
|
|
|
with step('Verify that saved address with new name is in the list of saved addresses'):
|
|
|
|
assert driver.waitFor(
|
|
|
|
lambda: new_name in wallet.left_panel.open_saved_addresses().address_names,
|
|
|
|
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f'Address: {new_name} not found'
|
|
|
|
|
|
|
|
with step('Delete address with new name'):
|
|
|
|
wallet.left_panel.open_saved_addresses().delete_saved_address(new_name)
|
|
|
|
|
|
|
|
with step('Verify that saved address with new name is not in the list of saved addresses'):
|
2023-10-30 10:00:34 +00:00
|
|
|
assert not driver.waitFor(
|
|
|
|
lambda: new_name in wallet.left_panel.open_saved_addresses().address_names,
|
|
|
|
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f'Address: {new_name} is still present'
|