Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gui/objects_map/wallet_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
savedAddressView_Delegate = {"container": mainWallet_Saved_Addreses_List, "objectName": RegularExpression("savedAddressView_Delegate*"), "type": "SavedAddressesDelegate", "visible": True}
send_StatusRoundButton = {"container": "", "type": "StatusRoundButton", "unnamed": 1, "visible": True}
savedAddressView_Delegate_menuButton = {"container": mainWindow_SavedAddressesView, "objectName": RegularExpression("savedAddressView_Delegate_menuButton*"), "type": "StatusRoundButton", "visible": True}
savedAddressesArea_SavedAddresses = {"container": mainWindow_SavedAddressesView, "objectName": "savedAddressesArea", "type": "SavedAddresses", "visible": True}

# Wallet Account View
mainWindow_StatusSectionLayout_ContentItem = {"container": statusDesktop_mainWindow, "objectName": "StatusSectionLayout", "type": "ContentItem", "visible": True}
Expand Down
10 changes: 8 additions & 2 deletions gui/screens/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,18 @@ def __init__(self):
super(SavedAddressesView, self).__init__('mainWindow_SavedAddressesView')
self._add_new_address_button = Button('mainWallet_Saved_Addreses_Add_Buttton')
self._address_list_item = QObject('savedAddressView_Delegate')
self._addresses_area = QObject('savedAddresses_area')
self._send_button = Button('send_StatusRoundButton')
self._open_menu_button = Button('savedAddressView_Delegate_menuButton')

@property
@allure.step('Get saved addresses names')
def address_names(self):
names = [str(address.name) for address in driver.findAllObjects(self._address_list_item.real_name)]
return names
address_names = []
for child in walk_children(self._addresses_area.object):
if getattr(child, 'id', '') == 'savedAddressDelegate':
address_names.append(str(child.name))
return address_names

@allure.step('Open add new address popup')
def open_add_saved_address_popup(self, attempt=2) -> 'AddressPopup':
Expand All @@ -175,6 +179,8 @@ def delete_saved_address(self, address_name):
@allure.step('Open context menu in saved address')
def open_context_menu(self, name) -> ContextMenu:
self._open_menu_button.real_name['objectName'] = 'savedAddressView_Delegate_menuButton' + '_' + name
self._address_list_item.real_name['objectName'] = 'savedAddressView_Delegate' + '_' + name
self._address_list_item.hover()
self._open_menu_button.click()
return ContextMenu().wait_until_appears()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
pytest.param(WalletNetworkSettings.EDIT_NETWORK_LIVE_TAB.value),
pytest.param(WalletNetworkSettings.EDIT_NETWORK_TEST_TAB.value)
])
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/440")
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ def test_wallet_settings_add_saved_address(main_screen: MainWindow, address: str
with step('Fill in the form and preferred networks and add the address'):
add_saved_address_popup.add_saved_address(name, address)

with step('Verify recently added saved address is present in the list'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason i was checking the toast message before checking the list is that toast message disappears quickly so perhaps it is better to check the toast first which appears right away when you click the Add button and then verify the list of addresses, wdyt @Valentina1133 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it on purpose, because after some changes in the app the toast message appears not so quickly and it’s better to check first that the address appeared. You can check it in nightly runs. Unfortunately we cannot add wait for for toast message , so this is the only option I found. If you have more ideas let me know I will try it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, thats perfect then :)

assert driver.waitFor(
lambda: name in settings_saved_addresses.get_saved_address_names_list(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f'Address: {name} not found'

with step('Verify toast message when adding saved address'):
messages = ToastMessage().get_toast_messages
assert f'{name} successfully added to your saved addresses' in messages, \
f"Toast message about adding saved address is not correct or not present. \
Current list of messages: {messages}"

with step('Verify recently added saved address is present in the list'):
assert driver.waitFor(
lambda: name in settings_saved_addresses.get_saved_address_names_list(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f'Address: {name} not found'
23 changes: 12 additions & 11 deletions tests/wallet_main_screen/test_saved_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from allure import step

from gui.components.toast_message import ToastMessage
from gui.screens.wallet import SavedAddressesView
from . import marks

import configs
Expand Down Expand Up @@ -35,29 +36,29 @@ def test_manage_saved_address(main_screen: MainWindow, name: str, address: str,
SigningPhrasePopup().confirm_phrase()
wallet.left_panel.open_saved_addresses().open_add_saved_address_popup().add_saved_address(name, address)

with step('Verify toast message when adding saved address'):
messages = ToastMessage().get_toast_messages
assert f'{name} successfully added to your saved addresses' in messages, \
f"Toast message about adding saved address is not correct or not present. Current list of messages: {messages}"

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('Verify toast message when adding saved address'):
messages = ToastMessage().get_toast_messages
assert f'{name} successfully added to your saved addresses' in messages, \
f"Toast message about adding saved address is not correct or not present. Current list of messages: {messages}"

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)
SavedAddressesView().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 SavedAddressesView().address_names,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f'Address: {new_name} not found'

with step('Verify toast message when editing saved address'):
messages = ToastMessage().get_toast_messages
assert f'{new_name} saved address successfully edited' in messages, \
f"Toast message about editing saved address is not correct or not present. Current list of messages: {messages}"

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)

Expand Down