e2e: nightly fix
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
b2be539374
commit
a7f9998d6c
|
@ -35,7 +35,7 @@ class NetworkApi(object):
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
self.log("Check response from etherscan API. Returned values do not match expected. %s" % e)
|
self.log("Check response from etherscan API. Returned values do not match expected. %s" % e)
|
||||||
except JSONDecodeError as e:
|
except JSONDecodeError as e:
|
||||||
self.log(str(e))
|
self.log("No valid JSON response from Etherscan: %s " % str(e))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def get_token_transactions(self, address: str) -> List[dict]:
|
def get_token_transactions(self, address: str) -> List[dict]:
|
||||||
|
@ -47,7 +47,7 @@ class NetworkApi(object):
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
self.log("Check response from etherscan API. Returned values do not match expected. %s" % str(e))
|
self.log("Check response from etherscan API. Returned values do not match expected. %s" % str(e))
|
||||||
except JSONDecodeError as e:
|
except JSONDecodeError as e:
|
||||||
self.log(str(e))
|
self.log("No valid JSON response from Etherscan: %s " % str(e))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def is_transaction_successful(self, transaction_hash: str) -> int:
|
def is_transaction_successful(self, transaction_hash: str) -> int:
|
||||||
|
@ -92,7 +92,7 @@ class NetworkApi(object):
|
||||||
else:
|
else:
|
||||||
transactions = self.get_transactions(address)
|
transactions = self.get_transactions(address)
|
||||||
except JSONDecodeError as e:
|
except JSONDecodeError as e:
|
||||||
self.log(str(e))
|
self.log("No valid JSON response from Etherscan: %s " % str(e))
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
for transaction in transactions:
|
for transaction in transactions:
|
||||||
|
@ -141,7 +141,7 @@ class NetworkApi(object):
|
||||||
self.log("Trying to get funds from %s" % self.faucet_url)
|
self.log("Trying to get funds from %s" % self.faucet_url)
|
||||||
return requests.request('GET', '%s/0x%s' % (self.faucet_url, address)).json()
|
return requests.request('GET', '%s/0x%s' % (self.faucet_url, address)).json()
|
||||||
except JSONDecodeError as e:
|
except JSONDecodeError as e:
|
||||||
self.log(str(e))
|
self.log("No valid JSON response from Etherscan: %s " % str(e))
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def faucet_backup(self, address):
|
def faucet_backup(self, address):
|
||||||
|
@ -155,7 +155,8 @@ class NetworkApi(object):
|
||||||
if initial_balance < 1000000000000000000:
|
if initial_balance < 1000000000000000000:
|
||||||
if external_faucet:
|
if external_faucet:
|
||||||
self.faucet_backup(address)
|
self.faucet_backup(address)
|
||||||
self.faucet(address)
|
else:
|
||||||
|
self.faucet(address)
|
||||||
while True:
|
while True:
|
||||||
if counter >= wait_time:
|
if counter >= wait_time:
|
||||||
pytest.fail("Donation was not received during %s seconds!" % wait_time)
|
pytest.fail("Donation was not received during %s seconds!" % wait_time)
|
||||||
|
|
|
@ -248,11 +248,11 @@ class TestChatManagement(SingleDeviceTestCase):
|
||||||
home.just_fyi("Creating 3 types of chats")
|
home.just_fyi("Creating 3 types of chats")
|
||||||
chat = home.add_contact(basic_user['public_key'])
|
chat = home.add_contact(basic_user['public_key'])
|
||||||
one_to_one, public, group = basic_user['username'], '#public-delete-long-press', 'group'
|
one_to_one, public, group = basic_user['username'], '#public-delete-long-press', 'group'
|
||||||
chat.get_back_to_home_view()
|
chat.home_button.click()
|
||||||
home.create_group_chat([basic_user['username']], group)
|
home.create_group_chat([basic_user['username']], group)
|
||||||
chat.get_back_to_home_view()
|
chat.home_button.click()
|
||||||
home.join_public_chat(public[1:])
|
home.join_public_chat(public[1:])
|
||||||
chat.get_back_to_home_view()
|
chat.home_button.click()
|
||||||
|
|
||||||
home.just_fyi("Clearing history for 3 types of chats and check it will not reappear after re-login")
|
home.just_fyi("Clearing history for 3 types of chats and check it will not reappear after re-login")
|
||||||
for chat_name in one_to_one, public, group:
|
for chat_name in one_to_one, public, group:
|
||||||
|
@ -260,17 +260,16 @@ class TestChatManagement(SingleDeviceTestCase):
|
||||||
chat.send_message(message)
|
chat.send_message(message)
|
||||||
if chat.element_by_text(message).is_element_displayed():
|
if chat.element_by_text(message).is_element_displayed():
|
||||||
self.errors.append('Messages in %s chat are still shown after clearing history' % chat_name)
|
self.errors.append('Messages in %s chat are still shown after clearing history' % chat_name)
|
||||||
home = chat.get_back_to_home_view()
|
home = chat.home_button.click()
|
||||||
home.clear_chat_long_press(chat_name)
|
home.clear_chat_long_press(chat_name)
|
||||||
home.relogin()
|
home.relogin()
|
||||||
|
if home.element_by_text(message).is_element_displayed():
|
||||||
|
self.errors.append('Message is still shown in Preview after clearing history and relaunch')
|
||||||
for chat_name in one_to_one, public, group:
|
for chat_name in one_to_one, public, group:
|
||||||
if home.element_by_text(message).is_element_displayed():
|
|
||||||
self.errors.append(
|
|
||||||
'Messages in %s chat are still shown in Preview after clearing history and relaunch' % chat_name)
|
|
||||||
chat = home.get_chat(chat_name).click()
|
chat = home.get_chat(chat_name).click()
|
||||||
if chat.element_by_text(message).is_element_displayed():
|
if chat.element_by_text(message).is_element_displayed():
|
||||||
self.errors.append('Messages in %s chat are shown after clearing history and relauch' % chat_name)
|
self.errors.append('Messages in %s chat are shown after clearing history and relaunch' % chat_name)
|
||||||
chat.get_back_to_home_view()
|
chat.home_button.click()
|
||||||
|
|
||||||
self.errors.verify_no_errors()
|
self.errors.verify_no_errors()
|
||||||
|
|
||||||
|
|
|
@ -184,13 +184,14 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
||||||
send_transaction.confirm()
|
send_transaction.confirm()
|
||||||
send_transaction.sign_transaction_button.click()
|
send_transaction.sign_transaction_button.click()
|
||||||
chat_1_sender_message = chat_1.get_outgoing_transaction()
|
chat_1_sender_message = chat_1.get_outgoing_transaction()
|
||||||
home_1.click_system_home_button()
|
# TODO: PN is waiting for #11175
|
||||||
|
# home_1.click_system_home_button()
|
||||||
|
|
||||||
chat_2 = home_2.get_chat(sender['username']).click()
|
chat_2 = home_2.get_chat(sender['username']).click()
|
||||||
chat_2_receiver_message = chat_2.get_incoming_transaction()
|
chat_2_receiver_message = chat_2.get_incoming_transaction()
|
||||||
chat_2_receiver_message.decline_transaction.click()
|
chat_2_receiver_message.decline_transaction.click()
|
||||||
home_1.open_notification_bar()
|
# home_1.open_notification_bar()
|
||||||
home_1.element_by_text_part('Request address for transaction declined').wait_and_click()
|
# home_1.element_by_text_part('Request address for transaction declined').wait_and_click()
|
||||||
|
|
||||||
[message.transaction_status.wait_for_element_text(message.declined) for message in
|
[message.transaction_status.wait_for_element_text(message.declined) for message in
|
||||||
(chat_1_sender_message, chat_2_receiver_message)]
|
(chat_1_sender_message, chat_2_receiver_message)]
|
||||||
|
|
|
@ -111,8 +111,8 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
||||||
|
|
||||||
profile_2 = wallet_2.profile_button.click()
|
profile_2 = wallet_2.profile_button.click()
|
||||||
profile_2.airplane_mode_button.click()
|
profile_2.airplane_mode_button.click()
|
||||||
device_2.home_button.click()
|
device_2.home_button.double_click()
|
||||||
device_2.click_system_home_button()
|
# device_2.click_system_home_button()
|
||||||
chat_element = home_1.get_chat(sender['username'])
|
chat_element = home_1.get_chat(sender['username'])
|
||||||
chat_element.wait_for_visibility_of_element(30)
|
chat_element.wait_for_visibility_of_element(30)
|
||||||
chat_1 = chat_element.click()
|
chat_1 = chat_element.click()
|
||||||
|
@ -132,14 +132,15 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
||||||
|
|
||||||
home_2.just_fyi('Check that transaction message is fetched from offline and sign transaction')
|
home_2.just_fyi('Check that transaction message is fetched from offline and sign transaction')
|
||||||
profile_2.airplane_mode_button.click()
|
profile_2.airplane_mode_button.click()
|
||||||
transaction_request_pn = 'Request transaction'
|
# TODO: PN is waiting for #11175
|
||||||
device_2.open_notification_bar()
|
#transaction_request_pn = 'Request transaction'
|
||||||
if not device_2.element_by_text(transaction_request_pn).is_element_displayed(60):
|
# device_2.open_notification_bar()
|
||||||
self.errors.append("Push notification is not received after going back from offline")
|
# if not device_2.element_by_text(transaction_request_pn).is_element_displayed(60):
|
||||||
device_2.element_by_text(transaction_request_pn).click()
|
# self.errors.append("Push notification is not received after going back from offline")
|
||||||
|
# device_2.element_by_text(transaction_request_pn).click()
|
||||||
|
home_2.connection_status.wait_for_invisibility_of_element(120)
|
||||||
|
home_2.get_chat(recipient_username).click()
|
||||||
chat_2_sender_message = chat_2.get_outgoing_transaction()
|
chat_2_sender_message = chat_2.get_outgoing_transaction()
|
||||||
if not chat_2_sender_message.is_element_displayed():
|
|
||||||
self.driver.fail('No outgoing transaction in 1-1 chat is shown for sender after requesting STT')
|
|
||||||
chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.address_received)
|
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 = chat_2_sender_message.sign_and_send.click()
|
||||||
send_message.next_button.click()
|
send_message.next_button.click()
|
||||||
|
|
|
@ -154,14 +154,12 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
|
||||||
public_chat_name = home_1.get_random_chat_name()
|
public_chat_name = home_1.get_random_chat_name()
|
||||||
chat_1, chat_2 = home_1.join_public_chat(public_chat_name), home_2.join_public_chat(public_chat_name)
|
chat_1, chat_2 = home_1.join_public_chat(public_chat_name), home_2.join_public_chat(public_chat_name)
|
||||||
|
|
||||||
browser = device_1.dapp_tab_button.click()
|
device_1.dapp_tab_button.click()
|
||||||
message = 'hello'
|
message = 'hello'
|
||||||
chat_2.send_message(message)
|
chat_2.send_message(message)
|
||||||
|
home_1.home_button.click(desired_view='chat')
|
||||||
if home_1.home_button.public_unread_messages.is_element_displayed():
|
|
||||||
device_1.home_button.click_until_absense_of_element(browser.enter_url_editbox)
|
|
||||||
if not chat_1.chat_element_by_text(message).is_element_displayed():
|
if not chat_1.chat_element_by_text(message).is_element_displayed():
|
||||||
self.drivers[0].fail("No message if it received while another tab opened")
|
self.drivers[0].fail("No message if it is received while another tab opened")
|
||||||
|
|
||||||
|
|
||||||
class TestPublicChatSingleDevice(SingleDeviceTestCase):
|
class TestPublicChatSingleDevice(SingleDeviceTestCase):
|
||||||
|
|
|
@ -24,7 +24,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
|
||||||
status_test_dapp.wallet_button.click()
|
status_test_dapp.wallet_button.click()
|
||||||
|
|
||||||
send_transaction_view.just_fyi('Verify that wallet balance is updated')
|
send_transaction_view.just_fyi('Verify that wallet balance is updated')
|
||||||
wallet_view.wait_balance_is_changed('STT', initial_amount_STT)
|
wallet_view.wait_balance_is_changed('STT', initial_amount_STT, scan_tokens=True)
|
||||||
|
|
||||||
send_transaction_view.just_fyi('Check logcat for sensitive data')
|
send_transaction_view.just_fyi('Check logcat for sensitive data')
|
||||||
values_in_logcat = send_transaction_view.find_values_in_logcat(password=unique_password)
|
values_in_logcat = send_transaction_view.find_values_in_logcat(password=unique_password)
|
||||||
|
|
|
@ -86,11 +86,12 @@ class DappTabButton(TabButton):
|
||||||
from views.dapps_view import DappsView
|
from views.dapps_view import DappsView
|
||||||
return DappsView(self.driver)
|
return DappsView(self.driver)
|
||||||
|
|
||||||
def click(self, desired_element_text = 'enter_url'):
|
def click(self, desired_element_text=None):
|
||||||
from views.dapps_view import DappsView
|
|
||||||
if desired_element_text == 'enter_url':
|
from views.web_views.base_web_view import BaseWebView
|
||||||
self.click_until_presence_of_element(DappsView(self.driver).enter_url_editbox)
|
if desired_element_text is None:
|
||||||
if desired_element_text == 'webview':
|
self.click_until_presence_of_element(BaseWebView(self.driver).browser_next_page_button)
|
||||||
|
elif desired_element_text == 'webview':
|
||||||
self.find_element().click()
|
self.find_element().click()
|
||||||
else:
|
else:
|
||||||
base_view = BaseView(self.driver)
|
base_view = BaseView(self.driver)
|
||||||
|
|
|
@ -74,6 +74,16 @@ class ViewProfileButton(Button):
|
||||||
def navigate(self):
|
def navigate(self):
|
||||||
return ChatView(self.driver)
|
return ChatView(self.driver)
|
||||||
|
|
||||||
|
class ChatOptionsButton(Button):
|
||||||
|
def __init__(self, driver):
|
||||||
|
super().__init__(driver, accessibility_id="chat-menu-button")
|
||||||
|
|
||||||
|
def click(self):
|
||||||
|
self.click_until_presence_of_element(ChatView(self.driver).clear_history_button)
|
||||||
|
|
||||||
|
def navigate(self):
|
||||||
|
return ChatView(self.driver)
|
||||||
|
|
||||||
|
|
||||||
class ProfileSendMessageButton(Button):
|
class ProfileSendMessageButton(Button):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
|
@ -319,7 +329,7 @@ class ChatView(BaseView):
|
||||||
self.user_name_text = Text(self.driver, accessibility_id="chat-name-text")
|
self.user_name_text = Text(self.driver, accessibility_id="chat-name-text")
|
||||||
self.add_to_contacts = Button(self.driver, accessibility_id="add-to-contacts-button")
|
self.add_to_contacts = Button(self.driver, accessibility_id="add-to-contacts-button")
|
||||||
## Options
|
## Options
|
||||||
self.chat_options = Button(self.driver, accessibility_id="chat-menu-button")
|
self.chat_options = ChatOptionsButton(self.driver)
|
||||||
self.delete_chat_button = Button(self.driver, translation_id="delete-chat")
|
self.delete_chat_button = Button(self.driver, translation_id="delete-chat")
|
||||||
self.clear_history_button = Button(self.driver, translation_id="clear-history")
|
self.clear_history_button = Button(self.driver, translation_id="clear-history")
|
||||||
self.reply_message_button = Button(self.driver, translation_id="message-reply")
|
self.reply_message_button = Button(self.driver, translation_id="message-reply")
|
||||||
|
|
|
@ -180,6 +180,7 @@ class WalletView(BaseView):
|
||||||
else:
|
else:
|
||||||
self.driver.info('**Balance is updated!**')
|
self.driver.info('**Balance is updated!**')
|
||||||
self.wallet_button.double_click()
|
self.wallet_button.double_click()
|
||||||
|
self.accounts_status_account.scroll_to_element(direction='up')
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def get_sign_in_phrase(self):
|
def get_sign_in_phrase(self):
|
||||||
|
|
Loading…
Reference in New Issue