e2e: hide/delete accounts, several checks on kk

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2021-08-19 13:41:41 +02:00
parent 0acca32e78
commit 00adc3448a
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
17 changed files with 122 additions and 110 deletions

View File

@ -257,7 +257,6 @@ class TestCreateAccount(SingleDeviceTestCase):
for phrase, account in recovery_users.items(): for phrase, account in recovery_users.items():
home_view = sign_in.recover_access(passphrase=phrase, password=unique_password) home_view = sign_in.recover_access(passphrase=phrase, password=unique_password)
wallet_view = home_view.wallet_button.click() wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
address = wallet_view.get_wallet_address() address = wallet_view.get_wallet_address()
if address != account: if address != account:
self.errors.append('Restored wallet address "%s" does not match expected "%s"' % (address, account)) self.errors.append('Restored wallet address "%s" does not match expected "%s"' % (address, account))

View File

@ -66,7 +66,6 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.just_fyi('Check that after migrating account with assets is restored') sign_in.just_fyi('Check that after migrating account with assets is restored')
wallet_view = sign_in.wallet_button.click() wallet_view = sign_in.wallet_button.click()
wallet_view.set_up_wallet()
for asset in ['ETH', 'ADI', 'STT']: for asset in ['ETH', 'ADI', 'STT']:
if wallet_view.get_asset_amount_by_name(asset) == 0: if wallet_view.get_asset_amount_by_name(asset) == 0:
self.errors.append('Asset %s was not restored' % asset) self.errors.append('Asset %s was not restored' % asset)
@ -142,7 +141,6 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.just_fyi('Check that after restoring account with assets is restored') sign_in.just_fyi('Check that after restoring account with assets is restored')
wallet_view = sign_in.wallet_button.click() wallet_view = sign_in.wallet_button.click()
wallet_view.set_up_wallet()
for asset in ['ETH', 'ADI', 'STT']: for asset in ['ETH', 'ADI', 'STT']:
if wallet_view.get_asset_amount_by_name(asset) == 0: if wallet_view.get_asset_amount_by_name(asset) == 0:
self.errors.append('Asset %s was not restored' % asset) self.errors.append('Asset %s was not restored' % asset)
@ -287,7 +285,6 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.just_fyi('Check assets after pairing keycard for recovered multiaccount') sign_in.just_fyi('Check assets after pairing keycard for recovered multiaccount')
wallet_view = sign_in.wallet_button.click() wallet_view = sign_in.wallet_button.click()
# wallet_view.set_up_wallet()
for asset in ['ETH', 'LXS']: for asset in ['ETH', 'LXS']:
if wallet_view.get_asset_amount_by_name(asset) == 0: if wallet_view.get_asset_amount_by_name(asset) == 0:
self.errors.append("%s value is not restored" % asset) self.errors.append("%s value is not restored" % asset)
@ -333,7 +330,6 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.lets_go_button.click_until_absense_of_element(sign_in.lets_go_button) sign_in.lets_go_button.click_until_absense_of_element(sign_in.lets_go_button)
sign_in.home_button.wait_for_visibility_of_element(30) sign_in.home_button.wait_for_visibility_of_element(30)
wallet_view = sign_in.wallet_button.click() wallet_view = sign_in.wallet_button.click()
wallet_view.set_up_wallet()
sign_in.just_fyi('Relogin offline') sign_in.just_fyi('Relogin offline')
self.driver.close_app() self.driver.close_app()
@ -405,7 +401,6 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.just_fyi('Add to wallet seed phrase for restored multiaccount') sign_in.just_fyi('Add to wallet seed phrase for restored multiaccount')
wallet_view = sign_in.wallet_button.click() wallet_view = sign_in.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.add_account_button.click() wallet_view.add_account_button.click()
wallet_view.enter_a_seed_phrase_button.click() wallet_view.enter_a_seed_phrase_button.click()
wallet_view.enter_your_password_input.send_keys(common_password) wallet_view.enter_your_password_input.send_keys(common_password)
@ -687,7 +682,6 @@ class TestKeycardCreateMultiaccountMultipleDevice(MultipleDeviceTestCase):
device_1.just_fyi('Check that after creating keycard account balance is 0, not ...') device_1.just_fyi('Check that after creating keycard account balance is 0, not ...')
wallet_1 = device_1.wallet_button.click() wallet_1 = device_1.wallet_button.click()
wallet_1.set_up_wallet()
wallet_address = wallet_1.get_wallet_address() wallet_address = wallet_1.get_wallet_address()
wallet_1.wallet_button.double_click() wallet_1.wallet_button.double_click()
if wallet_1.status_account_total_usd_value.text != '0': if wallet_1.status_account_total_usd_value.text != '0':
@ -707,7 +701,6 @@ class TestKeycardCreateMultiaccountMultipleDevice(MultipleDeviceTestCase):
device_2.just_fyi("Check username and wallet address on another device") device_2.just_fyi("Check username and wallet address on another device")
wallet_2 = device_2.wallet_button.click() wallet_2 = device_2.wallet_button.click()
wallet_2.set_up_wallet()
wallet_address_2 = wallet_2.get_wallet_address() wallet_address_2 = wallet_2.get_wallet_address()
wallet_2.wallet_button.double_click() wallet_2.wallet_button.double_click()
if wallet_address != wallet_address_2: if wallet_address != wallet_address_2:

View File

@ -91,7 +91,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
home.just_fyi("Copying wallet address") home.just_fyi("Copying wallet address")
wallet = profile.wallet_button.click() wallet = profile.wallet_button.click()
wallet.set_up_wallet()
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
request = wallet.receive_transaction_button.click() request = wallet.receive_transaction_button.click()
address = wallet.address_text.text address = wallet.address_text.text
@ -199,14 +198,12 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile_view.back_button.click() profile_view.back_button.click()
public_key = profile_view.get_public_key_and_username() public_key = profile_view.get_public_key_and_username()
wallet_view = profile_view.wallet_button.click() wallet_view = profile_view.wallet_button.click()
wallet_view.set_up_wallet()
address = wallet_view.get_wallet_address() address = wallet_view.get_wallet_address()
sign_in_view.profile_button.click() sign_in_view.profile_button.click()
profile_view.logout() profile_view.logout()
self.driver.reset() self.driver.reset()
sign_in_view.recover_access(recovery_phrase) sign_in_view.recover_access(recovery_phrase)
wallet_view = sign_in_view.wallet_button.click() wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
if wallet_view.get_wallet_address() != address: if wallet_view.get_wallet_address() != address:
self.driver.fail("Seed phrase displayed in new accounts for back up does not recover respective address") self.driver.fail("Seed phrase displayed in new accounts for back up does not recover respective address")
profile_view = wallet_view.profile_button.click() profile_view = wallet_view.profile_button.click()

