e2e wallet fixes

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-09-17 15:14:55 +02:00 committed by andrey
parent 25dbf1fd61
commit 6454df4734
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
10 changed files with 76 additions and 138 deletions

View File

@ -60,7 +60,7 @@ class TestCreateAccount(SingleDeviceTestCase):
self.errors.append("'%s' text is not shown" % text)
for chat in ('#status', '#crypto'):
sign_in.element_by_text(chat).click()
sign_in.back_button.click()
sign_in.back_button.click_until_presence_of_element(home_view.search_chat_input)
profile_view = home_view.profile_button.click()
shown_username = profile_view.default_username_text.text
if shown_username != username:

View File

@ -968,11 +968,10 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
device_1_home.add_contact(transaction_senders['A']['public_key'])
device_2.just_fyi('check that messages appeared in 1-1 chat, public chats and new contacts are synced')
# TODO: blocked by 9805
# if not device_2_profile.element_by_text(transaction_senders['A']['username']).is_element_displayed(60):
# self.errors.append(
# '"%s" is not found in Contacts after adding when devices are paired' % transaction_senders['A'][
# 'username'])
if not device_2_profile.element_by_text(transaction_senders['A']['username']).is_element_displayed(60):
self.errors.append(
'"%s" is not found in Contacts after adding when devices are paired' % transaction_senders['A'][
'username'])
device_2_profile.home_button.click()
if not device_2_home.element_by_text_part(public_chat_before_sync).is_element_displayed():

View File

@ -32,11 +32,7 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click()
send_transaction.amount_edit_box.set_value('0')
send_transaction.confirm()
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(basic_user['address'])
send_transaction.done_button.click()
send_transaction.set_recipient_address('0x%s' % basic_user['address'])
send_transaction.sign_transaction_button.click()
for text in texts:
if not wallet.element_by_text_part(text).is_element_displayed():
@ -411,29 +407,20 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet.set_up_wallet()
wallet.accounts_status_account.click()
send_transaction = wallet.send_transaction_button.click()
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value('%s.stateofus.eth' % ens_user['ens'])
send_transaction.done_button.click()
send_transaction.set_recipient_address('%s.stateofus.eth' % ens_user['ens'])
formatted_ens_user_address = send_transaction.get_formatted_recipient_address(ens_user['address'])
if send_transaction.enter_recipient_address_text.text != formatted_ens_user_address:
self.errors.append('ENS address on stateofus.eth is not resolved as recipient')
wallet.just_fyi('checking that ".eth" name will be resolved as recipient')
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(ens_user['ens_another_domain'])
send_transaction.done_button.click()
send_transaction.set_recipient_address(ens_user['ens_another_domain'])
if send_transaction.enter_recipient_address_text.text != formatted_ens_user_address:
self.errors.append('ENS address on another domain is not resolved as recipient')
wallet.just_fyi('checking that "stateofus.eth" name without domain will be resolved as recipient')
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(ens_user['ens'])
send_transaction.done_button.click()
send_transaction.set_recipient_address(ens_user['ens'])
if send_transaction.enter_recipient_address_text.text != formatted_ens_user_address:
self.errors.append('ENS address "stateofus.eth" without domain is not resolved as recipient')

View File

@ -331,7 +331,7 @@ class TestChatManagement(SingleDeviceTestCase):
send_transaction.deny_button.click()
send_transaction.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
send_transaction.ok_button.click()
wallet.back_button.click()
wallet.back_button.click_until_absense_of_element(wallet.back_button)
home.just_fyi("Allow access to camera in universal qr code scanner and check it in other views")
wallet.home_button.click()

View File

@ -237,8 +237,9 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
chat_1_sender_message = chat_1.chat_element_by_text('↑ Outgoing transaction')
home_1.click_system_home_button()
chat_2 = home_2.get_chat(sender['username']).click()
from views.chat_view import ChatView
chat = ChatView(self.drivers[1])
chat_2 = home_2.get_chat(sender['username']).click_until_presence_of_element(chat.chat_message_input)
chat_2_receiver_message = chat_2.chat_element_by_text('↓ Incoming transaction')
chat_2_receiver_message.decline_transaction.click()
home_1.open_notification_bar()

View File

