false failures fix

Signed-off-by: Anton Danchenko <ant.danchenko@gmail.com>
This commit is contained in:
Anton Danchenko 2018-09-03 15:52:31 +03:00
parent bf068f7909
commit 1b2eb5826a
No known key found for this signature in database
GPG Key ID: C2D4819B698627E4
2 changed files with 10 additions and 5 deletions

View File

@ -2,6 +2,7 @@ import logging
import pytest import pytest
import requests import requests
import time import time
from json import JSONDecodeError
class NetworkApi: class NetworkApi:
@ -15,7 +16,7 @@ class NetworkApi:
method = self.network_url + 'module=account&action=txlist&address=0x%s&sort=desc' % address method = self.network_url + 'module=account&action=txlist&address=0x%s&sort=desc' % address
return requests.request('GET', url=method).json()['result'] 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 method = self.network_url + 'module=account&action=tokentx&address=0x%s&sort=desc' % address
return requests.request('GET', url=method).json()['result'] return requests.request('GET', url=method).json()['result']
@ -53,10 +54,13 @@ class NetworkApi:
else: else:
counter += 10 counter += 10
time.sleep(10) time.sleep(10)
if token: try:
transactions = self.get_token_transaction(address=address) if token:
else: transactions = self.get_token_transactions(address)
transactions = self.get_transactions(address=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' % logging.info('Looking for a transaction with unique amount %s in list of transactions, address is %s' %
(amount, address)) (amount, address))
for transaction in transactions: for transaction in transactions:

View File

@ -121,6 +121,7 @@ class HomeView(BaseView):
def add_contact(self, public_key): def add_contact(self, public_key):
start_new_chat = self.plus_button.click() start_new_chat = self.plus_button.click()
start_new_chat.start_new_chat_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) start_new_chat.public_key_edit_box.set_value(public_key)
one_to_one_chat = self.get_chat_view() one_to_one_chat = self.get_chat_view()
start_new_chat.confirm_until_presence_of_element(one_to_one_chat.chat_message_input) start_new_chat.confirm_until_presence_of_element(one_to_one_chat.chat_message_input)