3 e2e commands and skip e2e due to bug

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-04-02 12:30:20 +02:00
parent e5dbac877e
commit ff9cd359e9
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
7 changed files with 176 additions and 428 deletions

View File

@ -507,6 +507,8 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(5428)
@marks.low
@marks.skip
# TODO: skipped because of 10265
def test_version_format(self):
sign_in_view = SignInView(self.driver)
home_view = sign_in_view.create_user()

View File

@ -1,10 +1,8 @@
from _pytest.outcomes import Failed
from decimal import Decimal as d
from selenium.common.exceptions import TimeoutException
import time
from tests import marks, unique_password
from tests.users import transaction_senders, basic_user, transaction_recipients
from tests import marks
from tests.users import transaction_senders, transaction_recipients
from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase
from views.sign_in_view import SignInView
@ -13,66 +11,43 @@ from views.sign_in_view import SignInView
@marks.transaction
class TestCommandsMultipleDevices(MultipleDeviceTestCase):
@marks.testrail_id(5334)
@marks.critical
@marks.skip
# TODO: temporary skipped due to 8601
def test_network_mismatch_for_send_request_commands(self):
@marks.testrail_id(6257)
@marks.medium
def test_network_mismatch_for_send_request_in_1_1_chat(self):
sender = transaction_senders['D']
self.create_drivers(2)
device_1_sign_in, device_2_sign_in = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1_sign_in.recover_access(passphrase=sender['passphrase'])
device_2_sign_in.create_user()
device_1_home, device_2_home = device_1_sign_in.get_home_view(), device_2_sign_in.get_home_view()
home_1, home_2 = device_1_sign_in.get_home_view(), device_2_sign_in.get_home_view()
profile_2 = home_2.profile_button.click()
device_2_username = profile_2.default_username_text.text
profile_2.switch_network('Mainnet with upstream RPC')
device_1_wallet_view = device_1_home.wallet_button.click()
device_1_wallet_view.set_up_wallet()
device_1_wallet_view.home_button.click()
chat_2 = home_2.add_contact(sender['public_key'])
chat_2.send_message("Hey there!")
amount = chat_2.get_unique_amount()
public_key = device_2_home.get_public_key()
device_2_profile = device_2_home.get_profile_view()
device_2_profile.switch_network('Mainnet with upstream RPC')
chat_2.commands_button.click()
request_transaction = chat_2.request_command.click()
request_transaction.amount_edit_box.set_value(amount)
request_transaction.confirm()
request_transaction.request_transaction_button.click()
chat_2_request_message = chat_2.chat_element_by_text('↓ Incoming transaction')
device_1_chat = device_1_home.add_contact(public_key)
amount_1 = device_1_chat.get_unique_amount()
device_1_chat.send_transaction_in_1_1_chat('ETHro', amount_1, wallet_set_up=False)
device_1_chat.chat_element_by_text(amount_1).progress_bar.wait_for_invisibility_of_element()
status_text_1 = device_1_chat.chat_element_by_text(amount_1).status.text
if status_text_1 != 'Sent':
self.errors.append("Message about sent funds has status '%s' instead of 'Sent'" % status_text_1)
chat_1 = home_1.get_chat(device_2_username).click()
chat_1_sender_message = chat_1.chat_element_by_text('↑ Outgoing transaction')
send_message = chat_1_sender_message.sign_and_send.click()
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)
device_2_chat = device_2_home.get_chat(sender['username']).click()
chat_element_1 = device_2_chat.chat_element_by_text(amount_1)
try:
chat_element_1.wait_for_visibility_of_element(120)
chat_element_1.progress_bar.wait_for_invisibility_of_element()
if chat_element_1.status.text != 'Network mismatch':
self.errors.append("'Network mismatch' warning is not shown for send transaction message")
if not chat_element_1.contains_text('testnet'):
self.errors.append("Sent transaction message doesn't contain text 'testnet'")
except TimeoutException:
self.errors.append('Sent transaction message was not received')
device_2_chat.get_back_to_home_view()
if chat_2_request_message.transaction_status.text == 'Confirmed':
self.errors.append('Sent from Ropsten transaction is shown as confirmed!')
amount_2 = device_1_chat.get_unique_amount()
device_1_chat.request_transaction_in_1_1_chat('ETHro', amount_2)
status_text_2 = device_1_chat.chat_element_by_text(amount_2).status.text
if status_text_2 != 'Sent':
self.errors.append("Request funds message has status '%s' instead of 'Sent'" % status_text_2)
device_2_home.get_chat(sender['username']).click()
chat_element_2 = device_2_chat.chat_element_by_text(amount_2)
try:
chat_element_2.wait_for_visibility_of_element(120)
chat_element_2.progress_bar.wait_for_invisibility_of_element()
if chat_element_2.status.text != 'Network mismatch':
self.errors.append("'Network mismatch' warning is not shown for request funds message")
if not chat_element_2.contains_text('On testnet'):
self.errors.append("Request funds message doesn't contain text 'testnet'")
if not chat_element_2.contains_text('Transaction Request'):
self.errors.append("Request funds message doesn't contain text 'Transaction Request'")
except TimeoutException:
self.errors.append('Request funds message was not received')
self.errors.verify_no_errors()
@marks.testrail_id(6253)
@ -85,10 +60,9 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
home_1 = device_1.recover_access(passphrase=sender['passphrase'])
home_2 = device_2.recover_access(passphrase=recipient['passphrase'])
wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click()
wallet_1.set_up_wallet()
wallet_1.home_button.click()
wallet_2.set_up_wallet()
wallet_2.home_button.click()
for wallet in (wallet_1, wallet_2):
wallet.set_up_wallet()
wallet.home_button.click()
chat_1 = home_1.add_contact(recipient['public_key'])
amount = chat_1.get_unique_amount()
@ -160,380 +134,151 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
' %s ' % chat_1_sender_message.transaction_status.text)
self.errors.verify_no_errors()
@marks.testrail_id(5318)
@marks.testrail_id(6263)
@marks.critical
@marks.skip
# TODO: temporary skipped due to 8601
def test_request_and_receive_eth_in_1_1_chat(self):
recipient = transaction_recipients['B']
sender = transaction_senders['J']
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1 = device_1.recover_access(passphrase=sender['passphrase'])
home_2 = device_2.recover_access(passphrase=recipient['passphrase'])
wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click()
wallet_1.set_up_wallet()
wallet_1.home_button.click()
wallet_2.set_up_wallet()
init_balance = wallet_2.get_asset_amount_by_name('ETHro')
wallet_2.home_button.click()
chat_2 = home_2.add_contact(sender['public_key'])
amount = chat_2.get_unique_amount()
chat_2.request_transaction_in_1_1_chat('ETHro', amount)
chat_1 = home_1.get_chat(recipient['username']).click()
chat_1.send_funds_to_request(amount=amount)
if not chat_1.chat_element_by_text(amount).is_element_displayed():
self.errors.append('Message with the sent amount is not shown for the sender')
if not chat_2.chat_element_by_text(amount).is_element_displayed():
self.errors.append('Message with the sent amount is not shown for the recipient')
chat_2.get_back_to_home_view()
home_2.wallet_button.click()
try:
wallet_2.wait_balance_is_equal_expected_amount('ETHro', expected_balance=init_balance + float(amount))
self.network_api.find_transaction_by_unique_amount(recipient['address'], amount)
except Failed as e:
self.errors.append(e.msg)
self.errors.verify_no_errors()
@marks.testrail_id(5324)
@marks.critical
@marks.skip
# TODO: temporary skipped due to 8601
def test_request_eth_in_wallet(self):
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
sender = transaction_senders['O']
home_1 = device_1.create_user()
profile_1 = home_1.profile_button.click()
default_username_1 = profile_1.default_username_text.text
home_1 = profile_1.get_back_to_home_view()
home_2 = device_2.recover_access(passphrase=sender['passphrase'])
home_1.add_contact(sender['public_key'])
home_1.get_back_to_home_view()
wallet_1 = home_1.wallet_button.click()
wallet_1.set_up_wallet()
wallet_1.accounts_status_account.click()
send_transaction_device_1 = wallet_1.receive_transaction_button.click_until_presence_of_element(
wallet_1.send_transaction_request)
wallet_1.send_transaction_request.click()
send_transaction_device_1.amount_edit_box.scroll_to_element()
amount = home_1.get_unique_amount()
send_transaction_device_1.amount_edit_box.set_value(amount)
send_transaction_device_1.confirm()
send_transaction_device_1.chose_recipient_button.click()
sender_button = send_transaction_device_1.element_by_text(sender['username'])
send_transaction_device_1.recent_recipients_button.click_until_presence_of_element(sender_button)
sender_button.click()
wallet_1.send_request_button.click()
chat_2 = home_2.get_chat(default_username_1).click()
chat_element = chat_2.chat_element_by_text(amount)
try:
chat_element.wait_for_visibility_of_element(120)
if not chat_element.contains_text('Transaction Request'):
self.errors.append("Request funds message doesn't contain text 'Transaction Request'")
if not chat_element.send_request_button.is_element_displayed():
self.errors.append("Request funds message doesn't contain 'Send' button")
except TimeoutException:
self.errors.append('Request funds message was not received')
self.errors.verify_no_errors()
@marks.testrail_id(5383)
@marks.high
@marks.skip
# TODO: temporary skipped due to 8601
def test_contact_profile_send_transaction(self):
self.create_drivers(1)
recipient = basic_user
sign_in_view = SignInView(self.drivers[0])
sign_in_view.create_user()
home_view = sign_in_view.get_home_view()
sender_public_key = home_view.get_public_key()
sender_address = home_view.public_key_to_address(sender_public_key)
home_view.home_button.click()
self.network_api.get_donate(sender_address)
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
home_view.home_button.click()
home_view.add_contact(recipient['public_key'])
chat_view = home_view.get_chat_view()
chat_view.chat_options.click_until_presence_of_element(chat_view.view_profile_button)
chat_view.view_profile_button.click()
chat_view.profile_send_transaction.click()
chat_view.chat_message_input.click()
chat_view.asset_by_name('ETHro').click()
amount = chat_view.get_unique_amount()
chat_view.send_as_keyevent(amount)
chat_view.send_message_button.click()
send_transaction_view = chat_view.get_send_transaction_view()
send_transaction_view.sign_transaction()
self.network_api.find_transaction_by_unique_amount(recipient['address'], amount)
@marks.testrail_id(5348)
@marks.critical
@marks.skip
# TODO: temporary skipped due to 8601
def test_send_tokens_in_1_1_chat(self):
def test_request_and_receive_stt_in_1_1_chat_offline(self):
recipient = transaction_recipients['C']
sender = transaction_senders['C']
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1 = device_1.recover_access(passphrase=sender['passphrase'])
home_2 = device_2.recover_access(passphrase=recipient['passphrase'])
wallet_1 = home_1.wallet_button.click()
home_1 = device_1.recover_access(passphrase=recipient['passphrase'])
home_2 = device_2.recover_access(passphrase=sender['passphrase'])
wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click()
wallet_1.set_up_wallet()
wallet_1.home_button.click()
wallet_2.set_up_wallet()
chat_1 = home_1.add_contact(recipient['public_key'])
chat_1 = home_1.add_contact(sender['public_key'])
chat_1.send_message("Hey there!")
amount = chat_1.get_unique_amount()
chat_1.send_transaction_in_1_1_chat('STT', amount)
asset_name = 'STT'
message_1 = chat_1.chat_element_by_text(amount)
if not message_1.is_element_displayed() or not message_1.contains_text('STT'):
self.errors.append('Message with the sent amount is not shown for the sender')
chat_2 = home_2.get_chat(sender['username']).click()
message_2 = chat_2.chat_element_by_text(amount)
if not message_2.is_element_displayed() or not message_2.contains_text('STT'):
self.errors.append('Message with the sent amount is not shown for the recipient')
wallet_2.home_button.click()
chat_element = home_2.get_chat(recipient['username'])
chat_element.wait_for_visibility_of_element(30)
chat_2 = chat_element.click()
profile_2 = wallet_2.profile_button.click()
profile_2.logout()
home_1.just_fyi('Request %s STT in 1-1 chat and check it is visible for sender and receiver' % amount)
chat_1.commands_button.click()
request_transaction = chat_1.request_command.click()
request_transaction.amount_edit_box.set_value(amount)
request_transaction.confirm()
asset_button = request_transaction.asset_by_name(asset_name)
request_transaction.select_asset_button.click_until_presence_of_element(asset_button)
asset_button.click()
request_transaction.request_transaction_button.click()
chat_1_request_message = chat_1.chat_element_by_text('↓ Incoming transaction')
if not chat_1_request_message.is_element_displayed():
self.driver.fail('No incoming transaction in 1-1 chat is shown for recipient after requesting STT')
home_2.just_fyi('Check that transaction message is fetched from offline and sign transaction')
device_2.sign_in()
home_2.connection_status.wait_for_invisibility_of_element(30)
home_2.get_chat(recipient['username']).click()
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)
send_message = chat_2_sender_message.sign_and_send.click()
send_message.next_button.click()
send_message.sign_transaction()
home_2.just_fyi('Check that transaction message is updated with new status after offline')
chat_2.toggle_airplane_mode()
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, confirmations=15, token=True)
chat_2.toggle_airplane_mode()
home_1.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)
try:
self.network_api.find_transaction_by_unique_amount(recipient['address'], amount, token=True)
except Failed as e:
self.errors.append(e.msg)
self.errors.verify_no_errors()
@marks.testrail_id(5352)
@marks.testrail_id(6265)
@marks.critical
@marks.skip
# TODO: temporary skipped due to 8601
def test_request_and_receive_tokens_in_1_1_chat(self):
recipient = transaction_recipients['D']
def test_decline_transactions_in_1_1_chat(self):
recipient = transaction_recipients['B']
sender = transaction_senders['B']
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1 = device_1.recover_access(passphrase=sender['passphrase'])
home_2 = device_2.recover_access(passphrase=recipient['passphrase'])
wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click()
wallet_1.set_up_wallet()
wallet_1.home_button.click()
wallet_2.set_up_wallet()
wallet_2.home_button.click()
chat_2 = home_2.add_contact(sender['public_key'])
amount = chat_2.get_unique_amount()
chat_2.request_transaction_in_1_1_chat('STT', amount)
chat_1 = home_1.get_chat(recipient['username']).click()
chat_1.send_funds_to_request(amount=amount)
message_1 = chat_1.chat_element_by_text(amount)
if not message_1.is_element_displayed() or not message_1.contains_text('STT'):
self.errors.append('Message with the sent amount is not shown for the sender')
message_2 = chat_2.chat_element_by_text(amount)
if not message_2.is_element_displayed() or not message_2.contains_text('STT'):
self.errors.append('Message with the sent amount is not shown for the recipient')
try:
self.network_api.find_transaction_by_unique_amount(recipient['address'], amount, token=True)
except Failed as e:
self.errors.append(e.msg)
self.errors.verify_no_errors()
@marks.testrail_id(5376)
@marks.high
@marks.skip
# TODO: temporary skipped due to 8601
def test_transaction_confirmed_on_recipient_side(self):
recipient = transaction_recipients['E']
sender = transaction_senders['E']
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1 = device_1.recover_access(passphrase=sender['passphrase'])
home_2 = device_2.recover_access(passphrase=recipient['passphrase'])
wallet_1 = home_1.wallet_button.click()
wallet_1.set_up_wallet()
wallet_1.home_button.click()
for wallet in wallet_1, wallet_2:
wallet.set_up_wallet()
wallet.home_button.click()
chat_1 = home_1.add_contact(recipient['public_key'])
amount = chat_1.get_unique_amount()
chat_1.send_transaction_in_1_1_chat('ETHro', amount)
home_1.just_fyi('Decline transaction before sharing address and check that state is changed')
chat_1.commands_button.click()
send_transaction = chat_1.send_command.click()
send_transaction.amount_edit_box.set_value(amount)
send_transaction.confirm()
send_transaction.sign_transaction_button.click()
chat_1_sender_message = chat_1.chat_element_by_text('↑ Outgoing transaction')
chat_2 = home_2.get_chat(sender['username']).click()
self.network_api.wait_for_confirmation_of_transaction(recipient['address'], amount)
if not chat_2.chat_element_by_text(amount).contains_text('Confirmed', 60):
chat_2.driver.fail('Status "Confirmed" is not shown under transaction for the recipient')
chat_2_receiver_message = chat_2.chat_element_by_text('↓ Incoming transaction')
chat_2_receiver_message.decline_transaction.click()
for status in chat_2_receiver_message.transaction_status.text, chat_1_sender_message.transaction_status.text:
if status != 'Transaction declined':
self.errors.append('Wrong state is shown: "Transaction declined" is expected, in fact'
' %s ' % status)
home_1.just_fyi('Decline transaction request and check that state is changed')
chat_1.commands_button.click()
request_amount = chat_1.get_unique_amount()
request_transaction = chat_1.request_command.click()
request_transaction.amount_edit_box.set_value(request_amount)
request_transaction.confirm()
request_transaction.request_transaction_button.click()
chat_1_request_message = chat_1.chat_element_by_text('↓ Incoming transaction')
chat_2_sender_message = chat_2.chat_element_by_text('↑ Outgoing transaction')
chat_2_sender_message.decline_transaction.click()
for status in chat_2_sender_message.transaction_status.text, chat_1_request_message.transaction_status.text:
if status != 'Transaction declined':
self.errors.append('Wrong state is shown: "Transaction declined" is expected, in fact'
' %s ' % status)
self.errors.verify_no_errors()
@marks.chat
@marks.transaction
class TestCommandsSingleDevices(SingleDeviceTestCase):
@marks.testrail_id(5349)
@marks.testrail_id(6279)
@marks.high
@marks.skip
# TODO: temporary skipped due to 8601
def test_send_request_not_enabled_tokens(self):
def test_send_eth_to_ens(self):
sign_in = SignInView(self.driver)
home = sign_in.create_user()
chat = home.add_contact(basic_user['public_key'])
sender = transaction_senders['E']
home = sign_in.recover_access(sender['passphrase'])
chat = home.add_contact('nastya')
chat.commands_button.click()
chat.send_command.click()
if chat.asset_by_name('MDS').is_element_displayed():
self.errors.append('Token which is not enabled in wallet can be sent in 1-1 chat')
chat.chat_message_input.clear()
chat.commands_button.click()
chat.request_command.click()
if chat.asset_by_name('MDS').is_element_displayed():
self.errors.append('Token which is not enabled in wallet can be requested in 1-1 chat')
self.errors.verify_no_errors()
@marks.logcat
@marks.testrail_id(5417)
@marks.critical
@marks.skip
# TODO: temporary skipped due to 8601
def test_logcat_send_transaction_in_1_1_chat(self):
sender = transaction_senders['F']
sign_in = SignInView(self.driver)
home = sign_in.recover_access(passphrase=sender['passphrase'], password=unique_password)
wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.home_button.click()
chat = home.add_contact(basic_user['public_key'])
amount = chat.get_unique_amount()
chat.send_transaction_in_1_1_chat('ETHro', amount, unique_password)
values_in_logcat = chat.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)
@marks.testrail_id(5347)
@marks.high
@marks.skip
# TODO: temporary skipped due to 8601
def test_send_transaction_details_in_1_1_chat(self):
recipient = basic_user
sender = transaction_senders['G']
sign_in = SignInView(self.driver)
home = sign_in.recover_access(passphrase=sender['passphrase'])
wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.home_button.click()
send_message = chat.send_command.click()
send_message.amount_edit_box.set_value(amount)
send_message.confirm()
send_message.next_button.click()
chat = home.add_contact(recipient['public_key'])
amount = chat.get_unique_amount()
chat.commands_button.click()
chat.send_command.click()
chat.asset_by_name('ETHro').click()
chat.send_as_keyevent(amount)
send_transaction_view = chat.get_send_transaction_view()
chat.send_message_button.click_until_presence_of_element(send_transaction_view.sign_with_password)
from views.send_transaction_view import SendTransactionView
send_transaction = SendTransactionView(self.driver)
send_transaction.sign_transaction()
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)
# if not send_transaction_view.element_by_text(recipient['username']).is_element_displayed():
# self.errors.append('Recipient name is not shown')
if not send_transaction_view.element_by_text_part('ETHro').is_element_displayed():
self.errors.append("Asset field doesn't contain 'ETHro' text")
if not send_transaction_view.element_by_text_part(amount).is_element_displayed():
self.errors.append('Amount is not visible')
self.errors.verify_no_errors()
@marks.testrail_id(5377)
@marks.high
@marks.skip
# TODO: temporary skipped due to 8601
def test_transaction_confirmed_on_sender_side(self):
sender = transaction_senders['H']
sign_in = SignInView(self.driver)
home = sign_in.recover_access(passphrase=sender['passphrase'])
wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.home_button.click()
chat = home.add_contact(basic_user['public_key'])
amount = chat.get_unique_amount()
chat.send_transaction_in_1_1_chat('ETHro', amount)
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount)
if not chat.chat_element_by_text(amount).contains_text('Confirmed', wait_time=90):
self.driver.fail('Status "Confirmed" is not shown under transaction for the sender')
@marks.testrail_id(5410)
@marks.high
@marks.skip
# TODO: temporary skipped due to 8601
def test_insufficient_funds_1_1_chat_0_balance(self):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user()
wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
home_view = wallet_view.home_button.click()
chat_view = home_view.add_contact(basic_user['public_key'])
chat_view.commands_button.click()
chat_view.send_command.click()
chat_view.asset_by_name('ETHro').click()
chat_view.send_as_keyevent('1')
chat_view.send_message_button.click()
send_transaction = chat_view.get_send_transaction_view()
error_text = send_transaction.element_by_text('Insufficient funds')
if not error_text.is_element_displayed():
self.errors.append("'Insufficient funds' error is now shown when sending 1 ETH from chat with balance 0")
send_transaction.cancel_button.click()
chat_view.commands_button.click()
# enable STT in wallet
chat_view.wallet_button.click()
wallet_view.select_asset("STT")
wallet_view.home_button.click()
chat_view.send_command.click()
chat_view.asset_by_name('STT').click()
chat_view.send_as_keyevent('1')
chat_view.send_message_button.click()
if not error_text.is_element_displayed():
self.errors.append("'Insufficient funds' error is now shown when sending 1 STT from chat with balance 0")
self.errors.verify_no_errors()
@marks.testrail_id(5473)
@marks.medium
@marks.skip
# TODO: temporary skipped due to 8601
def test_insufficient_funds_1_1_chat_positive_balance(self):
sender = transaction_senders['I']
sign_in_view = SignInView(self.driver)
sign_in_view.recover_access(sender['passphrase'])
wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.accounts_status_account.click()
eth_value = wallet_view.get_asset_amount_by_name('ETHro')
stt_value = wallet_view.get_asset_amount_by_name('STT')
if eth_value == 0 or stt_value == 0:
self.driver.fail('No funds!')
home_view = wallet_view.home_button.click()
chat_view = home_view.add_contact(basic_user['public_key'])
chat_view.commands_button.click()
chat_view.send_command.click()
chat_view.asset_by_name('ETHro').click()
chat_view.send_as_keyevent(str(round(eth_value + 1)))
chat_view.send_message_button.click()
send_transaction = chat_view.get_send_transaction_view()
error_text = send_transaction.element_by_text('Insufficient funds')
if not error_text.is_element_displayed():
self.errors.append(
"'Insufficient funds' error is now shown when sending %s ETHro from chat with balance %s" % (
round(eth_value + 1), eth_value))
send_transaction.cancel_button.click_until_presence_of_element(chat_view.commands_button)
chat_view.commands_button.click()
chat_view.send_command.click()
chat_view.asset_by_name('STT').scroll_to_element()
chat_view.asset_by_name('STT').click()
chat_view.send_as_keyevent(str(round(stt_value + 1)))
chat_view.send_message_button.click()
if not error_text.is_element_displayed():
self.errors.append(
"'Insufficient funds' error is now shown when sending %s STT from chat with balance %s" % (
round(stt_value + 1), stt_value))
self.errors.verify_no_errors()