@ -941,7 +941,7 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
if difference_in_data:
self.errors.append(
'In %s case returned value does not match expected in %s' % (key, repr(difference_in_data)))
send_transaction_view.cancel_button.click()
send_transaction_view.back_button.click()
if 'dapp' in key:
home_view.open_in_status_button.click()
if not chat_view.allow_button.is_element_displayed():

View File

@ -18,27 +18,19 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click()
send_transaction.amount_edit_box.click()
transaction_amount = send_transaction.get_unique_amount()
send_transaction.amount_edit_box.set_value(transaction_amount)
send_transaction.confirm()
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.just_fyi('Send transaction')
send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction(keycard=True)
transaction_amount = wallet_view.get_unique_amount()
wallet_view.send_transaction(amount=transaction_amount,
sign_transaction=True,
keycard=True,
recipient='0x%s'%recipient['address'])
self.network_api.find_transaction_by_unique_amount(sender['address'], transaction_amount)
send_transaction.just_fyi('Check that transaction is appeared in transaction history')
wallet_view.just_fyi('Check that transaction is appeared in transaction history')
transactions_view = wallet_view.transaction_history_button.click()
transactions_view.transactions_table.find_transaction(amount=transaction_amount)
transactions_view.just_fyi('Check logcat for sensitive data')
values_in_logcat = send_transaction.find_values_in_logcat(pin=pin, puk=puk, password=pair_code)
values_in_logcat = wallet_view.find_values_in_logcat(pin=pin, puk=puk, password=pair_code)
if values_in_logcat:
self.driver.fail(values_in_logcat)

View File

