2019-08-16 10:14:23 +00:00
|
|
|
import random
|
|
|
|
import string
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2021-01-28 12:55:23 +00:00
|
|
|
from tests import marks, common_password
|
2018-06-29 17:27:30 +00:00
|
|
|
from tests.base_test_case import SingleDeviceTestCase
|
2021-02-01 16:09:04 +00:00
|
|
|
from tests.users import wallet_users, transaction_senders, basic_user
|
2018-06-29 17:27:30 +00:00
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
|
|
|
|
|
2018-07-26 18:58:05 +00:00
|
|
|
class TestWalletManagement(SingleDeviceTestCase):
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5335)
|
2019-03-05 16:43:30 +00:00
|
|
|
@marks.high
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_wallet_set_up(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
2019-07-29 00:35:36 +00:00
|
|
|
sign_in.recover_access(transaction_senders['A']['passphrase'])
|
2018-06-29 17:27:30 +00:00
|
|
|
wallet = sign_in.wallet_button.click()
|
2021-06-18 11:09:03 +00:00
|
|
|
|
|
|
|
wallet.just_fyi("Initiating some transaction so the wallet signing phrase pop-up appears")
|
|
|
|
wallet.accounts_status_account.click()
|
|
|
|
send_transaction_view = wallet.send_transaction_button.click()
|
|
|
|
send_transaction_view.amount_edit_box.click()
|
|
|
|
send_transaction_view.amount_edit_box.set_value("0")
|
|
|
|
send_transaction_view.set_recipient_address("0x"+transaction_senders['A']['address'])
|
|
|
|
send_transaction_view.sign_transaction_button.click()
|
|
|
|
|
2021-02-01 16:09:04 +00:00
|
|
|
texts = list(map(sign_in.get_translation_by_key,
|
|
|
|
["this-is-you-signing", "three-words-description", "three-words-description-2"]))
|
2020-04-15 14:25:18 +00:00
|
|
|
wallet.just_fyi('Check tests in set up wallet popup')
|
2018-11-14 17:18:57 +00:00
|
|
|
for text in texts:
|
|
|
|
if not wallet.element_by_text_part(text).is_element_displayed():
|
|
|
|
self.errors.append("'%s' text is not displayed" % text)
|
2019-07-29 00:35:36 +00:00
|
|
|
phrase = wallet.sign_in_phrase.list
|
|
|
|
if len(phrase) != 3:
|
|
|
|
self.errors.append('Transaction phrase length is %s' % len(phrase))
|
2020-04-15 14:25:18 +00:00
|
|
|
|
|
|
|
wallet.just_fyi('Check popup will reappear if tap on "Remind me later"')
|
2019-07-29 00:35:36 +00:00
|
|
|
wallet.remind_me_later_button.click()
|
2021-06-18 11:09:03 +00:00
|
|
|
send_transaction_view.cancel_button.click()
|
|
|
|
wallet.wallet_button.click()
|
2019-07-29 00:35:36 +00:00
|
|
|
wallet.accounts_status_account.click()
|
|
|
|
send_transaction = wallet.send_transaction_button.click()
|
|
|
|
send_transaction.amount_edit_box.set_value('0')
|
2020-09-17 13:14:55 +00:00
|
|
|
send_transaction.set_recipient_address('0x%s' % basic_user['address'])
|
2020-09-23 11:48:20 +00:00
|
|
|
send_transaction.next_button.click_until_presence_of_element(send_transaction.sign_transaction_button)
|
2019-07-29 00:35:36 +00:00
|
|
|
send_transaction.sign_transaction_button.click()
|
|
|
|
for text in texts:
|
|
|
|
if not wallet.element_by_text_part(text).is_element_displayed():
|
2018-06-29 17:27:30 +00:00
|
|
|
self.errors.append("'%s' text is not displayed" % text)
|
2019-07-29 00:35:36 +00:00
|
|
|
phrase_1 = wallet.sign_in_phrase.list
|
|
|
|
if phrase_1 != phrase:
|
|
|
|
self.errors.append("Transaction phrase '%s' doesn't match expected '%s'" % (phrase_1, phrase))
|
|
|
|
wallet.ok_got_it_button.click()
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.cancel_button.click()
|
2019-07-29 00:35:36 +00:00
|
|
|
wallet.home_button.click()
|
|
|
|
wallet.wallet_button.click()
|
|
|
|
for text in texts:
|
|
|
|
if wallet.element_by_text_part(text).is_element_displayed():
|
|
|
|
self.errors.append('Signing phrase pop up appears after wallet set up')
|
|
|
|
break
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5384)
|
2019-05-07 15:21:30 +00:00
|
|
|
@marks.critical
|
2021-01-28 15:46:01 +00:00
|
|
|
def test_open_transaction_on_etherscan_copy_tx_hash(self):
|
2019-11-20 16:27:29 +00:00
|
|
|
user = wallet_users['D']
|
2021-01-28 15:46:01 +00:00
|
|
|
home = SignInView(self.driver).recover_access(user['passphrase'])
|
|
|
|
wallet = home.wallet_button.click()
|
|
|
|
wallet.accounts_status_account.click()
|
|
|
|
|
|
|
|
wallet.just_fyi("Open transaction on etherscan")
|
|
|
|
transactions = wallet.transaction_history_button.click()
|
|
|
|
transaction_details = transactions.transactions_table.transaction_by_index(0).click()
|
2018-06-29 17:27:30 +00:00
|
|
|
transaction_hash = transaction_details.get_transaction_hash()
|
|
|
|
transaction_details.options_button.click()
|
|
|
|
transaction_details.open_transaction_on_etherscan_button.click()
|
2021-01-28 15:46:01 +00:00
|
|
|
web_page = wallet.get_base_web_view()
|
|
|
|
web_page.open_in_webview()
|
|
|
|
web_page.element_by_text_part(transaction_hash).wait_for_visibility_of_element(30)
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2021-01-28 15:46:01 +00:00
|
|
|
wallet.just_fyi("Copy transaction hash")
|
|
|
|
web_page.click_system_back_button()
|
2018-06-29 17:27:30 +00:00
|
|
|
transaction_details.options_button.click()
|
|
|
|
transaction_details.copy_transaction_hash_button.click()
|
2021-01-28 15:46:01 +00:00
|
|
|
wallet.home_button.click()
|
|
|
|
public_chat = home.join_public_chat('testchat')
|
2018-07-03 12:40:44 +00:00
|
|
|
public_chat.chat_message_input.paste_text_from_clipboard()
|
|
|
|
if public_chat.chat_message_input.text != transaction_hash:
|
2019-10-21 12:48:45 +00:00
|
|
|
self.driver.fail('Transaction hash was not copied')
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2021-01-28 15:46:01 +00:00
|
|
|
@marks.testrail_id(5346)
|
|
|
|
@marks.high
|
|
|
|
def test_collectible_from_wallet(self):
|
|
|
|
passphrase = wallet_users['F']['passphrase']
|
|
|
|
home = SignInView(self.driver).recover_access(passphrase=passphrase)
|
|
|
|
profile = home.profile_button.click()
|
|
|
|
profile.switch_network()
|
|
|
|
wallet = profile.wallet_button.click()
|
|
|
|
wallet.scan_tokens()
|
|
|
|
wallet.accounts_status_account.click()
|
|
|
|
wallet.collectibles_button.click()
|
|
|
|
|
|
|
|
wallet.just_fyi('Check collectibles amount in wallet')
|
2021-09-15 15:21:05 +00:00
|
|
|
wallet.element_by_translation_id("enable").scroll_and_click()
|
2021-01-28 15:46:01 +00:00
|
|
|
wallet.cryptokitties_in_collectibles_number.wait_for_visibility_of_element(30)
|
|
|
|
if wallet.cryptokitties_in_collectibles_number.text != '1':
|
|
|
|
self.errors.append(
|
|
|
|
'Wrong number is shown on CK assets: %s' % wallet.cryptokitties_in_collectibles_number.text)
|
2021-09-15 15:21:05 +00:00
|
|
|
# TODO: should be added check for that NFT image is shown after adding accessibility
|
2021-01-28 15:46:01 +00:00
|
|
|
|
|
|
|
wallet.just_fyi('Check that collectibles are not shown when sending assets from wallet')
|
|
|
|
send_transaction = wallet.send_transaction_button.click()
|
|
|
|
send_transaction.select_asset_button.click()
|
|
|
|
if send_transaction.asset_by_name("CryptoKitties").is_element_displayed():
|
|
|
|
self.errors.append('Collectibles can be sent from wallet')
|
2021-06-18 11:09:03 +00:00
|
|
|
wallet.close_send_transaction_view_button.double_click()
|
2021-01-28 15:46:01 +00:00
|
|
|
|
2021-09-15 15:21:05 +00:00
|
|
|
wallet.just_fyi('Check "Open in OpenSea" (that user is signed in)')
|
2021-01-28 15:46:01 +00:00
|
|
|
wallet.element_by_translation_id("check-on-opensea").click()
|
2021-06-18 11:09:03 +00:00
|
|
|
web_view = wallet.get_webview_view()
|
|
|
|
web_view.wait_for_d_aap_to_load(10)
|
2021-09-15 15:21:05 +00:00
|
|
|
#wallet.swipe_by_custom_coordinates(0.5,0.8,0.5,0.7)
|
|
|
|
wallet.element_by_text('e2ecryptokitty').wait_for_element(60)
|
2021-01-28 15:46:01 +00:00
|
|
|
self.errors.verify_no_errors()
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5341)
|
|
|
|
@marks.critical
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_manage_assets(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
wallet = sign_in.wallet_button.click()
|
2019-05-27 16:45:20 +00:00
|
|
|
asset = "MDS"
|
2021-02-01 16:09:04 +00:00
|
|
|
|
|
|
|
sign_in.just_fyi("Enabling 0 asset on wallet and check it is shown")
|
2019-05-27 16:45:20 +00:00
|
|
|
wallet.select_asset(asset)
|
|
|
|
wallet.asset_by_name(asset).scroll_to_element()
|
|
|
|
if not wallet.asset_by_name(asset).is_element_displayed():
|
|
|
|
self.errors.append('%s asset is not shown in wallet' % asset)
|
2021-02-01 16:09:04 +00:00
|
|
|
|
|
|
|
sign_in.just_fyi("Check that 0 asset is not disappearing after relogin")
|
|
|
|
profile = wallet.profile_button.click()
|
|
|
|
profile.relogin()
|
|
|
|
sign_in.wallet_button.click()
|
|
|
|
if not wallet.asset_by_name(asset).is_element_displayed():
|
|
|
|
self.errors.append('%s asset is not shown in wallet after relogin' % asset)
|
|
|
|
|
|
|
|
sign_in.just_fyi("Deselecting asset")
|
2019-05-27 16:45:20 +00:00
|
|
|
wallet.select_asset(asset)
|
|
|
|
if wallet.asset_by_name(asset).is_element_displayed():
|
|
|
|
self.errors.append('%s asset is shown in wallet but was deselected' % asset)
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2018-07-06 11:10:48 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5358)
|
2019-10-21 07:15:06 +00:00
|
|
|
@marks.medium
|
2020-11-26 17:33:43 +00:00
|
|
|
@marks.transaction
|
2018-07-16 12:57:01 +00:00
|
|
|
def test_backup_recovery_phrase_warning_from_wallet(self):
|
2018-07-06 11:10:48 +00:00
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
wallet = sign_in.wallet_button.click()
|
2019-10-21 07:15:06 +00:00
|
|
|
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")
|
|
|
|
address = wallet.get_wallet_address()
|
2020-12-08 15:56:57 +00:00
|
|
|
self.network_api.get_donate(address[2:], external_faucet=True, wait_time=200)
|
2021-06-23 15:12:42 +00:00
|
|
|
wallet.close_button.click()
|
2021-03-18 10:20:36 +00:00
|
|
|
wallet.wait_balance_is_changed(scan_tokens=True)
|
2019-10-21 07:15:06 +00:00
|
|
|
if not wallet.backup_recovery_phrase_warning_text.is_element_present(30):
|
|
|
|
self.driver.fail("'Back up your seed phrase' warning is not shown on Wallet with funds")
|
2018-07-06 11:10:48 +00:00
|
|
|
profile = wallet.get_profile_view()
|
2021-01-25 16:35:40 +00:00
|
|
|
wallet.backup_recovery_phrase_warning_text.click()
|
2018-07-16 12:57:01 +00:00
|
|
|
profile.backup_recovery_phrase()
|
2018-07-19 09:57:45 +00:00
|
|
|
|
2018-11-09 12:36:21 +00:00
|
|
|
@marks.testrail_id(5381)
|
|
|
|
@marks.high
|
2021-09-15 15:21:05 +00:00
|
|
|
@marks.skip
|
|
|
|
# TODO: enabling after adding NFT support on Rinkeby
|
2018-11-09 12:36:21 +00:00
|
|
|
def test_user_can_see_all_own_assets_after_account_recovering(self):
|
2021-02-01 16:09:04 +00:00
|
|
|
home = SignInView(self.driver).recover_access(wallet_users['E']['passphrase'])
|
|
|
|
profile = home.profile_button.click()
|
2018-11-09 12:36:21 +00:00
|
|
|
profile.switch_network('Rinkeby with upstream RPC')
|
2021-02-01 16:09:04 +00:00
|
|
|
profile = home.profile_button.click()
|
|
|
|
wallet = profile.wallet_button.click()
|
|
|
|
wallet.scan_tokens()
|
|
|
|
wallet.accounts_status_account.click()
|
|
|
|
wallet.collectibles_button.click()
|
|
|
|
if not wallet.element_by_text('KDO').is_element_displayed():
|
2019-06-28 14:36:24 +00:00
|
|
|
self.driver.fail('User collectibles token name in not shown')
|
2021-02-01 16:09:04 +00:00
|
|
|
if not wallet.element_by_text('1').is_element_displayed():
|
2019-06-28 14:36:24 +00:00
|
|
|
self.driver.fail('User collectibles amount does not match')
|
2019-08-02 21:22:23 +00:00
|
|
|
|
2019-08-16 10:14:23 +00:00
|
|
|
@marks.testrail_id(6224)
|
|
|
|
@marks.critical
|
2020-03-02 16:07:46 +00:00
|
|
|
def test_add_account_to_multiaccount_instance_generate_new(self):
|
2021-02-01 16:09:04 +00:00
|
|
|
home = SignInView(self.driver).create_user()
|
|
|
|
wallet = home.wallet_button.click()
|
|
|
|
wallet.add_account_button.click()
|
|
|
|
wallet.generate_an_account_button.click()
|
|
|
|
wallet.add_account_generate_account_button.click()
|
2020-03-02 16:07:46 +00:00
|
|
|
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.account_name_input.send_keys(account_name)
|
|
|
|
wallet.account_color_button.select_color_by_position(1)
|
|
|
|
if wallet.get_account_by_name(account_name).is_element_displayed():
|
2019-08-16 10:14:23 +00:00
|
|
|
self.driver.fail('Account is added without password')
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.enter_your_password_input.send_keys('000000')
|
|
|
|
wallet.add_account_generate_account_button.click()
|
|
|
|
if not wallet.element_by_text_part('Password seems to be incorrect').is_element_displayed():
|
2020-04-07 14:57:31 +00:00
|
|
|
self.driver.fail("Incorrect password validation is not performed")
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.enter_your_password_input.clear()
|
|
|
|
wallet.enter_your_password_input.send_keys(common_password)
|
|
|
|
wallet.add_account_generate_account_button.click()
|
|
|
|
account_button = wallet.get_account_by_name(account_name)
|
2019-08-16 10:14:23 +00:00
|
|
|
if not account_button.is_element_displayed():
|
|
|
|
self.driver.fail('Account was not added')
|
|
|
|
if not account_button.color_matches('multi_account_color.png'):
|
|
|
|
self.driver.fail('Account color does not match expected')
|
2021-08-19 11:41:41 +00:00
|
|
|
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"!')
|
2019-10-16 11:59:21 +00:00
|
|
|
|
2019-12-20 17:35:36 +00:00
|
|
|
@marks.testrail_id(6244)
|
|
|
|
@marks.high
|
|
|
|
def test_add_and_delete_watch_only_account_to_multiaccount_instance(self):
|
2021-02-01 16:09:04 +00:00
|
|
|
home = SignInView(self.driver).create_user()
|
|
|
|
wallet = home.wallet_button.click()
|
|
|
|
|
|
|
|
wallet.just_fyi('Add watch-only account')
|
|
|
|
wallet.add_account_button.click()
|
|
|
|
wallet.add_watch_only_address_button.click()
|
|
|
|
wallet.enter_address_input.send_keys(basic_user['address'])
|
2019-12-20 17:35:36 +00:00
|
|
|
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.account_name_input.send_keys(account_name)
|
|
|
|
wallet.add_account_generate_account_button.click()
|
|
|
|
account_button = wallet.get_account_by_name(account_name)
|
2019-12-20 17:35:36 +00:00
|
|
|
if not account_button.is_element_displayed():
|
|
|
|
self.driver.fail('Account was not added')
|
|
|
|
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.just_fyi('Check that overall balance is changed after adding watch-only account')
|
2020-05-19 10:40:39 +00:00
|
|
|
for asset in ('ETH', 'ADI', 'STT'):
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.wait_balance_is_changed(asset)
|
2019-12-20 17:35:36 +00:00
|
|
|
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.just_fyi('Check individual watch-only account view, settings and receive option')
|
|
|
|
wallet.get_account_by_name(account_name).click()
|
|
|
|
if wallet.send_transaction_button.is_element_displayed():
|
2019-12-20 17:35:36 +00:00
|
|
|
self.errors.append('Send button is shown on watch-only wallet')
|
2021-02-01 16:09:04 +00:00
|
|
|
if not wallet.element_by_text('Watch-only').is_element_displayed():
|
2019-12-20 17:35:36 +00:00
|
|
|
self.errors.append('No "Watch-only" label is shown on watch-only wallet')
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.receive_transaction_button.click_until_presence_of_element(wallet.address_text)
|
|
|
|
if wallet.address_text.text[2:] != basic_user['address']:
|
|
|
|
self.errors.append('Wrong address %s is shown in "Receive" popup for watch-only account ' % wallet.address_text.text)
|
|
|
|
wallet.close_share_popup()
|
|
|
|
wallet.get_account_options_by_name(account_name).click()
|
|
|
|
wallet.account_settings_button.click()
|
|
|
|
if not wallet.element_by_text('Watch-only').is_element_displayed():
|
2019-12-20 17:35:36 +00:00
|
|
|
self.errors.append('"Watch-only" type is not shown in account settings')
|
|
|
|
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.just_fyi('Delete watch-only account')
|
|
|
|
wallet.delete_account_button.click()
|
|
|
|
wallet.yes_button.click()
|
2019-12-20 17:35:36 +00:00
|
|
|
if account_button.is_element_displayed():
|
|
|
|
self.driver.fail('Account was not deleted')
|
2020-05-19 10:40:39 +00:00
|
|
|
for asset in ('ETH', 'ADI', 'STT'):
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.wait_balance_is_equal_expected_amount(asset, 0)
|
2019-12-20 17:35:36 +00:00
|
|
|
|
|
|
|
self.errors.verify_no_errors()
|
|
|
|
|
2020-03-02 16:07:46 +00:00
|
|
|
@marks.testrail_id(6272)
|
|
|
|
@marks.high
|
2021-02-01 16:09:04 +00:00
|
|
|
def test_add_account_to_wallet_private_key_and_seed_phrase(self):
|
2019-10-16 11:59:21 +00:00
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet = sign_in.wallet_button.click()
|
2019-10-16 11:59:21 +00:00
|
|
|
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.just_fyi('Add account from private key')
|
|
|
|
wallet.add_account_button.click()
|
|
|
|
wallet.enter_a_private_key_button.click()
|
|
|
|
wallet.enter_your_password_input.send_keys(common_password)
|
|
|
|
wallet.enter_a_private_key_input.set_value(wallet_users['C']['private_key'][0:9])
|
2021-08-19 11:41:41 +00:00
|
|
|
account_name_private = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
|
|
|
|
wallet.account_name_input.send_keys(account_name_private)
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.add_account_generate_account_button.click()
|
2021-08-19 11:41:41 +00:00
|
|
|
if wallet.get_account_by_name(account_name_private).is_element_displayed():
|
2021-02-01 16:09:04 +00:00
|
|
|
self.driver.fail('Account is added with wrong private key')
|
|
|
|
wallet.enter_a_private_key_input.set_value(wallet_users['C']['private_key'])
|
|
|
|
wallet.add_account_generate_account_button.click()
|
2021-08-19 11:41:41 +00:00
|
|
|
account_button = wallet.get_account_by_name(account_name_private)
|
2021-02-01 16:09:04 +00:00
|
|
|
if not account_button.is_element_displayed():
|
|
|
|
self.driver.fail('Account from private key was not added')
|
2019-10-16 11:59:21 +00:00
|
|
|
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.just_fyi('Check that overall balance is changed after adding account from private key')
|
|
|
|
for asset in ('ETH', 'ADI', 'LXS', 'STT'):
|
|
|
|
wallet.wait_balance_is_changed(asset)
|
|
|
|
initial_STT = wallet.get_asset_amount_by_name('STT')
|
2019-10-16 11:59:21 +00:00
|
|
|
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.just_fyi('Check individual account view (imported from private key), receive option')
|
2021-08-19 11:41:41 +00:00
|
|
|
wallet.get_account_by_name(account_name_private).scroll_and_click(direction="up")
|
2021-02-01 16:09:04 +00:00
|
|
|
if not wallet.send_transaction_button.is_element_displayed():
|
|
|
|
self.errors.append('Send button is not shown on account added with private key')
|
|
|
|
wallet.receive_transaction_button.click()
|
|
|
|
if wallet.address_text.text[2:] != wallet_users['C']['address']:
|
|
|
|
self.errors.append('Wrong address %s is shown in "Receive" popup account ' % wallet.address_text.text)
|
|
|
|
wallet.wallet_button.double_click()
|
|
|
|
|
|
|
|
wallet.just_fyi('Adding account from seed phrase')
|
|
|
|
wallet.add_account_button.scroll_to_element(direction='left')
|
|
|
|
wallet.add_account_button.click()
|
|
|
|
wallet.enter_a_seed_phrase_button.click()
|
|
|
|
wallet.enter_your_password_input.send_keys(common_password)
|
|
|
|
wallet.enter_seed_phrase_input.set_value('')
|
2021-08-19 11:41:41 +00:00
|
|
|
account_name_seed = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
|
|
|
|
wallet.account_name_input.send_keys(account_name_seed)
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.add_account_generate_account_button.click()
|
2021-08-19 11:41:41 +00:00
|
|
|
if wallet.get_account_by_name(account_name_seed).is_element_displayed():
|
2021-02-01 16:09:04 +00:00
|
|
|
self.driver.fail('Account is added without seed phrase')
|
|
|
|
wallet.enter_seed_phrase_input.set_value(str(wallet_users['C']['passphrase']).upper())
|
|
|
|
wallet.add_account_generate_account_button.click()
|
2021-08-19 11:41:41 +00:00
|
|
|
if wallet.get_account_by_name(account_name_seed).is_element_displayed():
|
2021-02-01 16:09:04 +00:00
|
|
|
self.driver.fail('Same account was added twice')
|
|
|
|
wallet.enter_seed_phrase_input.set_value(str(wallet_users['D']['passphrase']).upper())
|
|
|
|
wallet.add_account_generate_account_button.click()
|
2021-08-19 11:41:41 +00:00
|
|
|
account_button = wallet.get_account_by_name(account_name_seed)
|
2021-02-01 16:09:04 +00:00
|
|
|
if not account_button.is_element_displayed():
|
|
|
|
self.driver.fail('Account was not added')
|
2019-12-18 09:48:08 +00:00
|
|
|
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.just_fyi('Check that overall balance is changed after adding account from seed phrase')
|
|
|
|
wallet.wait_balance_is_changed('STT', initial_balance=initial_STT)
|
|
|
|
wallet.wait_balance_is_changed('MDS')
|
2019-12-18 09:48:08 +00:00
|
|
|
|
2021-02-01 16:09:04 +00:00
|
|
|
wallet.just_fyi('Check account view and send option (imported from seed phrase)')
|
2021-08-19 11:41:41 +00:00
|
|
|
wallet.get_account_by_name(account_name_seed).scroll_and_click(direction="up")
|
2021-02-01 16:09:04 +00:00
|
|
|
if not wallet.send_transaction_button.is_element_displayed():
|
|
|
|
self.errors.append('Send button is not shown on account added with seed phrase')
|
|
|
|
wallet.receive_transaction_button.click()
|
|
|
|
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)
|
2021-08-19 11:41:41 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.verify_no_errors()
|
2020-05-20 15:43:29 +00:00
|
|
|
|
|
|
|
@marks.testrail_id(6269)
|
|
|
|
@marks.medium
|
|
|
|
def test_search_asset_and_currency(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
home = sign_in.create_user()
|
|
|
|
profile = home.profile_button.click()
|
|
|
|
profile.switch_network('Mainnet with upstream RPC')
|
|
|
|
search_list_assets = {
|
|
|
|
'ad': ['AdEx', 'Open Trading Network', 'TrueCAD'],
|
|
|
|
'zs': ['ZSC']
|
|
|
|
}
|
|
|
|
wallet = home.wallet_button.click()
|
|
|
|
|
|
|
|
home.just_fyi('Searching for asset by name and symbol')
|
|
|
|
wallet.multiaccount_more_options.click()
|
|
|
|
wallet.manage_assets_button.click()
|
|
|
|
for keyword in search_list_assets:
|
|
|
|
home.search_by_keyword(keyword)
|
|
|
|
if keyword == 'ad':
|
|
|
|
search_elements = wallet.all_assets_full_names.find_elements()
|
|
|
|
else:
|
|
|
|
search_elements = wallet.all_assets_symbols.find_elements()
|
|
|
|
if not search_elements:
|
|
|
|
self.errors.append('No search results after searching by %s keyword' % keyword)
|
|
|
|
search_results = [element.text for element in search_elements]
|
|
|
|
if search_results != search_list_assets[keyword]:
|
|
|
|
self.errors.append("'%s' is shown on the home screen after searching by '%s' keyword" %
|
2020-05-22 08:49:30 +00:00
|
|
|
(', '.join(search_results), keyword))
|
2020-05-20 15:43:29 +00:00
|
|
|
home.cancel_button.click()
|
2021-06-23 15:12:42 +00:00
|
|
|
wallet.close_button.click()
|
2020-05-20 15:43:29 +00:00
|
|
|
|
|
|
|
home.just_fyi('Searching for currency')
|
|
|
|
search_list_currencies = {
|
2020-05-22 08:49:30 +00:00
|
|
|
'aF': ['Afghanistan Afghani (AFN)', 'South Africa Rand (ZAR)'],
|
2020-05-20 15:43:29 +00:00
|
|
|
'bolívi': ['Bolivia Bolíviano (BOB)']
|
|
|
|
}
|
|
|
|
wallet.multiaccount_more_options.click_until_presence_of_element(wallet.set_currency_button)
|
|
|
|
wallet.set_currency_button.click()
|
|
|
|
for keyword in search_list_currencies:
|
|
|
|
home.search_by_keyword(keyword)
|
|
|
|
search_elements = wallet.currency_item_text.find_elements()
|
|
|
|
if not search_elements:
|
|
|
|
self.errors.append('No search results after searching by %s keyword' % keyword)
|
|
|
|
search_results = [element.text for element in search_elements]
|
2020-05-22 08:49:30 +00:00
|
|
|
if search_results != search_list_currencies[keyword]:
|
2020-05-20 15:43:29 +00:00
|
|
|
self.errors.append("'%s' is shown on the home screen after searching by '%s' keyword" %
|
2020-05-22 08:49:30 +00:00
|
|
|
(', '.join(search_results), keyword))
|
2020-05-20 15:43:29 +00:00
|
|
|
home.cancel_button.click()
|
|
|
|
|
|
|
|
self.errors.verify_no_errors()
|