View File

@ -78,7 +78,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click()
stt_button = send_transaction.asset_by_name('STT')
send_transaction.select_asset_button.click_until_presence_of_element(stt_button, 5)
send_transaction.select_asset_button.click_until_presence_of_element(send_transaction.eth_asset_in_select_asset_bottom_sheet_button, 5)
stt_button.click()
send_transaction.amount_edit_box.click()
amount = send_transaction.get_unique_amount()
@ -239,7 +239,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click()
adi_button = send_transaction.asset_by_name('ADI')
send_transaction.select_asset_button.click_until_presence_of_element(adi_button)
send_transaction.select_asset_button.click_until_presence_of_element(send_transaction.eth_asset_in_select_asset_bottom_sheet_button)
adi_button.click()
send_transaction.amount_edit_box.click()
amount = '0.0%s' % str(random.randint(10000, 99999)) + '1'
@ -264,7 +264,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click()
adi_button = send_transaction.asset_by_name('ADI')
send_transaction.select_asset_button.click_until_presence_of_element(adi_button)
send_transaction.select_asset_button.click_until_presence_of_element(send_transaction.eth_asset_in_select_asset_bottom_sheet_button)
adi_button.click()
send_transaction.amount_edit_box.click()
amount = '0.0%s' % str(random.randint(100000, 999999)) + '1'

