Multiaccount critical e2e fixed

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Serhy 2019-06-24 18:53:02 +03:00
parent 8321346ca5
commit 7237dd510d
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
13 changed files with 166 additions and 141 deletions

View File

@ -59,7 +59,8 @@
(ethereum/normalized-address address)]]
[react/view {:position :absolute :top 12 :right 12}
[react/touchable-highlight {:on-press #(re-frame/dispatch [:wallet.accounts/share])}
[icons/icon :main-icons/share {:color colors/white}]]]
[icons/icon :main-icons/share {:color colors/white
:accessibility-label :share-wallet-address-icon}]]]
[react/view {:height 52 :background-color (colors/alpha colors/black 0.2)
:border-bottom-right-radius 8 :border-bottom-left-radius 8 :flex-direction :row}
[button (i18n/label :t/wallet-send) :main-icons/send #(re-frame/dispatch [:navigate-to :wallet-send-transaction])]

View File

@ -15,10 +15,12 @@
[action-button/action-button {:label (i18n/label :t/wallet-manage-assets)
:icon :main-icons/token
:icon-opts {:color :blue}
:accessibility-label :wallet-manage-assets
:on-press #(hide-sheet-and-dispatch [:navigate-to :wallet-settings-assets])}]
[action-button/action-button {:label (i18n/label :t/set-currency)
:icon :main-icons/language
:icon-opts {:color :blue}
:accessibility-label :wallet-set-currency
:on-press #(hide-sheet-and-dispatch [:navigate-to :currency-settings])}]
[action-button/action-button-disabled {:label (i18n/label :t/view-signing)
:icon :main-icons/info
@ -29,6 +31,7 @@
:icon-opts {:color colors/red}
:label-style {:color colors/red}
:cyrcle-color (colors/alpha colors/red 0.1)
:accessibility-label :wallet-backup-recovery-title
:on-press #(hide-sheet-and-dispatch [:navigate-to :backup-seed])}])]))
(defn send-receive []

View File

@ -145,13 +145,14 @@
[react/view {:width 14 :height 14 :background-color colors/gray :border-radius 7 :align-items :center
:justify-content :center :margin-right 9}
[react/text {:style {:color colors/white :font-size 13 :font-weight "700"}} "!"]]
[react/text {:style {:color colors/gray}} (i18n/label :t/back-up-your-seed-phrase)]])]
[react/text {:style {:color colors/gray}
:accessibility-label :back-up-your-seed-phrase-warning} (i18n/label :t/back-up-your-seed-phrase)]])]
[react/touchable-highlight {:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet
{:content (sheets/accounts-options seed-backed-up?)
:content-height (if seed-backed-up? 190 250)}])}
[react/view {:height toolbar.styles/toolbar-height :width toolbar.styles/toolbar-height :align-items :center
:justify-content :center}
[icons/icon :main-icons/more]]]]))
[icons/icon :main-icons/more {:accessibility-label :accounts-more-options}]]]]))
(defn accounts-overview []
[react/view {:flex 1}

View File

@ -56,7 +56,8 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile_view.click_system_back_button()
profile_view.cross_icon.click()
wallet = profile_view.wallet_button.click()
wallet.set_up_wallet()
# wallet.set_up_wallet()
wallet.accounts_status_account.click()
request = wallet.receive_transaction_button.click()
address = wallet.address_text.text
request.share_button.click()

View File

@ -47,7 +47,8 @@ class TestWalletManagement(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver)
home_view = sign_in_view.recover_access(user['passphrase'])
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
# wallet_view.set_up_wallet()
wallet_view.accounts_status_account.click()
transactions_view = wallet_view.transaction_history_button.click()
transaction_details = transactions_view.transactions_table.transaction_by_index(0).click()
transaction_hash = transaction_details.get_transaction_hash()
@ -83,7 +84,7 @@ class TestWalletManagement(SingleDeviceTestCase):
sign_in = SignInView(self.driver)
sign_in.create_user()
wallet = sign_in.wallet_button.click()
wallet.set_up_wallet()
# wallet.set_up_wallet()
asset = "MDS"
wallet.select_asset(asset)
wallet.asset_by_name(asset).scroll_to_element()
@ -100,17 +101,18 @@ class TestWalletManagement(SingleDeviceTestCase):
sign_in = SignInView(self.driver)
sign_in.create_user()
wallet = sign_in.wallet_button.click()
wallet.set_up_wallet()
if wallet.backup_recovery_phrase.is_element_present():
pytest.fail("'Backup your Recovery phrase' option is shown on Wallet for an account with no funds")
wallet.receive_transaction_button.click()
address = wallet.address_text.text[2:]
wallet.get_back_to_home_view()
home = wallet.home_button.click()
self.network_api.get_donate(address)
home.wallet_button.click()
if not wallet.backup_recovery_phrase.is_element_present():
pytest.fail("'Backup your Recovery phrase' option is not shown on Wallet for an account with funds")
# wallet.set_up_wallet()
# if wallet.backup_recovery_phrase.is_element_present():
# pytest.fail("'Backup your Recovery phrase' option is shown on Wallet for an account with no funds")
# wallet.receive_transaction_button.click()
# address = wallet.address_text.text[2:]
# wallet.get_back_to_home_view()
# home = wallet.home_button.click()
# self.network_api.get_donate(address)
# home.wallet_button.click()
if not wallet.backup_recovery_phrase_warning_text.is_element_present():
pytest.fail("'Back up your seed phrase' warning is not shown on Wallet")
wallet.accounts_more_options.click_until_presence_of_element(wallet.backup_recovery_phrase)
profile = wallet.get_profile_view()
profile.backup_recovery_phrase()

View File

@ -13,8 +13,8 @@ from views.sign_in_view import SignInView
@marks.transaction
class TestCommandsMultipleDevices(MultipleDeviceTestCase):
@marks.critical
@marks.testrail_id(5334)
@marks.critical
def test_network_mismatch_for_send_request_commands(self):
sender = transaction_senders['D']
self.create_drivers(2)
@ -24,7 +24,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
device_1_home, device_2_home = device_1_sign_in.get_home_view(), device_2_sign_in.get_home_view()
device_1_wallet_view = device_1_home.wallet_button.click()
device_1_wallet_view.set_up_wallet()
# device_1_wallet_view.set_up_wallet()
device_1_wallet_view.home_button.click()
public_key = device_2_home.get_public_key()
@ -75,7 +75,6 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
@marks.testrail_id(5306)
@marks.critical
@marks.skip
def test_send_eth_in_1_1_chat(self):
recipient = transaction_recipients['A']
sender = transaction_senders['A']
@ -84,9 +83,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.set_up_wallet()
wallet_1.home_button.click()
wallet_2.set_up_wallet()
# wallet_2.set_up_wallet()
init_balance = wallet_2.get_eth_value()
wallet_2.home_button.click()
@ -97,35 +96,18 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
chat_1.asset_by_name('ETHro').click()
chat_1.send_as_keyevent(amount)
send_transaction_view = chat_1.get_send_transaction_view()
chat_1.send_message_button.click_until_presence_of_element(send_transaction_view.sign_transaction_button)
chat_1.send_message_button.click_until_presence_of_element(send_transaction_view.sign_with_password)
send_transaction_view.chose_recipient_button.find_element().click()
if send_transaction_view.recent_recipients_button.is_element_displayed():
self.errors.append('Recipient field is editable')
send_transaction_view.click_system_back_button()
send_transaction_view.select_asset_button.click()
if not send_transaction_view.chose_recipient_button.is_element_displayed():
self.errors.append('Asset field is editable')
send_transaction_view.back_button.click()
if send_transaction_view.amount_edit_box.is_element_displayed():
self.errors.append('Amount field is editable')
chat_1.driver.swipe(500, 1000, 500, 500)
send_transaction_view.advanced_button.click()
send_transaction_view.transaction_fee_button.click()
send_transaction_view.network_fee_button.click()
gas_limit = '25000'
send_transaction_view.gas_limit_input.clear()
send_transaction_view.gas_limit_input.set_value(gas_limit)
gas_price = '1'
send_transaction_view.gas_price_input.clear()
send_transaction_view.gas_price_input.set_value(gas_price)
send_transaction_view.total_fee_input.click()
if send_transaction_view.total_fee_input.text != '%s ETHro' % (d(gas_limit) * d(gas_price) / d(1000000000)):
self.errors.append('Gas limit and/or gas price fields were not edited')
send_transaction_view.done_button.click()
send_transaction_view.update_fee_button.click()
send_transaction_view.sign_transaction()
if not chat_1.chat_element_by_text(amount).is_element_displayed():
@ -153,9 +135,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.set_up_wallet()
wallet_1.home_button.click()
wallet_2.set_up_wallet()
# wallet_2.set_up_wallet()
init_balance = wallet_2.get_eth_value()
wallet_2.home_button.click()
@ -194,8 +176,9 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
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.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()
@ -260,7 +243,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
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.set_up_wallet()
wallet_1.home_button.click()
chat_1 = home_1.add_contact(recipient['public_key'])
@ -291,9 +274,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.set_up_wallet()
wallet_1.home_button.click()
wallet_2.set_up_wallet()
# wallet_2.set_up_wallet()
wallet_2.home_button.click()
chat_2 = home_2.add_contact(sender['public_key'])
@ -368,7 +351,7 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
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.set_up_wallet()
wallet.home_button.click()
chat = home.add_contact(basic_user['public_key'])
amount = chat.get_unique_amount()

View File

@ -218,7 +218,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
singin_view = SignInView(self.driver)
home_view = singin_view.create_user()
wallet = home_view.wallet_button.click()
wallet.set_up_wallet()
# wallet.set_up_wallet()
wallet_address = wallet.get_wallet_address()
home_view = wallet.get_back_to_home_view()
status_test_dapp = home_view.open_status_test_dapp()
@ -234,27 +234,26 @@ class TestTransactionDApp(SingleDeviceTestCase):
self.errors.append(warning.format('deploying a contract with an empty ETH balance'))
# Check whether sign transaction button is disabled
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_with_password.click()
if send_transaction_view.enter_password_input.is_element_displayed():
self.errors.append(sign_button_warning.format('deploying a contract with an empty ETH balance'))
# Requesting test ETH and waiting till the balance updates
send_transaction_view.cross_icon.click()
send_transaction_view.cancel_button.click()
self.network_api.get_donate(wallet_address[2:])
self.network_api.verify_balance_is_updated(initial_balance=0, recipient_address=wallet_address[2:])
status_test_dapp.transactions_button.click()
send_transaction_view = status_test_dapp.send_one_tx_in_batch_button.click()
send_transaction_view.advanced_button.click()
send_transaction_view.transaction_fee_button.click()
send_transaction_view.network_fee_button.click()
gas_limit = '100000'
send_transaction_view.gas_limit_input.clear()
send_transaction_view.gas_limit_input.set_value(gas_limit)
gas_price = '999.900000001'
send_transaction_view.gas_price_input.clear()
send_transaction_view.gas_price_input.set_value(gas_price)
send_transaction_view.total_fee_input.click()
send_transaction_view.done_button.click()
# send_transaction_view.total_fee_input.click()
send_transaction_view.update_fee_button.click()
# Check whether sending a tx in batch with big gas limit and price triggers the warning and sign button is still
# disabled (no funds to pay gas)
@ -263,7 +262,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
'limit and price (no funds to pay gas)'))
# Check whether sign transaction button is disabled
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_with_password.click()
if send_transaction_view.enter_password_input.is_element_displayed():
self.errors.append(sign_button_warning.
format('sending one transaction in batch with big gas '
@ -294,7 +293,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
singin_view = SignInView(self.driver)
home_view = singin_view.create_user()
wallet = home_view.wallet_button.click()
wallet.set_up_wallet()
# wallet.set_up_wallet()
wallet.select_asset("STT")
wallet_address = wallet.get_wallet_address()
recipient = '0x' + basic_user['address']
@ -306,11 +305,11 @@ class TestTransactionDApp(SingleDeviceTestCase):
sign_button_warning = 'Signin transaction button is enabled {}'
# Check whether sending 0 ETH with an empty ETH balance triggers the warning
send_transaction_view.sign_transaction_button.click()
if not send_transaction_view.validation_warnings.not_enough_eth_for_gas.is_element_displayed():
self.errors.append(warning.format('sending 0 ETH with an empty ETH balance'))
# Check whether sign transaction button is disabled
send_transaction_view.sign_transaction_button.click()
if send_transaction_view.enter_password_input.is_element_displayed():
self.errors.append(sign_button_warning.format('sending 0 ETH with an empty ETH balance'))
@ -327,6 +326,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
# Check whether sign transaction button is disabled
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_with_password.click()
if send_transaction_view.enter_password_input.is_element_displayed():
self.errors.append(sign_button_warning.format('sending 0 STT with an empty ETH balance'))
@ -345,12 +345,14 @@ class TestTransactionDApp(SingleDeviceTestCase):
# Check whether sign transaction button is disabled
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_with_password.click()
if send_transaction_view.enter_password_input.is_element_displayed():
self.errors.append('sending all available ETH (no funds to pay gas)')
send_transaction_view.cancel_button.click()
send_transaction_view.amount_edit_box.clear()
# Because tx gas price may change we calculate eth value according to current gas fee value
send_transaction_view.advanced_button.click()
send_transaction_view.sign_transaction_button.click()
transaction_fee_total = send_transaction_view.get_transaction_fee_total()
eth_available_for_tx = str(Decimal('0.1') - Decimal(transaction_fee_total))
wei = '0.000000000000000001'

View File

@ -23,7 +23,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
home_view.add_contact(recipient['public_key'])
home_view.get_back_to_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
# 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()
@ -46,7 +47,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver)
home_view = sign_in_view.recover_access(sender['passphrase'])
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
# 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()
@ -71,7 +73,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
home_view.add_contact(recipient['public_key'])
home_view.get_back_to_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
# wallet_view.set_up_wallet()
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)
@ -151,7 +154,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view.recover_access(sender['passphrase'])
home_view = sign_in_view.get_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
# 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()
@ -173,7 +177,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view.recover_access(sender['passphrase'], unique_password)
home_view = sign_in_view.get_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
# 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()
@ -198,7 +203,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
home_view.add_contact(recipient['public_key'])
home_view.get_back_to_home_view()
wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
# 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(adi_button)
@ -222,7 +228,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
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.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(adi_button)
@ -251,7 +258,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
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.set_up_wallet()
wallet_view.accounts_status_account.click()
bigger_amount = wallet_view.get_eth_value() + 1
send_transaction = wallet_view.send_transaction_button.click()
amount_edit_box = send_transaction.amount_edit_box
@ -277,8 +285,9 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user()
wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
# wallet_view.set_up_wallet()
wallet_view.select_asset("STT")
wallet_view.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click()
send_transaction.amount_edit_box.set_value(1)
error_text = send_transaction.element_by_text('Insufficient funds')
@ -298,7 +307,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
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.set_up_wallet()
eth_value = wallet_view.get_eth_value()
stt_value = wallet_view.get_stt_value()
if eth_value == 0 or stt_value == 0:
@ -322,13 +331,14 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(5359)
@marks.critical
@marks.skip
# @marks.skip
def test_modify_transaction_fee_values(self):
sender = transaction_senders['U']
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.set_up_wallet
wallet_view.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click()
amount = send_transaction.get_unique_amount()
@ -339,39 +349,28 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
recipient_address = basic_user['address']
send_transaction.enter_recipient_address_input.set_value(recipient_address)
send_transaction.done_button.click()
send_transaction.advanced_button.click()
send_transaction.transaction_fee_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.network_fee_button.click()
send_transaction.gas_limit_input.clear()
send_transaction.gas_limit_input.set_value('1')
send_transaction.gas_price_input.clear()
send_transaction.gas_price_input.set_value('1')
send_transaction.total_fee_input.click()
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click_until_presence_of_element(send_transaction.enter_password_input)
send_transaction.update_fee_button.click()
send_transaction.sign_with_password.click_until_presence_of_element(send_transaction.enter_password_input)
send_transaction.enter_password_input.send_keys(common_password)
send_transaction.sign_transaction_button.click()
send_transaction.sign_button.click()
send_transaction.element_by_text('intrinsic gas too low', 'text').wait_for_visibility_of_element()
send_transaction.ok_button.click()
wallet_view.send_transaction_button.click()
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.advanced_button.click()
send_transaction.transaction_fee_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.network_fee_button.click()
send_transaction.gas_limit_input.clear()
gas_limit = '1005000'
send_transaction.gas_limit_input.set_value(gas_limit)
send_transaction.gas_price_input.clear()
gas_price = '24'
send_transaction.gas_price_input.set_value(gas_price)
send_transaction.total_fee_input.click()
send_transaction.done_button.click()
send_transaction.sign_transaction_button.click()
send_transaction.update_fee_button.click()
send_transaction.sign_transaction()
self.network_api.find_transaction_by_unique_amount(sender['address'], amount)
@ -433,7 +432,8 @@ class TestTransactionWalletMultipleDevice(MultipleDeviceTestCase):
chat_1.get_back_to_home_view()
wallet_1 = home_1.wallet_button.click()
wallet_1.set_up_wallet()
# wallet_1.set_up_wallet()
wallet_1.accounts_status_account.click()
send_transaction = wallet_1.send_transaction_button.click()
send_transaction.amount_edit_box.click()
amount = send_transaction.get_unique_amount()

