diff --git a/test/appium/support/api/network_api.py b/test/appium/support/api/network_api.py index 1024ece318..9617580be4 100644 --- a/test/appium/support/api/network_api.py +++ b/test/appium/support/api/network_api.py @@ -2,6 +2,7 @@ import logging import pytest import requests import time +from json import JSONDecodeError class NetworkApi: @@ -15,7 +16,7 @@ class NetworkApi: method = self.network_url + 'module=account&action=txlist&address=0x%s&sort=desc' % address return requests.request('GET', url=method).json()['result'] - def get_token_transaction(self, address: str) -> dict: + def get_token_transactions(self, address: str) -> dict: method = self.network_url + 'module=account&action=tokentx&address=0x%s&sort=desc' % address return requests.request('GET', url=method).json()['result'] @@ -53,10 +54,13 @@ class NetworkApi: else: counter += 10 time.sleep(10) - if token: - transactions = self.get_token_transaction(address=address) - else: - transactions = self.get_transactions(address=address) + try: + if token: + transactions = self.get_token_transactions(address) + else: + transactions = self.get_transactions(address) + except JSONDecodeError: + continue logging.info('Looking for a transaction with unique amount %s in list of transactions, address is %s' % (amount, address)) for transaction in transactions: diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index f0d211eebd..468885edf4 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -121,6 +121,7 @@ class HomeView(BaseView): def add_contact(self, public_key): start_new_chat = self.plus_button.click() start_new_chat.start_new_chat_button.click() + start_new_chat.public_key_edit_box.wait_for_visibility_of_element() start_new_chat.public_key_edit_box.set_value(public_key) one_to_one_chat = self.get_chat_view() start_new_chat.confirm_until_presence_of_element(one_to_one_chat.chat_message_input)