View File

@ -120,8 +120,7 @@ transaction_senders['D']['public_key'] = "0x044764a9ba22bb4ae355619ca3824ee66b9f
"d0dd570471986c229c077c8053ee47784416eb6604d52e41f8f9d566ef8"
transaction_senders['E'] = dict()
transaction_senders['E']['passphrase'] = \
"sea ill guard bounce gesture tomato walnut fitness plastic affair oven transfer"
transaction_senders['E']['passphrase'] = "sea ill guard bounce gesture tomato walnut fitness plastic affair oven transfer"
transaction_senders['E']['username'] = "Fatal Metallic Imperialeagle"
transaction_senders['E']['address'] = "f7cb60839c0de25e37be0391c33bb34a8f0f8414"
transaction_senders['E']['public_key'] = "0x04db6128352e5c2d05ee5a6556848453cf3a7af34e94b3e20a302de684e9906461e38adf" \
@ -154,14 +153,6 @@ transaction_senders['I']['username'] = "Finished Infatuated Whiteeye"
transaction_senders['I']['address'] = "0887afe0ee3e1b195f596350bb04bba034514af9"
transaction_senders['I']['public_key'] = "0x04e61e616f881383e807cd1fb714fa2e06b5ad1cb6cd7b97a9265da2ad9a133ee750954a" \
"6c4da3635f2e406b310f6e294ca94ea3a686287a1276e4e86612886f8e"
transaction_senders['J'] = dict()
transaction_senders['J']['passphrase'] = "shrug during breeze mercy install net reopen uniform atom guilt sadness elite"
transaction_senders['J']['username'] = "Outrageous Knotty Shearwater"
transaction_senders['J']['address'] = "ad0f319ca0cfa051f625ad1a3fc6bf0cbad45b24"
transaction_senders['J']['public_key'] = "0x04fedbb6114918babbdabdc7bd5cb5f3aaa13f4bd5df5c27c2b2adfc91dffae15f75bf9f" \
"0e9bb747ef1996b63260f40dee1e00f62b061d95c6878b8c5ecfb33835"
transaction_senders['K'] = dict()
transaction_senders['K']['passphrase'] = "fly west avoid depend tape direct foster off cry crucial blame elegant"
transaction_senders['K']['username'] = "Decimal Healthy Harpyeagle"

