e2e: nightly fix

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2021-02-08 13:52:20 +01:00
parent b2be539374
commit a7f9998d6c
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
9 changed files with 50 additions and 38 deletions

View File

@ -35,7 +35,7 @@ class NetworkApi(object):
except TypeError as e:
self.log("Check response from etherscan API. Returned values do not match expected. %s" % e)
except JSONDecodeError as e:
self.log(str(e))
self.log("No valid JSON response from Etherscan: %s " % str(e))
pass
def get_token_transactions(self, address: str) -> List[dict]:
@ -47,7 +47,7 @@ class NetworkApi(object):
except TypeError as e:
self.log("Check response from etherscan API. Returned values do not match expected. %s" % str(e))
except JSONDecodeError as e:
self.log(str(e))
self.log("No valid JSON response from Etherscan: %s " % str(e))
pass
def is_transaction_successful(self, transaction_hash: str) -> int:
@ -92,7 +92,7 @@ class NetworkApi(object):
else:
transactions = self.get_transactions(address)
except JSONDecodeError as e:
self.log(str(e))
self.log("No valid JSON response from Etherscan: %s " % str(e))
continue
try:
for transaction in transactions:
@ -141,7 +141,7 @@ class NetworkApi(object):
self.log("Trying to get funds from %s" % self.faucet_url)
return requests.request('GET', '%s/0x%s' % (self.faucet_url, address)).json()
except JSONDecodeError as e:
self.log(str(e))
self.log("No valid JSON response from Etherscan: %s " % str(e))
pass
def faucet_backup(self, address):
@ -155,7 +155,8 @@ class NetworkApi(object):
if initial_balance < 1000000000000000000:
if external_faucet:
self.faucet_backup(address)
self.faucet(address)
else:
self.faucet(address)
while True:
if counter >= wait_time:
pytest.fail("Donation was not received during %s seconds!" % wait_time)

View File

@ -248,11 +248,11 @@ class TestChatManagement(SingleDeviceTestCase):
home.just_fyi("Creating 3 types of chats")
chat = home.add_contact(basic_user['public_key'])
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)
chat.get_back_to_home_view()
chat.home_button.click()
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")
for chat_name in one_to_one, public, group:
@ -260,17 +260,16 @@ class TestChatManagement(SingleDeviceTestCase):
chat.send_message(message)
if chat.element_by_text(message).is_element_displayed():
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.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:
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()
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)
chat.get_back_to_home_view()
self.errors.append('Messages in %s chat are shown after clearing history and relaunch' % chat_name)
chat.home_button.click()
self.errors.verify_no_errors()

View File

@ -184,13 +184,14 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
send_transaction.confirm()
send_transaction.sign_transaction_button.click()
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_receiver_message = chat_2.get_incoming_transaction()
chat_2_receiver_message.decline_transaction.click()
home_1.open_notification_bar()
home_1.element_by_text_part('Request address for transaction declined').wait_and_click()
# home_1.open_notification_bar()
# 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
(chat_1_sender_message, chat_2_receiver_message)]

View File

@ -111,8 +111,8 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
profile_2 = wallet_2.profile_button.click()
profile_2.airplane_mode_button.click()
device_2.home_button.click()
device_2.click_system_home_button()
device_2.home_button.double_click()
# device_2.click_system_home_button()
chat_element = home_1.get_chat(sender['username'])
chat_element.wait_for_visibility_of_element(30)
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')
profile_2.airplane_mode_button.click()
transaction_request_pn = 'Request transaction'
device_2.open_notification_bar()
if not device_2.element_by_text(transaction_request_pn).is_element_displayed(60):
self.errors.append("Push notification is not received after going back from offline")
device_2.element_by_text(transaction_request_pn).click()
# TODO: PN is waiting for #11175
#transaction_request_pn = 'Request transaction'
# device_2.open_notification_bar()
# if not device_2.element_by_text(transaction_request_pn).is_element_displayed(60):
# 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()
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)
send_message = chat_2_sender_message.sign_and_send.click()
send_message.next_button.click()

View File

@ -154,14 +154,12 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
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)
browser = device_1.dapp_tab_button.click()
device_1.dapp_tab_button.click()
message = 'hello'
chat_2.send_message(message)
if home_1.home_button.public_unread_messages.is_element_displayed():
device_1.home_button.click_until_absense_of_element(browser.enter_url_editbox)
home_1.home_button.click(desired_view='chat')
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):

View File

@ -24,7 +24,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
status_test_dapp.wallet_button.click()
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')
values_in_logcat = send_transaction_view.find_values_in_logcat(password=unique_password)

View File

@ -86,11 +86,12 @@ class DappTabButton(TabButton):
from views.dapps_view import DappsView
return DappsView(self.driver)
def click(self, desired_element_text = 'enter_url'):
from views.dapps_view import DappsView
if desired_element_text == 'enter_url':
self.click_until_presence_of_element(DappsView(self.driver).enter_url_editbox)
if desired_element_text == 'webview':
def click(self, desired_element_text=None):
from views.web_views.base_web_view import BaseWebView
if desired_element_text is None:
self.click_until_presence_of_element(BaseWebView(self.driver).browser_next_page_button)
elif desired_element_text == 'webview':
self.find_element().click()
else:
base_view = BaseView(self.driver)

View File

@ -74,6 +74,16 @@ class ViewProfileButton(Button):
def navigate(self):
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):
def __init__(self, driver):
@ -319,7 +329,7 @@ class ChatView(BaseView):
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")
## 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.clear_history_button = Button(self.driver, translation_id="clear-history")
self.reply_message_button = Button(self.driver, translation_id="message-reply")

View File

@ -180,6 +180,7 @@ class WalletView(BaseView):
else:
self.driver.info('**Balance is updated!**')
self.wallet_button.double_click()
self.accounts_status_account.scroll_to_element(direction='up')
return self
def get_sign_in_phrase(self):