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

Commit f199e4b

Browse files
committed
test: fix send asset test and enable other tests
1 parent 7ab9966 commit f199e4b

File tree

7 files changed

+16
-19
lines changed

7 files changed

+16
-19
lines changed

gui/components/wallet/send_popup.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import allure
2+
import typing
23

34
import driver
45
from driver.objects_access import wait_for_template
@@ -28,11 +29,17 @@ def __init__(self):
2829
self._send_button = Button(names.send_StatusFlatButton)
2930

3031
def _select_asset(self, asset: str):
31-
for item in driver.findAllObjects(self._asset_list_item.real_name):
32-
if str(getattr(item, 'title', '')) == asset:
33-
driver.mouseClick(item)
34-
else:
35-
raise LookupError(f"Chosen asset didn't appear")
32+
assets = self.get_assets_list()
33+
for index, item in enumerate(assets):
34+
if str(item.title) == asset:
35+
QObject(item).click()
36+
37+
@allure.step('Get chats by chats list')
38+
def get_assets_list(self) -> typing.List[str]:
39+
assets_list = []
40+
for asset in driver.findAllObjects(self._asset_list_item.real_name):
41+
assets_list.append(asset)
42+
return assets_list
3643

3744
def _open_tab(self, name: str):
3845
assets_tab = wait_for_template(self._tab_item_template.real_name, name, 'text')
@@ -41,7 +48,6 @@ def _open_tab(self, name: str):
4148
@allure.step('Send {2} {3} to {1}')
4249
def send(self, address: str, amount: int, asset: str):
4350
self._open_tab('Assets')
44-
self._search_field.type_text(asset)
4551
self._select_asset(asset)
4652
assert driver.waitFor(lambda: self._amount_text_edit.is_visible, timeout_msec=6000)
4753
self._amount_text_edit.text = str(amount)

gui/objects_map/names.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@
408408
# Send Popup
409409
o_StatusTabBar = {"container": statusDesktop_mainWindow_overlay, "type": "StatusTabBar", "unnamed": 1, "visible": True}
410410
tab_Status_template = {"container": o_StatusTabBar, "type": "StatusBaseText", "unnamed": 1, "visible": True}
411-
o_TokenBalancePerChainDelegate_template = {"container": statusDesktop_mainWindow_overlay, "type": "TokenBalancePerChainDelegate", "unnamed": 1, "visible": True}
411+
o_TokenBalancePerChainDelegate_template = {"container": statusDesktop_mainWindow_overlay, "objectName": "tokenBalancePerChainDelegate", "type": "TokenBalancePerChainDelegate", "visible": True}
412412
amountInput_TextEdit = {"container": statusDesktop_mainWindow_overlay, "objectName": "amountInput", "type": "TextEdit", "visible": True}
413413
paste_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "type": "StatusButton", "unnamed": 1, "visible": True}
414414
ens_or_address_TextEdit = {"container": statusDesktop_mainWindow_overlay, "id": "edit", "type": "TextEdit", "unnamed": 1, "visible": True}
@@ -753,7 +753,7 @@
753753
# Wallet Account View
754754
mainWindow_RightTabView = {"container": statusDesktop_mainWindow, "type": "RightTabView", "unnamed": 1, "visible": True}
755755
mainWallet_Account_Name = {"container": mainWindow_RightTabView, "objectName": "walletHeaderTitle", "type": "StatusBaseText", "visible": True}
756-
mainWindow_Send_Button = {"container": mainWindow_StatusWindow, "type": "DisabledTooltipButton", "icon": "send", "visible": True}
756+
mainWindow_Send_Button = {"container": statusDesktop_mainWindow, "objectName": "walletFooterSendButton", "type": "StatusFlatButton", "visible": True}
757757
mainWindow_RightTabView = {"container": mainWindow_StatusWindow, "type": "RightTabView", "unnamed": 1, "visible": True}
758758
filterButton_StatusFlatButton = {"checkable": True, "container": mainWindow_RightTabView, "objectName": "filterButton", "type": "StatusFlatButton", "visible": True}
759759
cmbTokenOrder_SortOrderComboBox = {"container": mainWindow_RightTabView, "objectName": "cmbTokenOrder", "type": "SortOrderComboBox", "visible": True}