View File

@ -66,7 +66,6 @@ class TestWalletManagement(SingleDeviceTestCase):
user = wallet_users['D'] user = wallet_users['D']
home = SignInView(self.driver).recover_access(user['passphrase']) home = SignInView(self.driver).recover_access(user['passphrase'])
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
wallet.just_fyi("Open transaction on etherscan") wallet.just_fyi("Open transaction on etherscan")
@ -97,7 +96,6 @@ class TestWalletManagement(SingleDeviceTestCase):
profile = home.profile_button.click() profile = home.profile_button.click()
profile.switch_network() profile.switch_network()
wallet = profile.wallet_button.click() wallet = profile.wallet_button.click()
wallet.set_up_wallet()
wallet.scan_tokens() wallet.scan_tokens()
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
wallet.collectibles_button.click() wallet.collectibles_button.click()
@ -131,7 +129,6 @@ class TestWalletManagement(SingleDeviceTestCase):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
sign_in.create_user() sign_in.create_user()
wallet = sign_in.wallet_button.click() wallet = sign_in.wallet_button.click()
wallet.set_up_wallet()
asset = "MDS" asset = "MDS"
sign_in.just_fyi("Enabling 0 asset on wallet and check it is shown") sign_in.just_fyi("Enabling 0 asset on wallet and check it is shown")
@ -160,7 +157,6 @@ class TestWalletManagement(SingleDeviceTestCase):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
sign_in.create_user() sign_in.create_user()
wallet = sign_in.wallet_button.click() wallet = sign_in.wallet_button.click()
wallet.set_up_wallet()
if wallet.backup_recovery_phrase_warning_text.is_element_present(): if wallet.backup_recovery_phrase_warning_text.is_element_present():
self.driver.fail("'Back up your seed phrase' warning is shown on Wallet while no funds are present") self.driver.fail("'Back up your seed phrase' warning is shown on Wallet while no funds are present")
address = wallet.get_wallet_address() address = wallet.get_wallet_address()
@ -181,7 +177,6 @@ class TestWalletManagement(SingleDeviceTestCase):
profile.switch_network('Rinkeby with upstream RPC') profile.switch_network('Rinkeby with upstream RPC')
profile = home.profile_button.click() profile = home.profile_button.click()
wallet = profile.wallet_button.click() wallet = profile.wallet_button.click()
wallet.set_up_wallet()
wallet.scan_tokens() wallet.scan_tokens()
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
wallet.collectibles_button.click() wallet.collectibles_button.click()
@ -195,7 +190,6 @@ class TestWalletManagement(SingleDeviceTestCase):
def test_add_account_to_multiaccount_instance_generate_new(self): def test_add_account_to_multiaccount_instance_generate_new(self):
home = SignInView(self.driver).create_user() home = SignInView(self.driver).create_user()
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.add_account_button.click() wallet.add_account_button.click()
wallet.generate_an_account_button.click() wallet.generate_an_account_button.click()
wallet.add_account_generate_account_button.click() wallet.add_account_generate_account_button.click()
@ -216,13 +210,18 @@ class TestWalletManagement(SingleDeviceTestCase):
self.driver.fail('Account was not added') self.driver.fail('Account was not added')
if not account_button.color_matches('multi_account_color.png'): if not account_button.color_matches('multi_account_color.png'):
self.driver.fail('Account color does not match expected') self.driver.fail('Account color does not match expected')
wallet.get_account_by_name(account_name).click()
wallet.get_account_options_by_name(account_name).click()
wallet.account_settings_button.click()
wallet.swipe_up()
if wallet.delete_account_button.is_element_displayed(10):
self.driver.fail('Delete account option is shown on added account "On Status Tree"!')
@marks.testrail_id(6244) @marks.testrail_id(6244)
@marks.high @marks.high
def test_add_and_delete_watch_only_account_to_multiaccount_instance(self): def test_add_and_delete_watch_only_account_to_multiaccount_instance(self):
home = SignInView(self.driver).create_user() home = SignInView(self.driver).create_user()
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.just_fyi('Add watch-only account') wallet.just_fyi('Add watch-only account')
wallet.add_account_button.click() wallet.add_account_button.click()
@ -270,21 +269,20 @@ class TestWalletManagement(SingleDeviceTestCase):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
sign_in.create_user() sign_in.create_user()
wallet = sign_in.wallet_button.click() wallet = sign_in.wallet_button.click()
wallet.set_up_wallet()
wallet.just_fyi('Add account from private key') wallet.just_fyi('Add account from private key')
wallet.add_account_button.click() wallet.add_account_button.click()
wallet.enter_a_private_key_button.click() wallet.enter_a_private_key_button.click()
wallet.enter_your_password_input.send_keys(common_password) wallet.enter_your_password_input.send_keys(common_password)
wallet.enter_a_private_key_input.set_value(wallet_users['C']['private_key'][0:9]) wallet.enter_a_private_key_input.set_value(wallet_users['C']['private_key'][0:9])
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10)) account_name_private = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
wallet.account_name_input.send_keys(account_name) wallet.account_name_input.send_keys(account_name_private)
wallet.add_account_generate_account_button.click() wallet.add_account_generate_account_button.click()
if wallet.get_account_by_name(account_name).is_element_displayed(): if wallet.get_account_by_name(account_name_private).is_element_displayed():
self.driver.fail('Account is added with wrong private key') self.driver.fail('Account is added with wrong private key')
wallet.enter_a_private_key_input.set_value(wallet_users['C']['private_key']) wallet.enter_a_private_key_input.set_value(wallet_users['C']['private_key'])
wallet.add_account_generate_account_button.click() wallet.add_account_generate_account_button.click()
account_button = wallet.get_account_by_name(account_name) account_button = wallet.get_account_by_name(account_name_private)
if not account_button.is_element_displayed(): if not account_button.is_element_displayed():
self.driver.fail('Account from private key was not added') self.driver.fail('Account from private key was not added')
@ -294,7 +292,7 @@ class TestWalletManagement(SingleDeviceTestCase):
initial_STT = wallet.get_asset_amount_by_name('STT') initial_STT = wallet.get_asset_amount_by_name('STT')
wallet.just_fyi('Check individual account view (imported from private key), receive option') wallet.just_fyi('Check individual account view (imported from private key), receive option')
wallet.get_account_by_name(account_name).scroll_and_click(direction="up") wallet.get_account_by_name(account_name_private).scroll_and_click(direction="up")
if not wallet.send_transaction_button.is_element_displayed(): if not wallet.send_transaction_button.is_element_displayed():
self.errors.append('Send button is not shown on account added with private key') self.errors.append('Send button is not shown on account added with private key')
wallet.receive_transaction_button.click() wallet.receive_transaction_button.click()
@ -308,18 +306,18 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet.enter_a_seed_phrase_button.click() wallet.enter_a_seed_phrase_button.click()
wallet.enter_your_password_input.send_keys(common_password) wallet.enter_your_password_input.send_keys(common_password)
wallet.enter_seed_phrase_input.set_value('') wallet.enter_seed_phrase_input.set_value('')
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10)) account_name_seed = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
wallet.account_name_input.send_keys(account_name) wallet.account_name_input.send_keys(account_name_seed)
wallet.add_account_generate_account_button.click() wallet.add_account_generate_account_button.click()
if wallet.get_account_by_name(account_name).is_element_displayed(): if wallet.get_account_by_name(account_name_seed).is_element_displayed():
self.driver.fail('Account is added without seed phrase') self.driver.fail('Account is added without seed phrase')
wallet.enter_seed_phrase_input.set_value(str(wallet_users['C']['passphrase']).upper()) wallet.enter_seed_phrase_input.set_value(str(wallet_users['C']['passphrase']).upper())
wallet.add_account_generate_account_button.click() wallet.add_account_generate_account_button.click()
if wallet.get_account_by_name(account_name).is_element_displayed(): if wallet.get_account_by_name(account_name_seed).is_element_displayed():
self.driver.fail('Same account was added twice') self.driver.fail('Same account was added twice')
wallet.enter_seed_phrase_input.set_value(str(wallet_users['D']['passphrase']).upper()) wallet.enter_seed_phrase_input.set_value(str(wallet_users['D']['passphrase']).upper())
wallet.add_account_generate_account_button.click() wallet.add_account_generate_account_button.click()
account_button = wallet.get_account_by_name(account_name) account_button = wallet.get_account_by_name(account_name_seed)
if not account_button.is_element_displayed(): if not account_button.is_element_displayed():
self.driver.fail('Account was not added') self.driver.fail('Account was not added')
@ -328,12 +326,47 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet.wait_balance_is_changed('MDS') wallet.wait_balance_is_changed('MDS')
wallet.just_fyi('Check account view and send option (imported from seed phrase)') wallet.just_fyi('Check account view and send option (imported from seed phrase)')
wallet.get_account_by_name(account_name).scroll_and_click(direction="up") wallet.get_account_by_name(account_name_seed).scroll_and_click(direction="up")
if not wallet.send_transaction_button.is_element_displayed(): if not wallet.send_transaction_button.is_element_displayed():
self.errors.append('Send button is not shown on account added with seed phrase') self.errors.append('Send button is not shown on account added with seed phrase')
wallet.receive_transaction_button.click() wallet.receive_transaction_button.click()
if wallet.address_text.text[2:] != wallet_users['D']['address']: if wallet.address_text.text[2:] != wallet_users['D']['address']:
self.errors.append('Wrong address %s is shown in "Receive" popup ' % wallet.address_text.text) self.errors.append('Wrong address %s is shown in "Receive" popup ' % wallet.address_text.text)
wallet.just_fyi("Hide both accounts / unhide one")
wallet.wallet_button.double_click()
wallet.get_account_options_from_main_screen(account_name_private).click()
wallet.hide_account_button.click()
if wallet.get_account_by_name(account_name_private).is_element_displayed():
self.errors.append("Hidden %s is shown on main wallet view" % account_name_private)
wallet.multiaccount_more_options.click()
wallet.manage_accounts_button.click()
if not wallet.hidden_account_by_name_button(account_name_private).is_element_displayed():
self.errors.append("Hidden icon is not shown for hidden account")
if not wallet.show_account_by_name_button(account_name_seed).is_element_displayed():
self.errors.append("'Show icon' is not shown for not hidden account")
wallet.show_account_by_name_button(account_name_seed).click()
wallet.wallet_button.double_click()
if wallet.get_account_by_name(account_name_seed).is_element_displayed():
self.errors.append("Hidden %s is shown on main wallet view after hiding via 'Show icon'" % account_name_seed)
wallet.multiaccount_more_options.click()
wallet.manage_accounts_button.click()
wallet.hidden_account_by_name_button(account_name_seed).click()
wallet.wallet_button.double_click()
if not wallet.get_account_by_name(account_name_seed).is_element_displayed():
self.errors.append("Unhidden %s is shown on main wallet view after hiding via 'Show icon'" % account_name_seed)
wallet.just_fyi("Delete unhidden account in wallet")
wallet.get_account_by_name(account_name_seed).click()
wallet.get_account_options_by_name(account_name_seed).click()
wallet.account_settings_button.click()
wallet.delete_account_button.scroll_and_click()
wallet.password_delete_account_input.wait_for_element(30)
wallet.password_delete_account_input.set_value(common_password)
wallet.delete_account_confirm_button.click()
if wallet.get_account_by_name(account_name_seed).is_element_displayed():
self.errors.append("Deleted %s is shown on main wallet view" % account_name_seed)
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(6269) @marks.testrail_id(6269)
@ -350,7 +383,6 @@ class TestWalletManagement(SingleDeviceTestCase):
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
home.just_fyi('Searching for asset by name and symbol') home.just_fyi('Searching for asset by name and symbol')
wallet.set_up_wallet()
wallet.multiaccount_more_options.click() wallet.multiaccount_more_options.click()
wallet.manage_assets_button.click() wallet.manage_assets_button.click()
for keyword in search_list_assets: for keyword in search_list_assets:

