e2e: failures
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
b3a3a753d2
commit
920000c3e8
|
@ -68,7 +68,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
|||
profile.delete_my_profile_password_input.set_value(common_password)
|
||||
profile.delete_profile_button.click()
|
||||
profile.ok_button.click()
|
||||
if not sign_in.get_started_button.is_element_displayed():
|
||||
if not sign_in.get_started_button.is_element_displayed(20):
|
||||
self.errors.append('No redirected to carousel view after deleting last multiaccount')
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
|
|
|
@ -47,13 +47,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
send_message.next_button.click()
|
||||
send_message.sign_transaction()
|
||||
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, confirmations=15)
|
||||
if chat_1_sender_message.transaction_status.text != 'Confirmed':
|
||||
self.errors.append('Wrong state is shown for outgoing from Ropsten transaction: "Confirmed" is expected, '
|
||||
'in fact %s ' % chat_1_sender_message.transaction_status.text)
|
||||
|
||||
if chat_2_request_message.transaction_status.text == 'Confirmed':
|
||||
self.errors.append('Sent from Ropsten transaction is shown as confirmed!')
|
||||
|
||||
[message.transaction_status.wait_for_element_text('Confirmed') for message in (chat_1_sender_message, chat_2_request_message)]
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(6253)
|
||||
|
@ -87,18 +81,14 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
chat_1_sender_message = chat_1.chat_element_by_text('↑ Outgoing transaction')
|
||||
if not chat_1_sender_message.is_element_displayed():
|
||||
self.driver.fail('No message is shown after sending ETH in 1-1 chat for sender')
|
||||
if chat_1_sender_message.transaction_status.text != 'Address requested':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Address requested" is expected, in fact'
|
||||
' %s ' % chat_1_sender_message.transaction_status.text)
|
||||
chat_1_sender_message.transaction_status.wait_for_element_text('Address requested')
|
||||
|
||||
chat_2 = home_2.get_chat(sender['username']).click()
|
||||
chat_2_receiver_message = chat_2.chat_element_by_text('↓ Incoming transaction')
|
||||
timestamp_sender = chat_1_sender_message.timestamp_message.text
|
||||
if not chat_2_receiver_message.is_element_displayed():
|
||||
self.driver.fail('No message about incoming transaction in 1-1 chat is shown for receiver')
|
||||
if chat_2_receiver_message.transaction_status.text != 'Address requested':
|
||||
self.errors.append('Wrong state is shown for incoming transaction: "Address requested" is expected, in fact'
|
||||
' %s' % chat_2_receiver_message.transaction_status.text)
|
||||
chat_2_receiver_message.transaction_status.wait_for_element_text('Address requested')
|
||||
|
||||
home_2.just_fyi('Accept and share address for sender and receiver')
|
||||
for text in ('Accept and share address', 'Decline'):
|
||||
|
@ -108,12 +98,8 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
if not select_account_bottom_sheet.get_account_in_select_account_bottom_sheet_button('Status').is_element_displayed():
|
||||
self.errors.append('Not expected value in "From" in "Select account": "Status" is expected')
|
||||
select_account_bottom_sheet.select_button.click()
|
||||
if chat_2_receiver_message.transaction_status.text != "Shared 'Status account'":
|
||||
self.errors.append('Wrong state is shown for incoming transaction: "Shared \'Status account\' is expected, '
|
||||
'in fact %s ' % chat_2_receiver_message.transaction_status.text)
|
||||
if chat_1_sender_message.transaction_status.text != 'Address request accepted':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Address request accepted" is expected, '
|
||||
'in fact %s ' % chat_1_sender_message.transaction_status.text)
|
||||
chat_2_receiver_message.transaction_status.wait_for_element_text("Shared 'Status account'")
|
||||
chat_1_sender_message.transaction_status.wait_for_element_text('Address request accepted')
|
||||
|
||||
home_1.just_fyi("Sign and send transaction and check that timestamp on message is updated")
|
||||
time.sleep(40)
|
||||
|
@ -132,9 +118,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
wallet_1.home_button.click(desired_view="chat")
|
||||
|
||||
home_1.just_fyi("Check 'Confirmed' state for sender")
|
||||
if chat_1_sender_message.transaction_status.text != 'Confirmed':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Confirmed" is expected, in fact'
|
||||
' %s ' % chat_1_sender_message.transaction_status.text)
|
||||
chat_1_sender_message.transaction_status.wait_for_element_text('Confirmed')
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(6263)
|
||||
|
@ -190,9 +174,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
chat_2_sender_message = chat_2.chat_element_by_text('↑ 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')
|
||||
if chat_2_sender_message.transaction_status.text != 'Address received':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Address request accepted" is expected, '
|
||||
'in fact %s ' % chat_2_sender_message.transaction_status.text)
|
||||
chat_2_sender_message.transaction_status.wait_for_element_text('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)
|
||||
|
@ -202,9 +184,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, confirmations=15, token=True)
|
||||
chat_2.toggle_airplane_mode()
|
||||
chat_2.connection_status.wait_for_invisibility_of_element(30)
|
||||
if chat_2_sender_message.transaction_status.text != 'Confirmed':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Confirmed" is expected, in fact'
|
||||
' %s ' % chat_2_sender_message.transaction_status.text)
|
||||
chat_2_sender_message.transaction_status.wait_for_element_text('Confirmed')
|
||||
try:
|
||||
self.network_api.find_transaction_by_unique_amount(recipient_address[2:], amount, token=True)
|
||||
except Failed as e:
|
||||
|
@ -289,8 +269,4 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
|
|||
send_transaction.sign_transaction(default_gas_price=False)
|
||||
chat_sender_message = chat.chat_element_by_text('↑ Outgoing transaction')
|
||||
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, confirmations=15)
|
||||
if chat_sender_message.transaction_status.text != 'Confirmed':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction to ENS: "Confirmed" is expected, '
|
||||
'in fact %s ' % chat_sender_message.transaction_status.text)
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
chat_sender_message.transaction_status.wait_for_element_text('Confirmed')
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from _pytest.outcomes import Failed
|
||||
import time
|
||||
|
||||
from tests import marks
|
||||
|
@ -40,18 +39,14 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
chat_1_sender_message = chat_1.chat_element_by_text('↑ Outgoing transaction')
|
||||
if not chat_1_sender_message.is_element_displayed():
|
||||
self.driver.fail('No message is shown after sending ETH in 1-1 chat for sender')
|
||||
if chat_1_sender_message.transaction_status.text != 'Address requested':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Address requested" is expected, in fact'
|
||||
' %s ' % chat_1_sender_message.transaction_status.text)
|
||||
chat_1_sender_message.transaction_status.wait_for_element_text('Address requested')
|
||||
|
||||
chat_2 = home_2.get_chat(sender['username']).click()
|
||||
chat_2_receiver_message = chat_2.chat_element_by_text('↓ Incoming transaction')
|
||||
timestamp_sender = chat_1_sender_message.timestamp_message.text
|
||||
if not chat_2_receiver_message.is_element_displayed():
|
||||
self.driver.fail('No message about incoming transaction in 1-1 chat is shown for receiver')
|
||||
if chat_2_receiver_message.transaction_status.text != 'Address requested':
|
||||
self.errors.append('Wrong state is shown for incoming transaction: "Address requested" is expected, in fact'
|
||||
' %s' % chat_2_receiver_message.transaction_status.text)
|
||||
chat_2_receiver_message.transaction_status.wait_for_element_text('Address requested')
|
||||
|
||||
home_2.just_fyi('Accept and share address for sender and receiver')
|
||||
for text in ('Accept and share address', 'Decline'):
|
||||
|
@ -61,21 +56,15 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
if not select_account_bottom_sheet.get_account_in_select_account_bottom_sheet_button('Status').is_element_displayed():
|
||||
self.errors.append('Not expected value in "From" in "Select account": "Status" is expected')
|
||||
select_account_bottom_sheet.select_button.click()
|
||||
if chat_2_receiver_message.transaction_status.text != "Shared 'Status account'":
|
||||
self.errors.append('Wrong state is shown for incoming transaction: "Shared \'Status account\' is expected, '
|
||||
'in fact %s ' % chat_2_receiver_message.transaction_status.text)
|
||||
if chat_1_sender_message.transaction_status.text != 'Address request accepted':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Address request accepted" is expected, '
|
||||
'in fact %s ' % chat_1_sender_message.transaction_status.text)
|
||||
chat_2_receiver_message.transaction_status.wait_for_element_text("Shared 'Status account'")
|
||||
chat_1_sender_message.transaction_status.wait_for_element_text('Address request accepted')
|
||||
|
||||
home_1.just_fyi("Sign and send transaction and check that timestamp on message is updated")
|
||||
time.sleep(40)
|
||||
send_message = chat_1_sender_message.sign_and_send.click()
|
||||
send_message.next_button.click()
|
||||
send_message.sign_transaction(keycard=True, default_gas_price=False)
|
||||
if chat_1_sender_message.transaction_status.text != 'Pending':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Pending" is expected, in fact'
|
||||
' %s ' % chat_1_sender_message.transaction_status.text)
|
||||
chat_1_sender_message.transaction_status.wait_for_element_text('Pending')
|
||||
updated_timestamp_sender = chat_1_sender_message.timestamp_message.text
|
||||
if updated_timestamp_sender == timestamp_sender:
|
||||
self.errors.append("Timestamp of message is not updated after signing transaction")
|
||||
|
@ -88,9 +77,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
wallet_1.home_button.click(desired_view='chat')
|
||||
|
||||
home_1.just_fyi("Check 'Confirmed' state for sender")
|
||||
if chat_1_sender_message.transaction_status.text != 'Confirmed':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Confirmed" is expected, in fact'
|
||||
' %s ' % chat_1_sender_message.transaction_status.text)
|
||||
chat_1_sender_message.transaction_status.wait_for_element_text('Confirmed')
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(6294)
|
||||
|
@ -151,9 +138,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
chat_2_sender_message = chat_2.chat_element_by_text('↑ 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')
|
||||
if chat_2_sender_message.transaction_status.text != 'Address received':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Address request accepted" is expected, '
|
||||
'in fact %s ' % chat_2_sender_message.transaction_status.text)
|
||||
chat_2_sender_message.transaction_status.wait_for_element_text('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)
|
||||
|
@ -163,9 +148,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
|||
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True)
|
||||
chat_2.toggle_airplane_mode()
|
||||
chat_2.connection_status.wait_for_invisibility_of_element(60)
|
||||
if not chat_2.element_by_text('Confirmed').is_element_displayed(30):
|
||||
self.errors.append('Wrong state is shown for outgoing transaction: "Confirmed" is expected, in fact'
|
||||
' %s ' % chat_2_sender_message.transaction_status.text)
|
||||
chat_2_sender_message.transaction_status.wait_for_element_text('Confirmed')
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
|
||||
|
@ -192,8 +175,4 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
|
|||
send_transaction.sign_transaction(keycard=True)
|
||||
chat_sender_message = chat.chat_element_by_text('↑ Outgoing transaction')
|
||||
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, confirmations=15)
|
||||
if chat_sender_message.transaction_status.text != 'Confirmed':
|
||||
self.errors.append('Wrong state is shown for outgoing transaction to ENS: "Confirmed" is expected, '
|
||||
'in fact %s ' % chat_sender_message.transaction_status.text)
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
chat_sender_message.transaction_status.wait_for_element_text('Confirmed')
|
||||
|
|
|
@ -269,6 +269,19 @@ class BaseText(BaseElement):
|
|||
self.driver.info('%s is %s' % (self.name, text))
|
||||
return text
|
||||
|
||||
def wait_for_element_text(self, text, wait_time=30):
|
||||
counter = 0
|
||||
while True:
|
||||
if counter >= wait_time:
|
||||
self.driver.fail(
|
||||
"'%s' is not equal to expected '%s' in %s sec" % (self.find_element().text, text, wait_time))
|
||||
elif self.find_element().text != text:
|
||||
counter += 10
|
||||
time.sleep(10)
|
||||
self.driver.info('Wait for text element %s to be equal to %s' % (self.name, text))
|
||||
else:
|
||||
self.driver.info('Element %s text is equal to %s' % (self.name, text))
|
||||
return
|
||||
|
||||
class BaseButton(BaseElement):
|
||||
|
||||
|
|
Loading…
Reference in New Issue