gui/screens/settings_wallet.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ def open_account_order(self):
7575
self._account_order_button.click()
7676
return EditAccountOrderSettings().wait_until_appears()
7777

78-
@allure.step('Open Status account view in wallet settings')
79-
def open_status_account_in_settings(self):
80-
self._status_account_in_keypair.click()
81-
return AccountDetailsView().wait_until_appears()
82-
8378
@allure.step('Get keypair names')
8479
def get_keypairs_names(self):
8580
keypair_names = []

tests/communities/test_communities_categories.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def test_create_edit_remove_community_category(main_screen: MainWindow, category
8282
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703274', 'Member role cannot remove category')
8383
@pytest.mark.case(703272, 703273, 703274)
8484
@pytest.mark.parametrize('user_data', [configs.testpath.TEST_USER_DATA / 'squisher'])
85-
@pytest.mark.skip(reason='https://github.com/status-im/status-desktop/issues/14059')
8685
def test_member_role_cannot_add_edit_or_delete_category(main_screen: MainWindow):
8786
with step('Choose community user is not owner of'):
8887
community_screen = main_screen.left_panel.select_community('Super community')

tests/settings/settings_wallet/test_wallet_settings_watched_addr_include_in_total_balance.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
pytest.param('0x7f1502605A2f2Cc01f9f4E7dd55e549954A8cD0C', ''.join(random.choices(string.ascii_letters +
2424
string.digits, k=20)))
2525
])
26-
@pytest.mark.skip(reason='https://github.com/status-im/desktop-qa-automation/issues/385')
2726
def test_settings_include_in_total_balance(main_screen: MainWindow, name, watched_address):
2827
with (step('Open wallet on main screen and check the total balance for new account is 0')):
2928
wallet_main_screen = main_screen.left_panel.open_wallet()

tests/settings/test_ens_name_purchase.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def keys_screen(main_window) -> KeysView:
3232
@pytest.mark.case(704597)
3333
@pytest.mark.parametrize('user_account', [constants.user.user_with_funds])
3434
@pytest.mark.parametrize('ens_name', [pytest.param(constants.user.ens_user_name)])
35-
@pytest.mark.skip(reason='https://github.com/status-im/status-desktop/issues/14262')
3635
def test_ens_name_purchase(keys_screen, main_window, user_account, ens_name):
3736
with step('Open import seed phrase view and enter seed phrase'):
3837
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()

tests/wallet_main_screen/wallet: footer actions/test_send.py renamed to tests/wallet_main_screen/wallet: footer actions/test_footer_actions_send.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def keys_screen(main_window) -> KeysView:
3131
@pytest.mark.parametrize('receiver_account_address, amount, asset', [
3232
pytest.param(constants.user.user_account_one.status_address, 0, 'Ether')
3333
])
34-
@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/12987")
3534
def test_wallet_send_0_eth(keys_screen, main_window, user_account, receiver_account_address, amount, asset):
3635
with step('Open import seed phrase view and enter seed phrase'):
3736
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()
@@ -52,7 +51,7 @@ def test_wallet_send_0_eth(keys_screen, main_window, user_account, receiver_acco
5251

5352
with step('Verify that restored account reveals correct status wallet address'):
5453
wallet_settings = main_window.left_panel.open_settings().left_panel.open_wallet_settings()
55-
status_acc_view = wallet_settings.open_status_account_in_settings()
54+
status_acc_view = wallet_settings.open_account_in_settings('Account 1', '0')
5655
address = status_acc_view.get_account_address_value()
5756
assert address == user_account.status_address, \
5857
f"Recovered account should have address {user_account.status_address}, but has {address}"
@@ -66,7 +65,7 @@ def test_wallet_send_0_eth(keys_screen, main_window, user_account, receiver_acco
6665
SigningPhrasePopup().wait_until_appears().confirm_phrase()
6766
assert driver.waitFor(lambda: wallet.left_panel.is_total_balance_visible, configs.timeouts.UI_LOAD_TIMEOUT_SEC)
6867
f"Total balance is not visible"
69-
wallet_account = wallet.left_panel.select_account('Status account')
68+
wallet_account = wallet.left_panel.select_account('Account 1')
7069
send_popup = wallet_account.open_send_popup()
7170

7271
with step('Enter asset, amount and address and click send and verify Mainnet network is shown'):

0 commit comments

Comments
 (0)