View File

@ -288,7 +288,7 @@ class AssetButton(BaseButton):
def __init__(self, driver, asset_name):
super(AssetButton, self).__init__(driver)
self.asset_name = asset_name
self.locator = self.Locator.xpath_selector('(//*[@content-desc=":' + self.asset_name + '-asset-value"])[2]')
self.locator = self.Locator.xpath_selector('(//*[@content-desc=":' + self.asset_name + '-asset-value"])[last()]')
@property
def name(self):

View File

@ -88,7 +88,11 @@ class SendCommand(BaseButton):
class RequestCommand(BaseButton):
def __init__(self, driver):
super(RequestCommand, self).__init__(driver)
self.locator = self.Locator.accessibility_id('request-button')
self.locator = self.Locator.text_selector('Request transaction')
def navigate(self):
from views.send_transaction_view import SendTransactionView
return SendTransactionView(self.driver)
def click(self):
self.wait_for_element().click()
@ -397,6 +401,20 @@ class ChatElementByText(BaseText):
return AcceptAndShareAddress(self.driver, self.locator.value)
@property
def decline_transaction(self):
class DeclineTransaction(BaseButton):
def __init__(self, driver, parent_locator):
super(DeclineTransaction, self).__init__(driver)
self.locator = self.Locator.xpath_selector(parent_locator + "//*[@text='Decline']")
def click(self):
self.wait_for_element().click()
self.driver.info('Tap on %s' % self.name)
return self.navigate()
return DeclineTransaction(self.driver, self.locator.value)
@property
def sign_and_send(self):
class SignAndSend(BaseButton):
@ -565,27 +583,6 @@ class ChatView(BaseView):
self.clear_button.click()
self.back_button.click()
def send_transaction_in_1_1_chat(self, asset, amount, password=common_password, wallet_set_up=False, **kwargs):
self.commands_button.click()
self.send_command.click()
self.asset_by_name(asset).click()
self.send_as_keyevent(amount)
send_transaction_view = self.get_send_transaction_view()
if wallet_set_up:
wallet_view = self.get_wallet_view()
self.send_message_button.click_until_presence_of_element(wallet_view.sign_in_phrase)
wallet_view.done_button.click()
wallet_view.yes_button.click()
else:
self.send_message_button.click_until_presence_of_element(send_transaction_view.sign_with_password)
if kwargs.get('sign_transaction', True):
send_transaction_view.sign_transaction(password)
chat_elem = self.chat_element_by_text(amount)
chat_elem.wait_for_visibility_of_element()
chat_elem.progress_bar.wait_for_invisibility_of_element(20)
if chat_elem.status.text not in ('Sent', 'Delivered', 'Seen'):
self.driver.fail('Sent transaction message was not sent')
def send_transaction_in_group_chat(self, amount, password, recipient):
self.commands_button.click()
self.send_command.click()