View File

@ -286,7 +286,6 @@ class TestChatManagement(SingleDeviceTestCase):
home.just_fyi("Denying access to camera in wallet view") home.just_fyi("Denying access to camera in wallet view")
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.scan_qr_button.click() wallet.scan_qr_button.click()
wallet.deny_button.click() wallet.deny_button.click()
general_camera_error.wait_for_visibility_of_element(3) general_camera_error.wait_for_visibility_of_element(3)

View File

@ -23,9 +23,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
recipient_public_key, recipient_username = home_2.get_public_key_and_username(return_username=True) recipient_public_key, recipient_username = home_2.get_public_key_and_username(return_username=True)
wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click() wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click()
for wallet in (wallet_1, wallet_2): [wallet.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) chat_1 = home_1.add_contact(recipient_public_key)
amount = chat_1.get_unique_amount() amount = chat_1.get_unique_amount()
@ -109,12 +107,10 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
home_1 = device_1.create_user() home_1 = device_1.create_user()
recipient_public_key, recipient_username = home_1.get_public_key_and_username(return_username=True) recipient_public_key, recipient_username = home_1.get_public_key_and_username(return_username=True)
wallet_1 = home_1.wallet_button.click() wallet_1 = home_1.wallet_button.click()
wallet_1.set_up_wallet()
wallet_1.select_asset(asset_name) wallet_1.select_asset(asset_name)
wallet_1.home_button.click() wallet_1.home_button.click()
home_2 = device_2.recover_access(passphrase=sender['passphrase']) home_2 = device_2.recover_access(passphrase=sender['passphrase'])
wallet_2 = home_2.wallet_button.click() wallet_2 = home_2.wallet_button.click()
wallet_2.set_up_wallet()
wallet_2.home_button.click() wallet_2.home_button.click()
device_2.just_fyi('Add recipient to contact and send 1 message') device_2.just_fyi('Add recipient to contact and send 1 message')
@ -170,9 +166,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
profile_2 = home_2.profile_button.click() profile_2 = home_2.profile_button.click()
recipient_chat_key = profile_2.get_public_key_and_username() recipient_chat_key = profile_2.get_public_key_and_username()
wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click() wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click()
for wallet in wallet_1, wallet_2: [wallet.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_chat_key) chat_1 = home_1.add_contact(recipient_chat_key)
amount = chat_1.get_unique_amount() amount = chat_1.get_unique_amount()
@ -222,7 +216,6 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
device_2_sign_in.create_user() device_2_sign_in.create_user()
home_1, home_2 = 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()
wallet_1 = home_1.wallet_button.click() wallet_1 = home_1.wallet_button.click()
wallet_1.set_up_wallet()
wallet_1.home_button.click() wallet_1.home_button.click()
profile_2 = home_2.profile_button.click() profile_2 = home_2.profile_button.click()
device_2_username = profile_2.default_username_text.text device_2_username = profile_2.default_username_text.text
@ -254,7 +247,6 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount) self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount)
chat_1_sender_message.transaction_status.wait_for_element_text(chat_1_sender_message.confirmed) chat_1_sender_message.transaction_status.wait_for_element_text(chat_1_sender_message.confirmed)
wallet_2 = chat_2.wallet_button.click() wallet_2 = chat_2.wallet_button.click()
wallet_2.set_up_wallet()
wallet_2.accounts_status_account.click() wallet_2.accounts_status_account.click()
wallet_2.swipe_down() wallet_2.swipe_down()
wallet_2.home_button.click(desired_view="chat") wallet_2.home_button.click(desired_view="chat")

