diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 6d14848b385b..d0f2117ffd62 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -242,7 +242,7 @@ def test_contact_profile_view(self): chat_view = home_view.get_chat_view() chat_view.chat_options.click_until_presence_of_element(chat_view.view_profile_button) chat_view.view_profile_button.click() - for text in basic_user['username'], 'In contacts', 'Send message', 'Chat key': + for text in basic_user['username'], 'Remove from contacts', 'Send message', 'Block this user': if not chat_view.element_by_text(text).scroll_to_element(): self.errors.append('%s is not visible' % text) self.verify_no_errors() diff --git a/test/appium/tests/atomic/transactions/test_wallet.py b/test/appium/tests/atomic/transactions/test_wallet.py index f0af5a23ee97..fced30030acf 100644 --- a/test/appium/tests/atomic/transactions/test_wallet.py +++ b/test/appium/tests/atomic/transactions/test_wallet.py @@ -434,12 +434,14 @@ def test_send_funds_between_accounts_in_multiaccount_instance(self): sign_in_view.create_user() wallet_view = sign_in_view.wallet_button.click() wallet_view.set_up_wallet() - address = wallet_view.get_wallet_address()[2:] + status_account_address = wallet_view.get_wallet_address()[2:] wallet_view.back_button.click() - self.network_api.get_donate(address) + self.network_api.get_donate(status_account_address) - account_name = 'test account' + account_name = 'subaccount' wallet_view.add_account(account_name) + + # sending to new account transaction wallet_view.accounts_status_account.click() send_transaction = wallet_view.send_transaction_button.click() send_transaction.amount_edit_box.click() @@ -451,8 +453,10 @@ def test_send_funds_between_accounts_in_multiaccount_instance(self): send_transaction.element_by_text(account_name).click() send_transaction.sign_transaction_button.click() send_transaction.sign_transaction() - self.network_api.wait_for_confirmation_of_transaction(address, transaction_amount) - self.network_api.verify_balance_is_updated('0.1', address) + self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount) + self.network_api.verify_balance_is_updated('0.1', status_account_address) + + # verifying previously sent transaction withing new account wallet_view.back_button.click() wallet_view.get_account_by_name(account_name).click() wallet_view.send_transaction_button.click() @@ -461,11 +465,12 @@ def test_send_funds_between_accounts_in_multiaccount_instance(self): if balance_after_receiving_tx != float(transaction_amount): self.driver.fail('New account balance %s does not match expected %s after receiving a transaction' % ( balance_after_receiving_tx, transaction_amount)) - updated_balance = self.network_api.get_balance(address) + # sending eth from new account to main account + updated_balance = self.network_api.get_balance(status_account_address) wallet_view.send_transaction_button.click() send_transaction.amount_edit_box.click() - transaction_amount_1 = round(float(transaction_amount) * 0.7, 11) + transaction_amount_1 = round(float(transaction_amount) * 0.05, 11) send_transaction.amount_edit_box.set_value(str(transaction_amount_1)) send_transaction.confirm() send_transaction.chose_recipient_button.click() @@ -474,15 +479,20 @@ def test_send_funds_between_accounts_in_multiaccount_instance(self): send_transaction.sign_transaction_button.click() total_fee = send_transaction.get_transaction_fee_total() send_transaction.sign_transaction() - if not wallet_view.wait_for_element_starts_with_text('Transaction sent').is_element_displayed(): - self.driver.fail('Transaction was not sent from the new account') - self.network_api.wait_for_confirmation_of_transaction(address, transaction_amount) - self.network_api.verify_balance_is_updated(updated_balance, address) - balance_after_sending_tx = wallet_view.eth_asset_value.text + send_transaction.back_button.click() + sub_account_address = wallet_view.get_wallet_address(account_name)[2:] + self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount) + self.network_api.verify_balance_is_updated(updated_balance, status_account_address) + + # verify the total on main wallet view + send_transaction.back_button.click() + balance_of_sub_account = float(self.network_api.get_balance(sub_account_address)) / 1000000000000000000 + balance_of_status_account = float(self.network_api.get_balance(status_account_address)) / 1000000000000000000 expected_balance = str(float(balance_after_receiving_tx) - transaction_amount_1 - float(total_fee)) - if balance_after_sending_tx != expected_balance: - self.driver.fail('New account balance %s does not match expected %s after sending a transaction' % ( - balance_after_sending_tx, transaction_amount)) + total_eth_from_two_accounts = float(wallet_view.eth_asset_value.text) + if total_eth_from_two_accounts != (balance_of_status_account + balance_of_sub_account): + self.driver.fail('Total wallet balance %s != of Status account (%s) + SubAccount (%s)' % ( + total_eth_from_two_accounts, balance_of_status_account, balance_of_sub_account)) @marks.transaction diff --git a/test/appium/views/wallet_view.py b/test/appium/views/wallet_view.py index 28d15389887f..49010e1edca5 100644 --- a/test/appium/views/wallet_view.py +++ b/test/appium/views/wallet_view.py @@ -328,7 +328,7 @@ def __init__(self, driver): # elements for multiaccount self.multiaccount_more_options = MultiaccountMoreOptions(self.driver) - self.accounts_status_account = AccountElementButton(self.driver, 'Status account') + self.accounts_status_account = AccountElementButton(self.driver, account_name="Status account") self.collectibles_button = CollectiblesButton(self.driver) self.set_currency_button = SetCurrencyButton(self.driver) self.add_account_button = AddAccountButton(self.driver) @@ -385,13 +385,16 @@ def set_up_wallet(self): self.ok_got_it_button.click() return phrase - def get_wallet_address(self): - self.accounts_status_account.click() + def get_wallet_address(self, account_name="Status account"): + self.wallet_account_by_name(account_name).click() self.receive_transaction_button.click() address = self.address_text.text self.back_button.click() return address + def wallet_account_by_name(self, account_name): + return AccountElementButton(self.driver, account_name) + def asset_by_name(self, asset_name): return AssetTextElement(self.driver, asset_name)