View File

@ -152,6 +152,11 @@ class TotalFeeInput(BaseText):
super(TotalFeeInput, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='Total Fee']/following-sibling::android.widget.TextView")
class ETHroAssetButtonInSelectAssetBottomSheet(BaseButton):
def __init__(self, driver):
super(ETHroAssetButtonInSelectAssetBottomSheet, self).__init__(driver)
self.locator = self.Locator.xpath_selector('(//*[@content-desc=":ETH-asset-value"])[2]')
class UpdateFeeButton(BaseButton):
def __init__(self, driver):
@ -225,6 +230,12 @@ class SelectButton(BaseButton):
super(SelectButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('select-account-bottom-sheet')
class RequestTransactionButtonBottomSheet(BaseButton):
def __init__(self, driver):
super(RequestTransactionButtonBottomSheet, self).__init__(driver)
self.locator = self.Locator.accessibility_id('request-transaction-bottom-sheet')
class SendTransactionView(BaseView):
def __init__(self, driver):
super(SendTransactionView, self).__init__(driver)
@ -264,9 +275,11 @@ class SendTransactionView(BaseView):
self.onboarding_message = OnboardingMessage(self.driver)
self.validation_warnings = ValidationWarnings(self.driver)
self.eth_asset_in_select_asset_bottom_sheet_button = ETHroAssetButtonInSelectAssetBottomSheet(self.driver)
# Elements for commands in 1-1 chat
self.select_button = SelectButton(self.driver)
self.request_transaction_button = RequestTransactionButtonBottomSheet(self.driver)
def complete_onboarding(self):
if self.onboarding_message.is_element_displayed():