View File

@ -131,12 +131,9 @@ class WalletButton(TabButton):
def click(self):
self.driver.info('Tap on %s' % self.name)
from views.wallet_view import SetUpButton, SendTransactionButton
for _ in range(3):
self.find_element().click()
if SetUpButton(self.driver).is_element_displayed() or SendTransactionButton(
self.driver).is_element_displayed():
return self.navigate()
from views.wallet_view import AccountsMoreOptions
self.click_until_presence_of_element(AccountsMoreOptions(self.driver))
return self.navigate()
class ProfileButton(TabButton):
@ -444,10 +441,14 @@ class BaseView(object):
element.locator = element.Locator.xpath_selector(xpath)
return element
def swipe_down(self):
def swipe_up(self):
size = self.driver.get_window_size()
self.driver.swipe(size["width"]*0.5, size["height"]*0.8, size["width"]*0.5, size["height"]*0.2)
def swipe_down(self):
size = self.driver.get_window_size()
self.driver.swipe(size["width"]*0.5, size["height"]*0.2, size["width"]*0.5, size["height"]*0.8)
def swipe_left(self):
size = self.driver.get_window_size()
self.driver.swipe(size["width"]*0.8, size["height"]*0.8, size["width"]*0.2, size["height"]*0.8)

View File

@ -444,7 +444,7 @@ class ChatView(BaseView):
wallet_view.done_button.click()
wallet_view.yes_button.click()
else:
self.send_message_button.click_until_presence_of_element(send_transaction.sign_transaction_button)
self.send_message_button.click_until_presence_of_element(send_transaction.sign_with_password)
send_transaction.sign_transaction(sender_password)
def delete_chat(self):