@ -22,27 +22,18 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click()
send_transaction.amount_edit_box.click()
transaction_amount = send_transaction.get_unique_amount()
send_transaction.amount_edit_box.set_value(transaction_amount)
send_transaction.confirm()
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
transaction_amount = wallet_view.get_unique_amount()
wallet_view.send_transaction(amount=transaction_amount,
sign_transaction=True,
recipient='0x%s' % recipient['address'],
sender_password=unique_password )
send_transaction.just_fyi('Send transaction')
send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction(unique_password)
self.network_api.find_transaction_by_unique_amount(sender['address'], transaction_amount)
send_transaction.just_fyi('Check that transaction is appeared in transaction history')
wallet_view.just_fyi('Check that transaction is appeared in transaction history')
transactions_view = wallet_view.transaction_history_button.click()
transactions_view.transactions_table.find_transaction(amount=transaction_amount)
transactions_view.just_fyi('Check logcat for sensitive data')
values_in_logcat = send_transaction.find_values_in_logcat(password=unique_password)
wallet_view.just_fyi('Check logcat for sensitive data')
values_in_logcat = wallet_view.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)
@ -62,11 +53,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.amount_edit_box.click()
transaction_amount = send_transaction.get_unique_amount()
send_transaction.amount_edit_box.set_value(transaction_amount)
send_transaction.confirm()
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click()
send_transaction.set_recipient_address('0x%s' % recipient['address'])
send_transaction.sign_transaction_button.click()
send_transaction.sign_with_password.click_until_presence_of_element(send_transaction.enter_password_input)
send_transaction.enter_password_input.click()
@ -112,8 +99,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
transactions_view = wallet_view.transaction_history_button.click()
transactions_view.transactions_table.find_transaction(amount=sending_amount, asset='STT')
@marks.testrail_id(5461)
@marks.medium
def test_send_eth_from_wallet_incorrect_address(self):
@ -129,17 +114,13 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.amount_edit_box.click()
transaction_amount = send_transaction.get_unique_amount()
send_transaction.amount_edit_box.set_value(transaction_amount)
send_transaction.confirm()
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(recipient['public_key'])
send_transaction.done_button.click_until_presence_of_element(send_transaction.element_by_text_part('Invalid address'))
send_transaction.ok_button.click()
send_transaction.enter_recipient_address_input.set_value('0xDE709F2102306220921060314715629080E2fB77')
send_transaction.done_button.click_until_presence_of_element(send_transaction.element_by_text_part('Invalid address'))
send_transaction.ok_button.click()
self.errors.verify_no_errors()
for address in (recipient['public_key'], '0xDE709F2102306220921060314715629080E2fB77'):
send_transaction.enter_recipient_address_input.set_value(address)
send_transaction.enter_recipient_address_input.click()
send_transaction.done_button.click()
if send_transaction.set_max_button.is_element_displayed():
self.driver.fail('Can proceed with wrong address %s in recipient' % address)
@marks.testrail_id(5350)
@marks.critical
@ -152,20 +133,10 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
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(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'
send_transaction.amount_edit_box.set_value(amount)
send_transaction.confirm()
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction()
wallet_view.send_transaction(amount=amount,
recipient='0x%s' % recipient['address'],
asset_name='ADI')
self.network_api.find_transaction_by_unique_amount(recipient['address'], amount, token=True, decimals=7)
@ -253,10 +224,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.toggle_airplane_mode()
wallet_view.accounts_status_account.click_until_presence_of_element(wallet_view.send_transaction_button)
send_transaction = wallet_view.send_transaction_button.click()
send_transaction.chose_recipient_button.click()
send_transaction.accounts_button.click()
send_transaction.element_by_text("Status account").click()
send_transaction.amount_edit_box.click()
send_transaction.set_recipient_address('0x%s' % basic_user['address'])
send_transaction.amount_edit_box.set_value("0")
send_transaction.confirm()
send_transaction.sign_transaction_button.click()
@ -468,7 +436,10 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
if not wallet_view.element_by_text_part(error).is_element_displayed():
self.errors.append(
'Expected error %s is not shown' % error)
send_transaction_view.cancel_button.click()
if send_transaction_view.back_button.is_element_displayed():
send_transaction_view.back_button.click()
else:
wallet_view.cancel_button.click()
self.errors.verify_no_errors()
@ -499,13 +470,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
if not wallet_view.asset_by_name(symbol).is_element_displayed():
self.errors.append('Custom token is not shown on Wallet view')
wallet_view.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click()
token_element = send_transaction.asset_by_name(symbol)
send_transaction.select_asset_button.click_until_presence_of_element(token_element)
if not token_element.is_element_displayed():
self.errors.append('Custom token is not shown on Send Transaction view')
send_transaction.cancel_button.click_until_absense_of_element(token_element)
recipient = "0x" + basic_user['address']
amount = '0.0%s' % str(random.randint(10000, 99999)) + '1'
wallet_view.send_transaction(asset_name=symbol, amount=amount, recipient=recipient)
@ -565,8 +529,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.amount_edit_box.set_value(str(initial_amount_ADI) + '1')
if not send_transaction.element_by_text(errors['send_transaction_screen']['insufficient_funds']).is_element_displayed():
self.errors.append(warning % (errors['send_transaction_screen']['insufficient_funds'], screen))
send_transaction.cancel_button.click()
wallet_view.back_button.click()
send_transaction.back_button.click(2)
screen = 'sending screen from wallet'
sign_in_view.just_fyi('Checking %s on %s' % (errors['sending_screen']['Network fee'], screen))
@ -575,10 +538,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet_view.get_account_by_name(account_name).click()
wallet_view.send_transaction_button.click()
send_transaction.amount_edit_box.set_value('0')
send_transaction.chose_recipient_button.click()
send_transaction.enter_recipient_address_button.click()
send_transaction.enter_recipient_address_input.set_value(ens_user_ropsten['ens'])
send_transaction.done_button.click()
send_transaction.set_recipient_address(ens_user_ropsten['ens'])
send_transaction.next_button.click()
if not send_transaction.validation_error_element.is_element_displayed(10):
self.errors.append('Validation icon is not shown when testing %s on %s' % (errors['sending_screen']['Network fee'],screen))
@ -612,25 +572,18 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.cancel_button.click()
screen = 'sending screen from DApp'
# TODO: disbled until redo of Network fee validation element
# sign_in_view.just_fyi('Checking %s on %s' % (errors['sending_screen']['Network fee'], screen))
# home_view = wallet_view.home_button.click()
# dapp_view = sign_in_view.dapp_tab_button.click()
# dapp_view.select_account_button.click()
# dapp_view.select_account_by_name(account_name).wait_for_element(30)
# dapp_view.select_account_by_name(account_name).click()
# status_test_dapp = home_view.open_status_test_dapp()
# status_test_dapp.wait_for_d_aap_to_load()
# status_test_dapp.transactions_button.click_until_presence_of_element(
# status_test_dapp.send_two_tx_in_batch_button)
# status_test_dapp.send_two_tx_in_batch_button.click()
# if not send_transaction.validation_error_element.is_element_displayed(10):
# self.errors.append(warning % (errors['sending_screen']['Network fee'],screen))
# send_transaction.cancel_button.click()
#
# for element in errors['sending_screen']:
# send_transaction.get_validation_icon(element).click()
# if not send_transaction.element_by_text_part(errors['sending_screen'][element]).is_element_displayed(10):
# self.errors.append(warning % (errors['sending_screen'][element], screen))
sign_in_view.just_fyi('Checking %s on %s' % (errors['sending_screen']['Network fee'], screen))
home_view = wallet_view.home_button.click()
dapp_view = sign_in_view.dapp_tab_button.click()
dapp_view.select_account_button.click()
dapp_view.select_account_by_name(account_name).wait_for_element(30)
dapp_view.select_account_by_name(account_name).click()
status_test_dapp = home_view.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.transactions_button.click_until_presence_of_element(
status_test_dapp.send_two_tx_in_batch_button)
status_test_dapp.send_two_tx_in_batch_button.click()
if not send_transaction.validation_error_element.is_element_displayed(10):
self.errors.append(warning % (errors['sending_screen']['Network fee'],screen))
self.errors.verify_no_errors()

View File

@ -28,6 +28,10 @@ class AmountEditBox(BaseEditBox, BaseButton):
super(AmountEditBox, self).__init__(driver)
self.locator = self.Locator.accessibility_id('amount-input')
def set_value(self, value):
BaseEditBox.set_value(self, value)
self.driver.press_keycode(66)
class SetMaxButton(BaseButton):
def __init__(self, driver):
@ -69,7 +73,7 @@ class ChooseRecipientButton(BaseButton):
class AccountsButton(BaseButton):
def __init__(self, driver):
super(AccountsButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('chose-recipient-accounts-button')
self.locator = self.Locator.text_selector('My accounts')
class EnterRecipientAddressButton(BaseButton):
@ -81,7 +85,7 @@ class EnterRecipientAddressButton(BaseButton):
class ScanQRCodeButton(BaseButton):
def __init__(self, driver):
super(ScanQRCodeButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('chose-recipient-scan-qr')
self.locator = self.Locator.accessibility_id('scan-contact-code-button')
class EnterRecipientAddressInput(BaseEditBox):
@ -170,7 +174,7 @@ class TotalFeeInput(BaseText):
class ETHroAssetButtonInSelectAssetBottomSheet(BaseButton):
def __init__(self, driver):
super(ETHroAssetButtonInSelectAssetBottomSheet, self).__init__(driver)
self.locator = self.Locator.xpath_selector('(//*[@content-desc=":ETH-asset-value"])[2]')
self.locator = self.Locator.accessibility_id(':ETH-asset-value')
class UpdateFeeButton(BaseButton):
@ -337,6 +341,12 @@ class SendTransactionView(BaseView):
wallet_view = WalletView(self.driver)
wallet_view.ok_got_it_button.click()
def set_recipient_address(self, address):
self.chose_recipient_button.click()
self.enter_recipient_address_input.set_value(address)
self.enter_recipient_address_input.click()
self.done_button.click()
def sign_transaction(self, sender_password: str = common_password, keycard=False, default_gas_price=True):
if not default_gas_price:
self.network_fee_button.click()

View File

@ -540,16 +540,12 @@ class WalletView(BaseView):
transaction_amount = str(kwargs.get('amount', send_transaction_view.get_unique_amount()))
send_transaction_view.amount_edit_box.set_value(transaction_amount)
send_transaction_view.confirm()
send_transaction_view.chose_recipient_button.click()
recipient = kwargs.get('recipient')
send_transaction_view.enter_recipient_address_button.click()
send_transaction_view.enter_recipient_address_input.set_value(recipient)
send_transaction_view.done_button.click()
send_transaction_view.set_recipient_address(kwargs.get('recipient'))
if kwargs.get('sign_transaction', True):
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_transaction(keycard=kwargs.get('keycard', False), default_gas_price=kwargs.get('default_gas_price', False))
send_transaction_view.sign_transaction(keycard=kwargs.get('keycard', False),
default_gas_price=kwargs.get('default_gas_price', False),
sender_password=kwargs.get('sender_password', common_password))
def receive_transaction(self, **kwargs):