chore: fixes for saved addresses tests, edit network tests disabled for now

This commit is contained in:
Valentina Novgorodtceva 2024-01-15 18:27:12 +07:00 committed by Valentina1133
parent a529dd04b7
commit f2721bc0b1
5 changed files with 27 additions and 18 deletions

View File

@ -19,6 +19,7 @@ mainWallet_Saved_Addreses_List = {"container": mainWindow_SavedAddressesView, "o
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}

View File

@ -141,14 +141,18 @@ class SavedAddressesView(QObject):
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':
@ -175,6 +179,8 @@ class SavedAddressesView(QObject):
@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()

View File

@ -17,6 +17,7 @@ pytestmark = marks
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()

View File

@ -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'):
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'

View File

@ -6,6 +6,7 @@ import pytest
from allure import step
from gui.components.toast_message import ToastMessage
from gui.screens.wallet import SavedAddressesView
from . import marks
import configs
@ -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)