View File

@ -19,7 +19,6 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
recipient_public_key, recipient_username = home_2.get_public_key_and_username(return_username=True) recipient_public_key, recipient_username = home_2.get_public_key_and_username(return_username=True)
wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click() wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click()
for wallet in (wallet_1, wallet_2): for wallet in (wallet_1, wallet_2):
wallet.set_up_wallet()
wallet.home_button.click() wallet.home_button.click()
chat_1 = home_1.add_contact(recipient_public_key) chat_1 = home_1.add_contact(recipient_public_key)
@ -95,13 +94,11 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
amount = device_1.get_unique_amount() amount = device_1.get_unique_amount()
asset_name = 'STT' asset_name = 'STT'
wallet_1 = home_1.wallet_button.click() wallet_1 = home_1.wallet_button.click()
wallet_1.set_up_wallet()
wallet_1.select_asset(asset_name) wallet_1.select_asset(asset_name)
wallet_1.home_button.click() wallet_1.home_button.click()
home_2 = device_2.recover_access(passphrase=sender['passphrase'], keycard=True, enable_notifications=True) home_2 = device_2.recover_access(passphrase=sender['passphrase'], keycard=True, enable_notifications=True)
wallet_2 = home_2.wallet_button.click() wallet_2 = home_2.wallet_button.click()
wallet_2.set_up_wallet()
wallet_2.home_button.click() wallet_2.home_button.click()
device_2.just_fyi('Add recipient to contact and send 1 message') device_2.just_fyi('Add recipient to contact and send 1 message')
@ -166,7 +163,6 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
sender = transaction_senders['E'] sender = transaction_senders['E']
home = sign_in.recover_access(sender['passphrase'], keycard=True) home = sign_in.recover_access(sender['passphrase'], keycard=True)
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.home_button.click() wallet.home_button.click()
chat = home.add_contact(ens_user_ropsten['ens']) chat = home.add_contact(ens_user_ropsten['ens'])

View File

@ -1047,7 +1047,6 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase):
user = transaction_senders['L'] user = transaction_senders['L']
home_view = SignInView(self.driver).recover_access(user['passphrase']) home_view = SignInView(self.driver).recover_access(user['passphrase'])
wallet_view = home_view.wallet_button.click() wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.home_button.click() wallet_view.home_button.click()
send_transaction_view = SendTransactionView(self.driver) send_transaction_view = SendTransactionView(self.driver)

View File

