diff --git a/test/appium/support/api/network_api.py b/test/appium/support/api/network_api.py index 0cdad60d90..44db42cc6b 100644 --- a/test/appium/support/api/network_api.py +++ b/test/appium/support/api/network_api.py @@ -64,15 +64,12 @@ class NetworkApi(object): method = self.network_url + 'module=proxy&action=eth_blockNumber' return int(requests.request('GET', url=method).json()['result'], 0) - def find_transaction_by_hash(self, address: str, transaction_hash: str): - transactions = self.get_transactions(address=address) - for transaction in transactions: - if transaction['hash'] == transaction_hash: - logging.info('Transaction is found in Ropsten network') - return - pytest.fail('Transaction is not found in Ropsten network') + def find_transaction_by_hash(self,transaction_hash: str): + transaction = w3.transaction_status(transaction_hash) + if not transaction['blockHash']: + self.log("TX %s is still pending" %transaction_hash) - def find_transaction_by_unique_amount(self, address, amount, token=False, decimals=18, wait_time=600): + def find_transaction_by_unique_amount(self, address, amount, token=False, decimals=18, wait_time=300): additional_info = 'token transactions' if token else 'ETH transactions' counter = 0 while True: @@ -84,13 +81,14 @@ class NetworkApi(object): 'Transaction with amount %s is not found in list of %s, address is %s during %ss' % (amount, additional_info, address, wait_time)) else: - counter += 30 - time.sleep(30) + self.log("Finding tx in %s, attempt #%s" % (additional_info, str(int(counter / 30)+1))) try: if token: transactions = self.get_token_transactions(address) else: transactions = self.get_transactions(address) + counter += 30 + time.sleep(30) except JSONDecodeError as e: self.log("No valid JSON response from Etherscan: %s " % str(e)) continue @@ -101,16 +99,15 @@ class NetworkApi(object): except TypeError as e: self.log("Failed iterate transactions: " + str(e)) pytest.fail("No valid JSON response from Etherscan: %s " % str(e)) - # continue - def wait_for_confirmation_of_transaction(self, address, amount, confirmations=12, token=False): + def wait_for_confirmation_of_transaction(self, address, amount, confirmations=3, token=False): start_time = time.time() if token: token_info = "token transaction" else: token_info = "ETH transaction" self.log('Waiting %s %s for %s to have %s confirmations' % (amount, token_info, address, confirmations)) - while round(time.time() - start_time, ndigits=2) < 900: # should be < idleTimeout capability + while round(time.time() - start_time, ndigits=2) < 600: # should be < idleTimeout capability transaction = self.find_transaction_by_unique_amount(address, amount, token) self.log( 'Expected amount of confirmations is %s, in fact %s' % (confirmations, transaction['confirmations'])) diff --git a/test/appium/support/api/web3_api.py b/test/appium/support/api/web3_api.py index 0215f16a07..536722bbb3 100644 --- a/test/appium/support/api/web3_api.py +++ b/test/appium/support/api/web3_api.py @@ -74,8 +74,7 @@ def balance_of_address(address): return w3.eth.getBalance(to_checksum_address(address)) def transaction_status(hash): - return w3.eth.getTransaction(transaction_hash=hash) - + return w3.eth.getTransaction(hash) def to_checksumed_address(address): return to_checksum_address(address) diff --git a/test/appium/tests/atomic/account_management/test_keycard.py b/test/appium/tests/atomic/account_management/test_keycard.py index fbea21176f..ec270f3353 100644 --- a/test/appium/tests/atomic/account_management/test_keycard.py +++ b/test/appium/tests/atomic/account_management/test_keycard.py @@ -389,6 +389,7 @@ class TestCreateAccount(SingleDeviceTestCase): sign_in.just_fyi('Send transaction from added account and log out') transaction_amount_added = wallet_view.get_unique_amount() wallet_view.send_transaction(amount=transaction_amount_added, recipient=recipient, sign_transaction=True) + wallet_view.accounts_status_account.click() wallet_view.profile_button.click() profile_view.logout() diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 18998c2cd5..bcd792538d 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -696,6 +696,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase): profile_2.home_button.click(desired_view='home') if not home_2.get_chat(default_username_1).chat_image.is_element_image_similar_to_template('sauce_logo.png'): self.errors.append('User profile picture is not returned to default after user removed from Contacts') + self.errors.verify_no_errors() @marks.testrail_id(5432) @marks.medium diff --git a/test/appium/tests/atomic/chats/test_commands.py b/test/appium/tests/atomic/chats/test_commands.py index b4e6bf3299..a5e636a74c 100644 --- a/test/appium/tests/atomic/chats/test_commands.py +++ b/test/appium/tests/atomic/chats/test_commands.py @@ -68,7 +68,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): time.sleep(20) send_bottom_sheet = sender_message.sign_and_send.click() send_bottom_sheet.next_button.click() - send_bottom_sheet.sign_transaction(default_gas_price=False) + send_bottom_sheet.sign_transaction() updated_timestamp_sender = sender_message.timestamp_message.text if updated_timestamp_sender == timestamp_sender: self.errors.append("Timestamp of message is not updated after signing transaction") @@ -147,11 +147,11 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.address_received) send_message = chat_2_sender_message.sign_and_send.click() send_message.next_button.click() - send_message.sign_transaction(default_gas_price=False) + send_message.sign_transaction() home_2.just_fyi('Check that transaction message is updated with new status after offline') chat_2.toggle_airplane_mode() - self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, confirmations=12, token=True) + self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True) chat_2.toggle_airplane_mode() [message.transaction_status.wait_for_element_text(message.confirmed, wait_time=60) for message in (chat_2_sender_message, chat_1_request_message)] @@ -218,6 +218,9 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): device_1_sign_in.recover_access(passphrase=sender['passphrase']) device_2_sign_in.create_user() home_1, home_2 = device_1_sign_in.get_home_view(), device_2_sign_in.get_home_view() + wallet_1 = home_1.wallet_button.click() + wallet_1.set_up_wallet() + wallet_1.home_button.click() profile_2 = home_2.profile_button.click() device_2_username = profile_2.default_username_text.text profile_2.switch_network() @@ -245,7 +248,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): send_message = chat_1_sender_message.sign_and_send.click() send_message.next_button.click() send_message.sign_transaction() - self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, confirmations=15) + self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount) chat_1_sender_message.transaction_status.wait_for_element_text(chat_1_sender_message.confirmed) wallet_2 = chat_2.wallet_button.click() wallet_2.set_up_wallet() @@ -277,7 +280,7 @@ class TestCommandsSingleDevices(SingleDeviceTestCase): from views.send_transaction_view import SendTransactionView send_transaction = SendTransactionView(self.driver) send_transaction.ok_got_it_button.click() - send_transaction.sign_transaction(default_gas_price=False) + send_transaction.sign_transaction() chat_sender_message = chat.get_outgoing_transaction() - self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, confirmations=15) + self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount) chat_sender_message.transaction_status.wait_for_element_text(chat_sender_message.confirmed) diff --git a/test/appium/tests/atomic/chats/test_keycard_commands.py b/test/appium/tests/atomic/chats/test_keycard_commands.py index 247e5f2d58..307c79c7a5 100644 --- a/test/appium/tests/atomic/chats/test_keycard_commands.py +++ b/test/appium/tests/atomic/chats/test_keycard_commands.py @@ -63,7 +63,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): time.sleep(20) send_message = sender_message.sign_and_send.click() send_message.next_button.click() - send_message.sign_transaction(keycard=True, default_gas_price=False) + send_message.sign_transaction(keycard=True) updated_timestamp_sender = sender_message.timestamp_message.text if updated_timestamp_sender == timestamp_sender: self.errors.append("Timestamp of message is not updated after signing transaction") @@ -142,7 +142,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.address_received) send_message = chat_2_sender_message.sign_and_send.click() send_message.next_button.click() - send_message.sign_transaction(keycard=True, default_gas_price=False) + send_message.sign_transaction(keycard=True) home_2.just_fyi('Check that transaction message is updated with new status after offline') chat_2.toggle_airplane_mode() @@ -162,6 +162,10 @@ class TestCommandsSingleDevices(SingleDeviceTestCase): sign_in = SignInView(self.driver) sender = transaction_senders['E'] home = sign_in.recover_access(sender['passphrase'], keycard=True) + wallet = home.wallet_button.click() + wallet.set_up_wallet() + wallet.home_button.click() + chat = home.add_contact(ens_user_ropsten['ens']) chat.commands_button.click() amount = chat.get_unique_amount() @@ -175,5 +179,5 @@ class TestCommandsSingleDevices(SingleDeviceTestCase): send_transaction = SendTransactionView(self.driver) send_transaction.sign_transaction(keycard=True) chat_sender_message = chat.get_outgoing_transaction() - self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, confirmations=15) + self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount) chat_sender_message.transaction_status.wait_for_element_text(chat_sender_message.confirmed) diff --git a/test/appium/tests/atomic/transactions/test_dapps_transactions.py b/test/appium/tests/atomic/transactions/test_dapps_transactions.py index c5b8cc81a0..98ec7c9d5d 100644 --- a/test/appium/tests/atomic/transactions/test_dapps_transactions.py +++ b/test/appium/tests/atomic/transactions/test_dapps_transactions.py @@ -117,7 +117,7 @@ class TestTransactionDApp(SingleDeviceTestCase): home.just_fyi("Checking deploy simple contract") send_transaction = status_test_dapp.deploy_contract_button.click() - send_transaction.sign_transaction(default_gas_price=False) + send_transaction.sign_transaction(default_gas_price=True) if not status_test_dapp.element_by_text('Contract deployed at: ').is_element_displayed(180): self.errors.append('Contract was not created') for text in ['Call contract get function', diff --git a/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py b/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py index b2463d77c4..2c4e3869d9 100644 --- a/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py +++ b/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py @@ -98,9 +98,9 @@ class TestTransactionDApp(SingleDeviceTestCase): wallet.just_fyi("Checking deploy simple contract") send_transaction_view = status_test_dapp.deploy_contract_button.click() - send_transaction_view.sign_transaction(keycard=True, default_gas_price=False) - if not status_test_dapp.element_by_text('Contract deployed at: ').is_element_displayed(180): - self.errors.append('Contract was not created') + send_transaction_view.sign_transaction(keycard=True) + if not status_test_dapp.element_by_text('Contract deployed at: ').is_element_displayed(300): + self.driver.fail('Contract was not created or tx taking too long') for text in ['Call contract get function', 'Call contract set function', 'Call function 2 times in a row']: status_test_dapp.element_by_text(text).scroll_to_element() diff --git a/test/appium/tests/atomic/transactions/test_keycard_wallet.py b/test/appium/tests/atomic/transactions/test_keycard_wallet.py index 52bcb4097d..b1711bc1da 100644 --- a/test/appium/tests/atomic/transactions/test_keycard_wallet.py +++ b/test/appium/tests/atomic/transactions/test_keycard_wallet.py @@ -23,15 +23,10 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): sign_transaction=True, keycard=True, recipient='0x%s'%recipient['address']) - self.network_api.find_transaction_by_unique_amount(sender['address'], transaction_amount) wallet_view.just_fyi('Check that transaction is appeared in transaction history') - wallet_view.find_transaction_in_history(amount=transaction_amount) - - wallet_view.just_fyi('Check logcat for sensitive data') - values_in_logcat = wallet_view.find_values_in_logcat(pin=pin, puk=puk, password=pair_code) - if values_in_logcat: - self.driver.fail(values_in_logcat) + transaction = wallet_view.find_transaction_in_history(amount=transaction_amount, return_hash=True) + self.network_api.find_transaction_by_hash(transaction) @marks.testrail_id(6290) @@ -50,7 +45,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): sign_in_view.just_fyi('Go back to online and check that balance is updated') sign_in_view.toggle_airplane_mode() wallet_view.wait_balance_is_changed('ETH') - wallet_view.scan_tokens('STT') + wallet_view.wait_balance_is_changed('STT') sign_in_view.just_fyi('Send some tokens to other account') recipient = "0x" + basic_user['address'] @@ -61,7 +56,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): wallet_view.send_transaction(asset_name=asset, amount=sending_amount, recipient=recipient, sign_transaction=True, keycard=True) sign_in_view.toggle_airplane_mode() - self.network_api.wait_for_confirmation_of_transaction(basic_user['address'], sending_amount, confirmations=6, token=True) + self.network_api.wait_for_confirmation_of_transaction(basic_user['address'], sending_amount, token=True) sign_in_view.just_fyi('Change that balance is updated and transaction is appeared in history') @@ -117,7 +112,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): wallet_view.just_fyi("Send transaction to new account") wallet_view.accounts_status_account.click() - transaction_amount = '0.002' + transaction_amount = '0.004' initial_balance = self.network_api.get_balance(status_account_address) send_transaction = wallet_view.send_transaction(account_name=account_name, amount=transaction_amount, @@ -138,7 +133,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): wallet_view.just_fyi("Sending eth from new account to main account") updated_balance = self.network_api.get_balance(status_account_address) - transaction_amount_1 = round(float(transaction_amount) * 0.1, 11) + transaction_amount_1 = round(float(transaction_amount) * 0.2, 11) wallet_view.wait_balance_is_changed() wallet_view.get_account_by_name(account_name).click() send_transaction = wallet_view.send_transaction(account_name=wallet_view.status_account_name, @@ -155,7 +150,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): self.network_api.verify_balance_is_updated(updated_balance, status_account_address) wallet_view.just_fyi("Verify total ETH on main wallet view") - self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount_1, 3) + self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount_1) self.network_api.verify_balance_is_updated((updated_balance + transaction_amount_1), status_account_address) send_transaction.back_button.click() balance_of_sub_account = float(self.network_api.get_balance(sub_account_address)) / 1000000000000000000 @@ -181,6 +176,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): send_transaction.accounts_button.click() send_transaction.element_by_text(wallet_view.status_account_name).click() send_transaction.sign_transaction_button.click() - send_transaction.sign_transaction(keycard=True) + send_transaction.sign_transaction(keycard=True, default_gas_price=True) wallet_view.element_by_text('Assets').click() wallet_view.wait_balance_is_equal_expected_amount(asset='ETH', expected_balance=0) diff --git a/test/appium/tests/atomic/transactions/test_wallet.py b/test/appium/tests/atomic/transactions/test_wallet.py index 105ec93e48..83a5f3269e 100644 --- a/test/appium/tests/atomic/transactions/test_wallet.py +++ b/test/appium/tests/atomic/transactions/test_wallet.py @@ -78,7 +78,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): wallet_view.send_transaction(asset_name=asset, amount=sending_amount, recipient=recipient, sign_transaction=True) sign_in_view.toggle_airplane_mode() - self.network_api.wait_for_confirmation_of_transaction(basic_user['address'], sending_amount, confirmations=6, token=True) + self.network_api.wait_for_confirmation_of_transaction(basic_user['address'], sending_amount, token=True) sign_in_view.just_fyi('Change that balance is updated') sign_in_view.toggle_airplane_mode() @@ -125,7 +125,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): wallet_view.send_transaction(amount=amount, recipient='0x%s' % recipient['address'], asset_name='ADI') - self.network_api.find_transaction_by_unique_amount(recipient['address'], amount, token=True, decimals=7) + transaction = wallet_view.find_transaction_in_history(amount=amount, asset='ADI', return_hash=True) + self.network_api.find_transaction_by_hash(transaction) @marks.testrail_id(5412) @@ -250,7 +251,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): wallet_view.accounts_status_account.click() initial_balance = self.network_api.get_balance(status_account_address) - transaction_amount = '0.000%s' % str(random.randint(10000, 99999)) + '1' + transaction_amount = '0.003%s' % str(random.randint(10000, 99999)) + '1' wallet_view.send_transaction(account_name=account_name, amount=transaction_amount) self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount) @@ -269,7 +270,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): wallet_view.just_fyi("Sending eth from new account to main account") updated_balance = self.network_api.get_balance(status_account_address) - transaction_amount_1 = round(float(transaction_amount) * 0.1, 12) + transaction_amount_1 = round(float(transaction_amount) * 0.2, 12) send_transaction = wallet_view.send_transaction(account_name=wallet_view.status_account_name, amount=transaction_amount_1, default_gas_price=True) @@ -284,7 +285,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): self.network_api.verify_balance_is_updated(updated_balance, status_account_address) wallet_view.just_fyi("Verify total ETH on main wallet view") - self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount_1, 3) + self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount_1) self.network_api.verify_balance_is_updated((updated_balance + transaction_amount_1), status_account_address) send_transaction.back_button.click() balance_of_sub_account = float(self.network_api.get_balance(sub_account_address)) / 1000000000000000000 @@ -701,7 +702,7 @@ class TestTransactionWalletMultipleDevice(MultipleDeviceTestCase): device_1.just_fyi("Sending token amount to device who will use Set Max option for token") amount = '0.012345678912345678' wallet_view_serder.accounts_status_account.click() - wallet_view_serder.send_transaction(asset_name='STT', amount=amount, recipient=receiver['address'], default_gas_price=False) + wallet_view_serder.send_transaction(asset_name='STT', amount=amount, recipient=receiver['address']) wallet_view_receiver.wait_balance_is_changed(asset='STT', initial_balance=initial_balance, scan_tokens=True) wallet_view_receiver.accounts_status_account.click() @@ -716,7 +717,7 @@ class TestTransactionWalletMultipleDevice(MultipleDeviceTestCase): send_transaction_view.set_max_button.click() send_transaction_view.set_recipient_address(sender['address']) send_transaction_view.sign_transaction_button.click() - send_transaction_view.sign_transaction(default_gas_price=False) + send_transaction_view.sign_transaction() wallet_view_receiver.back_button.click() initial_balance = float(initial_balance) + float(amount) wallet_view_receiver.wait_balance_is_changed(asset='STT', initial_balance=str(initial_balance), scan_tokens=True) diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index 9363dd5b47..fe0d228c14 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -455,6 +455,10 @@ class BaseView(object): from views.profile_view import ProfileView return ProfileView(self.driver) + def get_transaction_view(self): + from views.transactions_view import TransactionsView + return TransactionsView(self.driver) + def get_wallet_view(self): from views.wallet_view import WalletView return WalletView(self.driver) diff --git a/test/appium/views/elements_templates/blank_camera_image.png b/test/appium/views/elements_templates/blank_camera_image.png index 1d6891597c..1b70e85963 100644 Binary files a/test/appium/views/elements_templates/blank_camera_image.png and b/test/appium/views/elements_templates/blank_camera_image.png differ diff --git a/test/appium/views/elements_templates/default_icon_profile.png b/test/appium/views/elements_templates/default_icon_profile.png deleted file mode 100644 index e29f2cfaf0..0000000000 Binary files a/test/appium/views/elements_templates/default_icon_profile.png and /dev/null differ diff --git a/test/appium/views/send_transaction_view.py b/test/appium/views/send_transaction_view.py index bf187a5ae5..57b022466a 100644 --- a/test/appium/views/send_transaction_view.py +++ b/test/appium/views/send_transaction_view.py @@ -134,7 +134,7 @@ class SendTransactionView(BaseView): self.enter_recipient_address_input.click() self.done_button.click_until_absense_of_element(self.done_button) - def sign_transaction(self, sender_password: str = common_password, keycard=False, default_gas_price=True): + def sign_transaction(self, sender_password: str = common_password, keycard=False, default_gas_price=False): self.driver.info("**Signing transaction (keycard:%s, default_gas_price:%s)**" % (str(keycard), str(default_gas_price))) if not default_gas_price: self.network_fee_button.click() diff --git a/test/appium/views/transactions_view.py b/test/appium/views/transactions_view.py index a4782f0afe..aa2e38d4a4 100644 --- a/test/appium/views/transactions_view.py +++ b/test/appium/views/transactions_view.py @@ -1,4 +1,3 @@ -import time from selenium.common.exceptions import NoSuchElementException from views.base_element import BaseElement, Button, Text from views.base_view import BaseView @@ -79,6 +78,7 @@ class TransactionTable(BaseElement): self.driver.info('**Finding transaction by index %s**' % index) return self.TransactionElement.by_index(self.driver, index=index) + def transaction_by_amount(self, amount: str, asset): self.driver.info('**Finding transaction by amount %s**' % amount) return self.TransactionElement.by_amount(self.driver, amount=amount.replace(',', '.'), asset=asset) diff --git a/test/appium/views/wallet_view.py b/test/appium/views/wallet_view.py index 5077f71200..fd83136637 100644 --- a/test/appium/views/wallet_view.py +++ b/test/appium/views/wallet_view.py @@ -44,7 +44,8 @@ class AccountElementButton(SilentButton): def color_matches(self, expected_color_image_name: str): amount_text = Text(self.driver, xpath="%s//*[@content-desc='account-total-value']" % self.locator) - return amount_text.is_element_image_equals_template(expected_color_image_name) + amount_text.wait_for_element_text('0', 60) + return not amount_text.is_element_differs_from_template(expected_color_image_name) class SendTransactionButton(Button): @@ -280,11 +281,10 @@ class WalletView(BaseView): if kwargs.get('sign_transaction', True): send_transaction_view.sign_transaction_button.click_until_presence_of_element(send_transaction_view.network_fee_button) send_transaction_view.sign_transaction(keycard=kwargs.get('keycard', False), - default_gas_price=kwargs.get('default_gas_price', False), sender_password=kwargs.get('sender_password', common_password)) return send_transaction_view - def find_transaction_in_history(self, amount, asset='ETH', account_name=None): + def find_transaction_in_history(self, amount, asset='ETH', account_name=None, return_hash=False): if account_name == None: account_name = self.status_account_name self.driver.info('**Finding %s %s transaction for %s**' % (amount, asset, account_name)) @@ -292,7 +292,14 @@ class WalletView(BaseView): self.get_account_by_name(account_name).click() self.transaction_history_button.wait_for_element() transactions_view = self.transaction_history_button.click() - return transactions_view.transactions_table.find_transaction(amount=amount, asset=asset) + transaction_element = transactions_view.transactions_table.find_transaction(amount=amount, asset=asset) + result = transaction_element + if return_hash: + transaction_element.click() + from views.transactions_view import TransactionTable + result = TransactionTable.TransactionElement.TransactionDetailsView(self.driver).get_transaction_hash() + return result + def set_currency(self, desired_currency='EUR'): self.driver.info("**Setting '%s' currency**" % desired_currency)