2018-06-29 17:27:30 +00:00
|
|
|
import pytest
|
|
|
|
|
2018-09-17 08:50:01 +00:00
|
|
|
from tests import marks, camera_access_error_text
|
2018-06-29 17:27:30 +00:00
|
|
|
from tests.base_test_case import SingleDeviceTestCase
|
2018-09-17 08:50:01 +00:00
|
|
|
from tests.users import wallet_users
|
2018-06-29 17:27:30 +00:00
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
|
|
|
|
|
|
|
|
@marks.all
|
|
|
|
@marks.account
|
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
|
2019-06-28 14:36:24 +00:00
|
|
|
@marks.skip
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_wallet_set_up(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
wallet = sign_in.wallet_button.click()
|
|
|
|
text = 'Simple and secure cryptocurrency wallet'
|
|
|
|
if not wallet.element_by_text(text).is_element_displayed():
|
|
|
|
self.errors.append("'%s' is not displayed" % text)
|
|
|
|
wallet.set_up_button.click()
|
2018-11-14 17:18:57 +00:00
|
|
|
texts = ['Super-safe transactions', 'You should see these three words before signing each transaction',
|
|
|
|
'If you see a different combo, cancel the transaction and logout.']
|
|
|
|
for text in texts:
|
|
|
|
if not wallet.element_by_text_part(text).is_element_displayed():
|
|
|
|
self.errors.append("'%s' text is not displayed" % text)
|
2018-06-29 17:27:30 +00:00
|
|
|
phrase_length = len(wallet.sign_in_phrase.list)
|
|
|
|
if phrase_length != 3:
|
|
|
|
self.errors.append('Transaction phrase length is %s' % phrase_length)
|
|
|
|
wallet.done_button.click()
|
2018-11-14 17:18:57 +00:00
|
|
|
for text in ['Remember this!', "You'll need to recognize this to ensure your "
|
|
|
|
"transactions are safe. This combo is not stored in your account."]:
|
2018-06-29 17:27:30 +00:00
|
|
|
if not wallet.element_by_text(text).is_element_displayed():
|
|
|
|
self.errors.append("'%s' text is not displayed" % text)
|
|
|
|
wallet.yes_button.click()
|
|
|
|
for element in [wallet.send_transaction_button, wallet.receive_transaction_button,
|
|
|
|
wallet.transaction_history_button]:
|
|
|
|
if not element.is_element_displayed():
|
|
|
|
self.errors.append('%s button is not shown after wallet setup' % element.name)
|
|
|
|
self.verify_no_errors()
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5384)
|
2019-05-07 15:21:30 +00:00
|
|
|
@marks.critical
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_open_transaction_on_etherscan(self):
|
2018-09-17 08:50:01 +00:00
|
|
|
user = wallet_users['A']
|
2018-06-29 17:27:30 +00:00
|
|
|
sign_in_view = SignInView(self.driver)
|
2018-09-17 08:50:01 +00:00
|
|
|
home_view = sign_in_view.recover_access(user['passphrase'])
|
2018-06-29 17:27:30 +00:00
|
|
|
wallet_view = home_view.wallet_button.click()
|
2019-07-12 07:16:02 +00:00
|
|
|
wallet_view.set_up_wallet()
|
2019-06-24 15:53:02 +00:00
|
|
|
wallet_view.accounts_status_account.click()
|
2018-06-29 17:27:30 +00:00
|
|
|
transactions_view = wallet_view.transaction_history_button.click()
|
2018-07-26 18:58:05 +00:00
|
|
|
transaction_details = transactions_view.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()
|
2018-07-16 12:57:01 +00:00
|
|
|
base_web_view = wallet_view.get_base_web_view()
|
2018-07-06 11:10:48 +00:00
|
|
|
base_web_view.open_in_webview()
|
2018-06-29 17:27:30 +00:00
|
|
|
base_web_view.find_text_part(transaction_hash)
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5427)
|
|
|
|
@marks.medium
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_copy_transaction_hash(self):
|
2018-09-17 08:50:01 +00:00
|
|
|
user = wallet_users['A']
|
2018-06-29 17:27:30 +00:00
|
|
|
sign_in_view = SignInView(self.driver)
|
2018-09-17 08:50:01 +00:00
|
|
|
home_view = sign_in_view.recover_access(user['passphrase'])
|
2018-06-29 17:27:30 +00:00
|
|
|
wallet_view = home_view.wallet_button.click()
|
2019-07-12 07:16:02 +00:00
|
|
|
wallet_view.set_up_wallet()
|
2019-06-28 14:36:24 +00:00
|
|
|
wallet_view.accounts_status_account.click()
|
2018-06-29 17:27:30 +00:00
|
|
|
transactions_view = wallet_view.transaction_history_button.click()
|
2018-07-26 18:58:05 +00:00
|
|
|
transaction_details = transactions_view.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.copy_transaction_hash_button.click()
|
|
|
|
transaction_details.get_back_to_home_view()
|
|
|
|
wallet_view.home_button.click()
|
2018-07-03 12:40:44 +00:00
|
|
|
public_chat = home_view.join_public_chat('testchat')
|
|
|
|
public_chat.chat_message_input.paste_text_from_clipboard()
|
|
|
|
if public_chat.chat_message_input.text != transaction_hash:
|
2018-06-29 17:27:30 +00:00
|
|
|
pytest.fail('Transaction hash was not copied')
|
|
|
|
|
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-07-12 07:16:02 +00:00
|
|
|
wallet.set_up_wallet()
|
2019-05-27 16:45:20 +00:00
|
|
|
asset = "MDS"
|
|
|
|
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)
|
|
|
|
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)
|
2018-06-29 17:27:30 +00:00
|
|
|
self.verify_no_errors()
|
2018-07-06 11:10:48 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5358)
|
|
|
|
@marks.critical
|
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-07-12 07:16:02 +00:00
|
|
|
wallet.set_up_wallet()
|
2019-06-24 15:53:02 +00:00
|
|
|
# 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():
|
2019-07-24 11:36:46 +00:00
|
|
|
pytest.fail("'Back up your recovery phrase' warning is not shown on Wallet")
|
2019-07-03 14:29:01 +00:00
|
|
|
wallet.multiaccount_more_options.click_until_presence_of_element(wallet.backup_recovery_phrase)
|
2018-07-06 11:10:48 +00:00
|
|
|
profile = wallet.get_profile_view()
|
2018-07-16 12:57:01 +00:00
|
|
|
profile.backup_recovery_phrase()
|
2018-07-19 09:57:45 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5440)
|
|
|
|
@marks.medium
|
2018-07-19 09:57:45 +00:00
|
|
|
def test_no_collectibles_to_send_from_wallet(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
profile = sign_in.profile_button.click()
|
|
|
|
profile.switch_network('Mainnet with upstream RPC')
|
|
|
|
wallet = sign_in.wallet_button.click()
|
2019-07-12 07:16:02 +00:00
|
|
|
wallet.set_up_wallet()
|
2018-07-19 09:57:45 +00:00
|
|
|
asset_name = 'CryptoKitties'
|
2019-05-27 16:45:20 +00:00
|
|
|
wallet.select_asset(asset_name)
|
2019-06-28 14:36:24 +00:00
|
|
|
wallet.accounts_status_account.click()
|
2018-07-19 09:57:45 +00:00
|
|
|
send_transaction = wallet.send_transaction_button.click()
|
|
|
|
send_transaction.select_asset_button.click()
|
|
|
|
if send_transaction.asset_by_name(asset_name).is_element_displayed():
|
|
|
|
pytest.fail('Collectibles can be sent from wallet')
|
2018-07-20 08:27:33 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5467)
|
|
|
|
@marks.medium
|
2018-07-20 08:27:33 +00:00
|
|
|
def test_deny_camera_access_scanning_wallet_adders(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
wallet = sign_in.wallet_button.click()
|
2019-07-12 07:16:02 +00:00
|
|
|
wallet.set_up_wallet()
|
2019-06-28 14:36:24 +00:00
|
|
|
wallet.accounts_status_account.click()
|
2018-07-20 08:27:33 +00:00
|
|
|
send_transaction = wallet.send_transaction_button.click()
|
|
|
|
send_transaction.chose_recipient_button.click()
|
|
|
|
send_transaction.scan_qr_code_button.click()
|
|
|
|
send_transaction.deny_button.click()
|
|
|
|
send_transaction.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
|
|
|
|
send_transaction.ok_button.click()
|
|
|
|
send_transaction.chose_recipient_button.click()
|
|
|
|
send_transaction.scan_qr_code_button.click()
|
|
|
|
send_transaction.deny_button.wait_for_visibility_of_element(2)
|
2018-07-26 18:58:05 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5435)
|
|
|
|
@marks.medium
|
2019-06-28 14:36:24 +00:00
|
|
|
@marks.skip
|
2018-07-26 18:58:05 +00:00
|
|
|
def test_filter_transactions_history(self):
|
2018-09-17 08:50:01 +00:00
|
|
|
user = wallet_users['C']
|
2018-07-26 18:58:05 +00:00
|
|
|
sign_in_view = SignInView(self.driver)
|
2018-09-17 08:50:01 +00:00
|
|
|
sign_in_view.recover_access(passphrase=user['passphrase'])
|
2018-07-26 18:58:05 +00:00
|
|
|
wallet_view = sign_in_view.wallet_button.click()
|
2019-07-12 07:16:02 +00:00
|
|
|
wallet_view.set_up_wallet()
|
2019-06-28 14:36:24 +00:00
|
|
|
wallet_view.accounts_status_account.click()
|
2018-07-26 18:58:05 +00:00
|
|
|
transaction_history = wallet_view.transaction_history_button.click()
|
|
|
|
transaction_history.filters_button.click()
|
|
|
|
for filter_name in 'Outgoing', 'Pending', 'Failed':
|
|
|
|
transaction_history.filter_checkbox(filter_name).click()
|
|
|
|
wallet_view.done_button.click()
|
|
|
|
for i in range(transaction_history.transactions_table.get_transactions_number()):
|
|
|
|
details = transaction_history.transactions_table.transaction_by_index(i).click()
|
|
|
|
if details.get_recipient_address() != '0x' + user['address'] \
|
|
|
|
or details.element_by_text('Failed').is_element_displayed():
|
|
|
|
pytest.fail('Incoming transactions are not filtered')
|
|
|
|
details.back_button.click()
|
|
|
|
|
|
|
|
transaction_history.filters_button.click()
|
|
|
|
for filter_name in 'Outgoing', 'Incoming':
|
|
|
|
transaction_history.filter_checkbox(filter_name).click()
|
|
|
|
wallet_view.done_button.click()
|
|
|
|
for i in range(transaction_history.transactions_table.get_transactions_number()):
|
|
|
|
details = transaction_history.transactions_table.transaction_by_index(i).click()
|
|
|
|
if details.get_sender_address() != '0x' + user['address'] \
|
|
|
|
or details.element_by_text('Failed').is_element_displayed():
|
|
|
|
pytest.fail('Outgoing transactions are not filtered')
|
|
|
|
details.back_button.click()
|
|
|
|
|
|
|
|
transaction_history.filters_button.click()
|
|
|
|
for filter_name in 'Outgoing', 'Failed':
|
|
|
|
transaction_history.filter_checkbox(filter_name).click()
|
|
|
|
wallet_view.done_button.click()
|
|
|
|
for i in range(transaction_history.transactions_table.get_transactions_number()):
|
|
|
|
details = transaction_history.transactions_table.transaction_by_index(i).click()
|
|
|
|
if not details.element_by_text('Failed').is_element_displayed():
|
|
|
|
pytest.fail('Failed transactions are not filtered')
|
|
|
|
details.back_button.click()
|
|
|
|
self.verify_no_errors()
|
2018-11-09 12:36:21 +00:00
|
|
|
|
|
|
|
@marks.testrail_id(5381)
|
|
|
|
@marks.high
|
|
|
|
def test_user_can_see_all_own_assets_after_account_recovering(self):
|
2018-11-29 09:41:53 +00:00
|
|
|
passphrase = wallet_users['E']['passphrase']
|
2018-11-09 12:36:21 +00:00
|
|
|
signin_view = SignInView(self.driver)
|
|
|
|
home_view = signin_view.recover_access(passphrase=passphrase)
|
|
|
|
profile = home_view.profile_button.click()
|
|
|
|
profile.switch_network('Rinkeby with upstream RPC')
|
|
|
|
profile = home_view.profile_button.click()
|
|
|
|
wallet_view = profile.wallet_button.click()
|
2019-07-12 07:16:02 +00:00
|
|
|
wallet_view.set_up_wallet()
|
2019-06-28 14:36:24 +00:00
|
|
|
wallet_view.collectibles_button.click()
|
|
|
|
if not wallet_view.element_by_text('KDO').is_element_displayed():
|
|
|
|
self.driver.fail('User collectibles token name in not shown')
|
|
|
|
if not wallet_view.element_by_text('1').is_element_displayed():
|
|
|
|
self.driver.fail('User collectibles amount does not match')
|