@ -83,7 +83,6 @@ class TestDApps(SingleDeviceTestCase):
wallet_view = sign_in_view.wallet_button.click() wallet_view = sign_in_view.wallet_button.click()
wallet_view.just_fyi('create new account in multiaccount') wallet_view.just_fyi('create new account in multiaccount')
wallet_view.set_up_wallet()
status_account = home_view.status_account_name status_account = home_view.status_account_name
account_name = 'Subaccount' account_name = 'Subaccount'
wallet_view.add_account(account_name) wallet_view.add_account(account_name)

View File

@ -207,7 +207,6 @@ class TestUpgradeApplication(SingleDeviceTestCase):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
home = sign_in.recover_access(passphrase=user['passphrase'], keycard=True) home = sign_in.recover_access(passphrase=user['passphrase'], keycard=True)
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.wait_balance_is_changed(asset='ADI', scan_tokens=True) wallet.wait_balance_is_changed(asset='ADI', scan_tokens=True)
home.upgrade_app() home.upgrade_app()

View File

@ -42,7 +42,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
home = SignInView(self.driver).recover_access(passphrase=transaction_senders['W']['passphrase'], home = SignInView(self.driver).recover_access(passphrase=transaction_senders['W']['passphrase'],
password=password) password=password)
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
status_test_dapp = home.open_status_test_dapp() status_test_dapp = home.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load() status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.transactions_button.click() status_test_dapp.transactions_button.click()
@ -104,7 +104,6 @@ class TestTransactionDApp(SingleDeviceTestCase):
self.errors.append('Public key is not returned') self.errors.append('Public key is not returned')
status_test_dapp.get_empty_dapp_tab() status_test_dapp.get_empty_dapp_tab()
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
home.just_fyi("Checking sign typed message") home.just_fyi("Checking sign typed message")
home.open_status_test_dapp(allow_all=True) home.open_status_test_dapp(allow_all=True)

View File