View File

@ -607,7 +607,6 @@ class ProfileView(BaseView):
self.username_input.set_value(user_name)
self.confirm_edit_button.click()
def remove_profile_picture(self):
if not AbstractTestCase().environment == 'sauce':
raise NotImplementedError('Test case is implemented to run on SauceLabs only')

View File

@ -100,10 +100,10 @@ class ErrorDialog(BaseView):
return element.wait_for_element(wait_time)
class AdvancedButton(BaseButton):
class NetworkFeeButton(BaseButton):
def __init__(self, driver):
super(AdvancedButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('advanced-button')
super(NetworkFeeButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@text="Network fee"]')
class TransactionFeeButton(BaseButton):
@ -112,29 +112,35 @@ class TransactionFeeButton(BaseButton):
self.locator = self.Locator.accessibility_id('transaction-fee-button')
class TransactionFeeTotalValue(BaseButton):
class TransactionFeeTotalValue(BaseText):
def __init__(self, driver):
super(TransactionFeeTotalValue, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@content-desc='transaction-fee-button']"
"/android.widget.TextView[1]")
self.locator = self.Locator.xpath_selector("//*[@text='Network fee']"
"/following-sibling::android.widget.TextView")
class GasLimitInput(BaseEditBox):
def __init__(self, driver):
super(GasLimitInput, self).__init__(driver)
self.locator = self.Locator.accessibility_id('gas-limit-input')
self.locator = self.Locator.xpath_selector("(//*[@text='Gas limit']/..//android.widget.EditText)[1]")
class GasPriceInput(BaseEditBox):
def __init__(self, driver):
super(GasPriceInput, self).__init__(driver)
self.locator = self.Locator.accessibility_id('gas-price-input')
self.locator = self.Locator.xpath_selector("(//*[@text='Gas limit']/..//android.widget.EditText)[2]")
class TotalFeeInput(BaseEditBox):
class TotalFeeInput(BaseText):
def __init__(self, driver):
super(TotalFeeInput, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@content-desc='total-fee-input']/android.widget.TextView")
self.locator = self.Locator.xpath_selector("//*[@text='Total Fee']/following-sibling::android.widget.TextView")
class UpdateFeeButton(BaseButton):
def __init__(self, driver):
super(UpdateFeeButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='Update']")
class ShareButton(BaseButton):
@ -187,12 +193,13 @@ class SendTransactionView(BaseView):
self.recent_recipients_button = RecentRecipientsButton(self.driver)
self.amount_edit_box = AmountEditBox(self.driver)
self.advanced_button = AdvancedButton(self.driver)
self.network_fee_button = NetworkFeeButton(self.driver)
self.transaction_fee_button = TransactionFeeButton(self.driver)
self.transaction_fee_total_value = TransactionFeeTotalValue(self.driver)
self.gas_limit_input = GasLimitInput(self.driver)
self.gas_price_input = GasPriceInput(self.driver)
self.total_fee_input = TotalFeeInput(self.driver)
self.update_fee_button = UpdateFeeButton(self.driver)
self.cancel_button = CancelButton(self.driver)
self.sign_transaction_button = SignTransactionButton(self.driver)