@ -14,7 +14,6 @@ class TestTransactionDApp(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
home_view = sign_in_view.recover_access(sender['passphrase'], keycard=True) home_view = sign_in_view.recover_access(sender['passphrase'], keycard=True)
wallet_view = home_view.wallet_button.click() wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.scan_tokens() wallet_view.scan_tokens()
initial_amount_STT = wallet_view.get_asset_amount_by_name('STT') initial_amount_STT = wallet_view.get_asset_amount_by_name('STT')
status_test_dapp = home_view.open_status_test_dapp() status_test_dapp = home_view.open_status_test_dapp()
@ -41,7 +40,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
home = SignInView(self.driver).recover_access(passphrase=transaction_senders['Z']['passphrase'], home = SignInView(self.driver).recover_access(passphrase=transaction_senders['Z']['passphrase'],
keycard=True) keycard=True)
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
status_test_dapp = home.open_status_test_dapp() status_test_dapp = home.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load() status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.transactions_button.click() status_test_dapp.transactions_button.click()
@ -84,7 +83,6 @@ class TestTransactionDApp(SingleDeviceTestCase):
sender = transaction_senders['W'] sender = transaction_senders['W']
home = SignInView(self.driver).recover_access(sender['passphrase'], keycard=True) home = SignInView(self.driver).recover_access(sender['passphrase'], keycard=True)
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
status_test_dapp = home.open_status_test_dapp() status_test_dapp = home.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load() status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.transactions_button.click_until_presence_of_element(status_test_dapp.sign_typed_message_button) status_test_dapp.transactions_button.click_until_presence_of_element(status_test_dapp.sign_typed_message_button)

View File

@ -16,7 +16,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
home_view = sign_in_view.recover_access(sender['passphrase'], keycard=True) home_view = sign_in_view.recover_access(sender['passphrase'], keycard=True)
wallet_view = home_view.wallet_button.click() wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.accounts_status_account.click() wallet_view.accounts_status_account.click()
transaction_amount = wallet_view.get_unique_amount() transaction_amount = wallet_view.get_unique_amount()
wallet_view.send_transaction(amount=transaction_amount, wallet_view.send_transaction(amount=transaction_amount,
@ -76,7 +75,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
signin_view = SignInView(self.driver) signin_view = SignInView(self.driver)
home_view = signin_view.recover_access(passphrase=passphrase, keycard=True) home_view = signin_view.recover_access(passphrase=passphrase, keycard=True)
wallet_view = home_view.wallet_button.click() wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.accounts_status_account.click() wallet_view.accounts_status_account.click()
transaction_view = wallet_view.transaction_history_button.click() transaction_view = wallet_view.transaction_history_button.click()
@ -102,61 +100,73 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.medium @marks.medium
def test_keycard_send_funds_between_accounts_in_multiaccount_instance(self): def test_keycard_send_funds_between_accounts_in_multiaccount_instance(self):
sign_in_view = SignInView(self.driver).create_user(keycard=True) sign_in_view = SignInView(self.driver).create_user(keycard=True)
wallet_view = sign_in_view.wallet_button.click() wallet = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet() status_account_address = wallet.get_wallet_address()[2:]
status_account_address = wallet_view.get_wallet_address()[2:]
self.network_api.get_donate(status_account_address, external_faucet=True) self.network_api.get_donate(status_account_address, external_faucet=True)
wallet_view.wait_balance_is_changed() wallet.wait_balance_is_changed()
account_name = 'subaccount' account_name = 'subaccount'
wallet_view.add_account(account_name, keycard=True) wallet.add_account(account_name, keycard=True)
wallet.get_account_by_name(account_name).click()
wallet.get_account_options_by_name(account_name).click()
wallet.account_settings_button.click()
wallet.swipe_up()
wallet_view.just_fyi("Send transaction to new account") wallet.just_fyi("Checking that delete account and importing account are not available on keycard")
wallet_view.accounts_status_account.wait_and_click() if wallet.delete_account_button.is_element_displayed(10):
self.errors.append('Delete account option is shown on added account "On Status Tree"!')
wallet.wallet_button.double_click()
wallet.add_account_button.click()
if wallet.enter_a_seed_phrase_button.is_element_displayed():
self.errors.append('Importing account option is available on keycard!')
wallet.click_system_back_button()
wallet.just_fyi("Send transaction to new account")
wallet.accounts_status_account.wait_and_click()
transaction_amount = '0.004' transaction_amount = '0.004'
initial_balance = self.network_api.get_balance(status_account_address) initial_balance = self.network_api.get_balance(status_account_address)
wallet_view.send_transaction(account_name=account_name, wallet.send_transaction(account_name=account_name,
amount=transaction_amount, amount=transaction_amount,
keycard=True) keycard=True)
self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount) self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount)
self.network_api.verify_balance_is_updated(str(initial_balance), status_account_address) self.network_api.verify_balance_is_updated(str(initial_balance), status_account_address)
wallet_view.just_fyi("Verifying previously sent transaction in new account") wallet.just_fyi("Verifying previously sent transaction in new account")
wallet_view.close_button.click() wallet.close_button.click()
wallet_view.get_account_by_name(account_name).click() wallet.get_account_by_name(account_name).click()
wallet_view.send_transaction_button.click() wallet.send_transaction_button.click()
wallet_view.close_send_transaction_view_button.click() wallet.close_send_transaction_view_button.click()
balance_after_receiving_tx = float(wallet_view.get_asset_amount_by_name('ETH')) balance_after_receiving_tx = float(wallet.get_asset_amount_by_name('ETH'))
expected_balance = self.network_api.get_rounded_balance(balance_after_receiving_tx, transaction_amount) expected_balance = self.network_api.get_rounded_balance(balance_after_receiving_tx, transaction_amount)
if balance_after_receiving_tx != expected_balance: if balance_after_receiving_tx != expected_balance:
self.driver.fail('New account balance %s does not match expected %s after receiving a transaction' % ( self.driver.fail('New account balance %s does not match expected %s after receiving a transaction' % (
balance_after_receiving_tx, transaction_amount)) balance_after_receiving_tx, transaction_amount))
wallet_view.just_fyi("Sending eth from new account to main account") wallet.just_fyi("Sending eth from new account to main account")
updated_balance = self.network_api.get_balance(status_account_address) updated_balance = self.network_api.get_balance(status_account_address)
transaction_amount_1 = round(float(transaction_amount) * 0.2, 11) transaction_amount_1 = round(float(transaction_amount) * 0.2, 11)
wallet_view.wait_balance_is_changed() wallet.wait_balance_is_changed()
wallet_view.get_account_by_name(account_name).click() wallet.get_account_by_name(account_name).click()
send_transaction = wallet_view.send_transaction(account_name=wallet_view.status_account_name, send_transaction = wallet.send_transaction(account_name=wallet.status_account_name,
amount=transaction_amount_1, amount=transaction_amount_1,
keycard=True, keycard=True,
default_gas_price=True) default_gas_price=True)
wallet_view.close_button.click() wallet.close_button.click()
sub_account_address = wallet_view.get_wallet_address(account_name)[2:] sub_account_address = wallet.get_wallet_address(account_name)[2:]
self.network_api.wait_for_confirmation_of_transaction(sub_account_address, transaction_amount_1) self.network_api.wait_for_confirmation_of_transaction(sub_account_address, transaction_amount_1)
wallet_view.find_transaction_in_history(amount=transaction_amount) wallet.find_transaction_in_history(amount=transaction_amount)
wallet_view.find_transaction_in_history(amount=format(float(transaction_amount_1),'.11f').rstrip('0')) wallet.find_transaction_in_history(amount=format(float(transaction_amount_1),'.11f').rstrip('0'))
wallet_view.just_fyi("Check transactions on subaccount") wallet.just_fyi("Check transactions on subaccount")
self.network_api.verify_balance_is_updated(updated_balance, status_account_address) self.network_api.verify_balance_is_updated(updated_balance, status_account_address)
wallet_view.just_fyi("Verify total ETH on main wallet view") wallet.just_fyi("Verify total ETH on main wallet view")
self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount_1) self.network_api.wait_for_confirmation_of_transaction(status_account_address, transaction_amount_1)
self.network_api.verify_balance_is_updated((updated_balance + transaction_amount_1), status_account_address) self.network_api.verify_balance_is_updated((updated_balance + transaction_amount_1), status_account_address)
wallet_view.close_button.click() wallet.close_button.click()
balance_of_sub_account = float(self.network_api.get_balance(sub_account_address)) / 1000000000000000000 balance_of_sub_account = float(self.network_api.get_balance(sub_account_address)) / 1000000000000000000
balance_of_status_account = float(self.network_api.get_balance(status_account_address)) / 1000000000000000000 balance_of_status_account = float(self.network_api.get_balance(status_account_address)) / 1000000000000000000
wallet_view.scan_tokens() wallet.scan_tokens()
total_eth_from_two_accounts = float(wallet_view.get_asset_amount_by_name('ETH')) total_eth_from_two_accounts = float(wallet.get_asset_amount_by_name('ETH'))
expected_balance = self.network_api.get_rounded_balance(total_eth_from_two_accounts, expected_balance = self.network_api.get_rounded_balance(total_eth_from_two_accounts,
(balance_of_status_account + balance_of_sub_account)) (balance_of_status_account + balance_of_sub_account))
@ -164,9 +174,9 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
self.driver.fail('Total wallet balance %s != of Status account (%s) + SubAccount (%s)' % ( self.driver.fail('Total wallet balance %s != of Status account (%s) + SubAccount (%s)' % (
total_eth_from_two_accounts, balance_of_status_account, balance_of_sub_account)) total_eth_from_two_accounts, balance_of_status_account, balance_of_sub_account))
wallet_view.just_fyi("Check that can set max and send transaction with max amount from subaccount") wallet.just_fyi("Check that can set max and send transaction with max amount from subaccount")
wallet_view.get_account_by_name(account_name).click() wallet.get_account_by_name(account_name).click()
wallet_view.send_transaction_button.click() wallet.send_transaction_button.click()
send_transaction.set_max_button.click() send_transaction.set_max_button.click()
set_amount = float(send_transaction.amount_edit_box.text) set_amount = float(send_transaction.amount_edit_box.text)
if set_amount == 0.0 or set_amount >= balance_of_sub_account: if set_amount == 0.0 or set_amount >= balance_of_sub_account:
@ -174,8 +184,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.confirm() send_transaction.confirm()
send_transaction.chose_recipient_button.click() send_transaction.chose_recipient_button.click()
send_transaction.accounts_button.click() send_transaction.accounts_button.click()
send_transaction.element_by_text(wallet_view.status_account_name).click() send_transaction.element_by_text(wallet.status_account_name).click()
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
send_transaction.sign_transaction(keycard=True, default_gas_price=True) send_transaction.sign_transaction(keycard=True, default_gas_price=True)
wallet_view.element_by_text('Assets').click() wallet.element_by_text('Assets').click()
wallet_view.wait_balance_is_equal_expected_amount(asset='ETH', expected_balance=0) wallet.wait_balance_is_equal_expected_amount(asset='ETH', expected_balance=0)

View File

@ -20,7 +20,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
home = sign_in.recover_access(sender['passphrase'], password=unique_password) home = sign_in.recover_access(sender['passphrase'], password=unique_password)
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
transaction_amount = wallet.get_unique_amount() transaction_amount = wallet.get_unique_amount()
@ -98,7 +97,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view.recover_access(sender['passphrase']) sign_in_view.recover_access(sender['passphrase'])
home_view = sign_in_view.get_home_view() home_view = sign_in_view.get_home_view()
wallet_view = home_view.wallet_button.click() wallet_view = home_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.accounts_status_account.click() wallet_view.accounts_status_account.click()
send_transaction = wallet_view.send_transaction_button.click() send_transaction = wallet_view.send_transaction_button.click()
send_transaction.amount_edit_box.click() send_transaction.amount_edit_box.click()
@ -138,7 +136,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.recover_access(sender['passphrase']) sign_in_view.recover_access(sender['passphrase'])
wallet_view = sign_in_view.wallet_button.click() wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
[wallet_view.wait_balance_is_changed(asset) for asset in ['ETH', 'STT']] [wallet_view.wait_balance_is_changed(asset) for asset in ['ETH', 'STT']]
eth_value = wallet_view.get_asset_amount_by_name('ETH') eth_value = wallet_view.get_asset_amount_by_name('ETH')
stt_value = wallet_view.get_asset_amount_by_name('STT') stt_value = wallet_view.get_asset_amount_by_name('STT')
@ -176,7 +173,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
home = sign_in.recover_access(passphrase=passphrase) home = sign_in.recover_access(passphrase=passphrase)
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
for asset in ('ETH', 'MDS', 'STT'): for asset in ('ETH', 'MDS', 'STT'):
wallet.wait_balance_is_changed(asset) wallet.wait_balance_is_changed(asset)
wallet.swipe_up() wallet.swipe_up()
@ -220,7 +216,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
def test_offline_can_login_cant_send_transaction(self): def test_offline_can_login_cant_send_transaction(self):
home = SignInView(self.driver).create_user() home = SignInView(self.driver).create_user()
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.toggle_airplane_mode() wallet.toggle_airplane_mode()
wallet.accounts_status_account.click_until_presence_of_element(wallet.send_transaction_button) wallet.accounts_status_account.click_until_presence_of_element(wallet.send_transaction_button)
send_transaction = wallet.send_transaction_button.click() send_transaction = wallet.send_transaction_button.click()
@ -244,7 +239,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()
wallet_view = sign_in_view.wallet_button.click() wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
status_account_address = wallet_view.get_wallet_address()[2:] status_account_address = wallet_view.get_wallet_address()[2:]
self.network_api.get_donate(status_account_address, external_faucet=True) self.network_api.get_donate(status_account_address, external_faucet=True)
wallet_view.wait_balance_is_changed() wallet_view.wait_balance_is_changed()
@ -309,7 +303,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()
wallet_view = sign_in_view.wallet_button.click() wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
status_account_address = wallet_view.get_wallet_address() status_account_address = wallet_view.get_wallet_address()
wallet_view.get_account_options_by_name().click() wallet_view.get_account_options_by_name().click()
@ -459,7 +452,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.recover_access(wallet_users['B']['passphrase']) sign_in_view.recover_access(wallet_users['B']['passphrase'])
wallet_view = sign_in_view.wallet_button.click() wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.multiaccount_more_options.click() wallet_view.multiaccount_more_options.click()
wallet_view.manage_assets_button.click() wallet_view.manage_assets_button.click()
token_view = wallet_view.add_custom_token_button.click() token_view = wallet_view.add_custom_token_button.click()
@ -506,7 +498,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
chat.set_nickname(nickname) chat.set_nickname(nickname)
chat.close_button.click() chat.close_button.click()
wallet = home.wallet_button.click() wallet = home.wallet_button.click()
wallet.set_up_wallet()
wallet.add_account(account_name=account_name) wallet.add_account(account_name=account_name)
wallet.accounts_status_account.click() wallet.accounts_status_account.click()
send_tr = wallet.send_transaction_button.click() send_tr = wallet.send_transaction_button.click()
@ -612,7 +603,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view.recover_access(sender['passphrase']) sign_in_view.recover_access(sender['passphrase'])
wallet_view = sign_in_view.wallet_button.click() wallet_view = sign_in_view.wallet_button.click()
wallet_view.set_up_wallet()
wallet_view.accounts_status_account.click() wallet_view.accounts_status_account.click()
screen = 'send transaction screen from wallet' screen = 'send transaction screen from wallet'
@ -707,9 +697,7 @@ class TestTransactionWalletMultipleDevice(MultipleDeviceTestCase):
device_2.recover_access(receiver['passphrase']) device_2.recover_access(receiver['passphrase'])
wallet_view_serder = device_1_home.wallet_button.click() wallet_view_serder = device_1_home.wallet_button.click()
wallet_view_serder.set_up_wallet()
wallet_view_receiver = device_2_home.wallet_button.click() wallet_view_receiver = device_2_home.wallet_button.click()
wallet_view_receiver.set_up_wallet()
if wallet_view_receiver.asset_by_name('STT').is_element_present(10): if wallet_view_receiver.asset_by_name('STT').is_element_present(10):
initial_balance = wallet_view_receiver.get_asset_amount_by_name("STT") initial_balance = wallet_view_receiver.get_asset_amount_by_name("STT")

View File