View File

@ -3,28 +3,6 @@ from views.base_view import BaseView
from views.base_element import BaseButton, BaseText
class SendTransactionButton(BaseButton):
def __init__(self, driver):
super(SendTransactionButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('send-transaction-button')
def navigate(self):
from views.send_transaction_view import SendTransactionView
return SendTransactionView(self.driver)
class ReceiveTransactionButton(BaseButton):
def __init__(self, driver):
super(ReceiveTransactionButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('receive-transaction-button')
def navigate(self):
from views.send_transaction_view import SendTransactionView
return SendTransactionView(self.driver)
class SendRequestButton(BaseButton):
def __init__(self, driver):
@ -43,7 +21,7 @@ class TransactionHistoryButton(BaseButton):
def __init__(self, driver):
super(TransactionHistoryButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('transaction-history-button')
self.locator = self.Locator.xpath_selector("//*[@text='History']")
def navigate(self):
from views.transactions_view import TransactionsView
@ -59,13 +37,13 @@ class ChooseFromContactsButton(BaseButton):
class EthAssetText(BaseText):
def __init__(self, driver):
super(EthAssetText, self).__init__(driver)
self.locator = self.Locator.accessibility_id('eth-asset-value-text')
self.locator = self.Locator.xpath_selector("//*[@text='ETHro']/preceding-sibling::*[1]")
class STTAssetText(BaseText):
def __init__(self, driver):
super(STTAssetText, self).__init__(driver)
self.locator = self.Locator.accessibility_id('stt-asset-value-text')
self.locator = self.Locator.accessibility_id("//*[@text='STT']/preceding-sibling::*[1]")
class UsdTotalValueText(BaseText):
@ -93,13 +71,14 @@ class OptionsButton(BaseButton):
class ManageAssetsButton(BaseButton):
def __init__(self, driver):
super(ManageAssetsButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='Manage Assets']")
self.locator = self.Locator.accessibility_id('wallet-manage-assets')
class STTCheckBox(BaseButton):
def __init__(self, driver):
super(STTCheckBox, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='STT']/../android.widget.CheckBox")
self.locator = self.Locator.xpath_selector("//*[@text='STT']"
"/../android.view.ViewGroup[@content-desc='checkbox']")
class QRCodeImage(BaseButton):
@ -137,7 +116,7 @@ class SignInPhraseText(BaseText):
class AssetTextElement(BaseText):
def __init__(self, driver, asset_name):
super(AssetTextElement, self).__init__(driver)
self.locator = self.Locator.accessibility_id('%s-asset-value-text' % asset_name.lower())
self.locator = self.Locator.xpath_selector("//*[@text='%s']" % asset_name)
class CollectibleTextElement(BaseText):
@ -181,6 +160,46 @@ class BackupRecoveryPhrase(BaseButton):
return ProfileView(self.driver)
class BackupRecoveryPhraseWarningText(BaseButton):
def __init__(self, driver):
super(BackupRecoveryPhraseWarningText, self).__init__(driver)
self.locator = self.Locator.accessibility_id('back-up-your-seed-phrase-warning')
class AccountsMoreOptions(BaseButton):
def __init__(self,driver):
super(AccountsMoreOptions, self).__init__(driver)
self.locator = self.Locator.accessibility_id('accounts-more-options')
class AccountsStatusAccount(BaseButton):
def __init__(self,driver):
super(AccountsStatusAccount, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//android.widget.HorizontalScrollView//*[@text='Status account']")
class SendTransactionButton(BaseButton):
def __init__(self, driver):
super(SendTransactionButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='Send']")
def navigate(self):
from views.send_transaction_view import SendTransactionView
return SendTransactionView(self.driver)
class ReceiveTransactionButton(BaseButton):
def __init__(self, driver):
super(ReceiveTransactionButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='Receive']")
def navigate(self):
from views.send_transaction_view import SendTransactionView
return SendTransactionView(self.driver)
class WalletView(BaseView):
def __init__(self, driver):
super(WalletView, self).__init__(driver)
@ -209,6 +228,11 @@ class WalletView(BaseView):
self.total_amount_text = TotalAmountText(self.driver)
self.currency_text = CurrencyText(self.driver)
self.backup_recovery_phrase = BackupRecoveryPhrase(self.driver)
self.backup_recovery_phrase_warning_text = BackupRecoveryPhraseWarningText(self.driver)
# elements for multiaccount
self.accounts_more_options = AccountsMoreOptions(self.driver)
self.accounts_status_account = AccountsStatusAccount(self.driver)
def get_usd_total_value(self):
import re
@ -258,6 +282,7 @@ class WalletView(BaseView):
return phrase
def get_wallet_address(self):
self.accounts_status_account.click()
self.receive_transaction_button.click()
address = self.address_text.text
self.back_button.click()
@ -270,7 +295,7 @@ class WalletView(BaseView):
return AssetCheckBox(self.driver, asset_name)
def select_asset(self, *args):
self.options_button.click()
self.accounts_more_options.click()
self.manage_assets_button.click()
for asset in args:
self.asset_checkbox_by_name(asset).click()