@ -635,7 +635,7 @@ class BaseView(object):
def set_up_wallet_when_sending_tx(self): def set_up_wallet_when_sending_tx(self):
self.driver.info("**Setting up wallet**") self.driver.info("**Setting up wallet**")
phrase = self.sign_in_phrase.text phrase = self.sign_in_phrase.text
self.ok_got_it_button.click() self.ok_got_it_button.wait_and_click(20)
return phrase return phrase
def get_empty_dapp_tab(self): def get_empty_dapp_tab(self):

View File

@ -134,8 +134,8 @@ class SendTransactionView(BaseView):
self.done_button.click_until_absense_of_element(self.done_button) self.done_button.click_until_absense_of_element(self.done_button)
def sign_transaction(self, sender_password: str = common_password, keycard=False, default_gas_price=False): def sign_transaction(self, sender_password: str = common_password, keycard=False, default_gas_price=False):
self.driver.info("**Signing transaction (keycard:%s, default_gas_price:%s)**" % (str(keycard), str(default_gas_price))) self.driver.info("**Signing transaction (keycard:%s, default gas price:%s)**" % (str(keycard), str(default_gas_price)))
if self.sign_in_phrase.is_element_displayed(): if self.sign_in_phrase.is_element_displayed(30):
self.set_up_wallet_when_sending_tx() self.set_up_wallet_when_sending_tx()
if not default_gas_price: if not default_gas_price:
self.network_fee_button.click() self.network_fee_button.click()

View File

@ -87,6 +87,7 @@ class WalletView(BaseView):
self.receive_transaction_button = ReceiveTransactionButton(self.driver) self.receive_transaction_button = ReceiveTransactionButton(self.driver)
self.options_button = Button(self.driver, accessibility_id="options-menu-button") self.options_button = Button(self.driver, accessibility_id="options-menu-button")
self.manage_assets_button = Button(self.driver, accessibility_id="wallet-manage-assets") self.manage_assets_button = Button(self.driver, accessibility_id="wallet-manage-assets")
self.manage_accounts_button = Button(self.driver, accessibility_id="wallet-manage-accounts")
self.scan_tokens_button = Button(self.driver, accessibility_id="wallet-scan-token") self.scan_tokens_button = Button(self.driver, accessibility_id="wallet-scan-token")
self.stt_check_box = Button(self.driver, xpath="//*[@text='STT']/../android.view.ViewGroup[@content-desc='checkbox']") self.stt_check_box = Button(self.driver, xpath="//*[@text='STT']/../android.view.ViewGroup[@content-desc='checkbox']")
self.all_assets_full_names = Text(self.driver, xpath="//*[@content-desc='checkbox']/../android.widget.TextView[1]") self.all_assets_full_names = Text(self.driver, xpath="//*[@content-desc='checkbox']/../android.widget.TextView[1]")
@ -126,10 +127,13 @@ class WalletView(BaseView):
self.status_account_total_usd_value = Text(self.driver, accessibility_id="account-total-value") self.status_account_total_usd_value = Text(self.driver, accessibility_id="account-total-value")
self.scan_qr_button = Button(self.driver, accessibility_id="accounts-qr-code") self.scan_qr_button = Button(self.driver, accessibility_id="accounts-qr-code")
self.close_send_transaction_view_button = Button(self.driver, xpath="//androidx.appcompat.widget.LinearLayoutCompat") self.close_send_transaction_view_button = Button(self.driver, xpath="//androidx.appcompat.widget.LinearLayoutCompat")
self.hide_account_button = Button(self.driver, accessibility_id="hide-account-button")
# individual account settings # individual account settings
self.account_settings_button = Button(self.driver, translation_id="account-settings") self.account_settings_button = Button(self.driver, translation_id="account-settings")
self.apply_settings_button = Button(self.driver, translation_id="apply") self.apply_settings_button = Button(self.driver, translation_id="apply")
self.password_delete_account_input = EditBox(self.driver, xpath='//*[@text="Password"]/following-sibling::*/android.widget.EditText')
self.delete_account_confirm_button = Button(self.driver, accessibility_id="delete-account-confirm")
def wait_balance_is_equal_expected_amount(self, asset ='ETH', expected_balance=0.1, wait_time=300): def wait_balance_is_equal_expected_amount(self, asset ='ETH', expected_balance=0.1, wait_time=300):
counter = 0 counter = 0
@ -179,12 +183,6 @@ class WalletView(BaseView):
def get_sign_in_phrase(self): def get_sign_in_phrase(self):
return ' '.join([element.text for element in self.sign_in_phrase.find_elements()]) return ' '.join([element.text for element in self.sign_in_phrase.find_elements()])
def set_up_wallet(self):
#self.driver.info("**Setting up wallet**")
#phrase = self.sign_in_phrase.text
#self.ok_got_it_button.click()
#return phrase
pass ## Temporary for easier edit of tests
def set_up_wallet_when_sending_tx(self): def set_up_wallet_when_sending_tx(self):
self.driver.info("**Setting up wallet**") self.driver.info("**Setting up wallet**")
@ -229,6 +227,20 @@ class WalletView(BaseView):
self.driver.info("*Getting '%s'account options*" % account_name) self.driver.info("*Getting '%s'account options*" % account_name)
return SilentButton(self.driver, xpath="(//*[@text='%s']/../..//*[@content-desc='icon'])[2]" % account_name) return SilentButton(self.driver, xpath="(//*[@text='%s']/../..//*[@content-desc='icon'])[2]" % account_name)
def get_account_options_from_main_screen(self, account_name=''):
account_name = self.status_account_name if not account_name else account_name
self.driver.info("*Getting '%s'account options from main wallet screen*" % account_name)
return SilentButton(self.driver, xpath="//*[@content-desc='accountcard%s']//*[@content-desc='icon']" % account_name)
def hidden_account_by_name_button(self, account_name=''):
return SilentButton(self.driver,
xpath="//*[@text='%s']/following-sibling::*[@content-desc='hide-icon']"% account_name)
def show_account_by_name_button(self, account_name=''):
return SilentButton(self.driver,
xpath="//*[@text='%s']/following-sibling::*[@content-desc='show-icon']"% account_name)
def select_asset(self, *args): def select_asset(self, *args):
self.driver.info("**Selecting asset(s)**") self.driver.info("**Selecting asset(s)**")
self.multiaccount_more_options.click() self.multiaccount_more_options.click()