2018-06-29 17:27:30 +00:00
|
|
|
|
import pytest
|
|
|
|
|
|
2018-07-20 08:27:33 +00:00
|
|
|
|
from tests import marks, transaction_users, camera_access_error_text
|
2018-06-29 17:27:30 +00:00
|
|
|
|
from tests.base_test_case import SingleDeviceTestCase
|
|
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@marks.all
|
|
|
|
|
@marks.account
|
|
|
|
|
class TestWallet(SingleDeviceTestCase):
|
|
|
|
|
|
|
|
|
|
@marks.testrail_id(3698)
|
2018-07-06 11:10:48 +00:00
|
|
|
|
@marks.smoke_1
|
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()
|
|
|
|
|
text = ('This is your personal transaction phrase that you’ll use everytime you make a transaction. '
|
|
|
|
|
'Make sure to write it down on a piece of paper, store it somewhere, '
|
|
|
|
|
'and only confirm transactions when you see these three words.')
|
|
|
|
|
if not wallet.element_by_text(text).is_element_displayed():
|
|
|
|
|
self.errors.append("'%s' text is not displayed" % text)
|
|
|
|
|
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()
|
|
|
|
|
for text in ['Wrote it down?', 'You won’t be able to see your 3-word transaction phrase again after this.']:
|
|
|
|
|
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()
|
|
|
|
|
|
|
|
|
|
@marks.testrail_id(1449)
|
|
|
|
|
def test_open_transaction_on_etherscan(self):
|
|
|
|
|
user = transaction_users['A_USER']
|
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
|
home_view = sign_in_view.recover_access(user['passphrase'], user['password'])
|
|
|
|
|
wallet_view = home_view.wallet_button.click()
|
|
|
|
|
wallet_view.set_up_wallet()
|
|
|
|
|
transactions_view = wallet_view.transaction_history_button.click()
|
|
|
|
|
transaction_details = transactions_view.transactions_table.get_first_transaction().click()
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
@marks.testrail_id(1450)
|
|
|
|
|
def test_copy_transaction_hash(self):
|
|
|
|
|
user = transaction_users['A_USER']
|
|
|
|
|
sign_in_view = SignInView(self.driver)
|
|
|
|
|
home_view = sign_in_view.recover_access(user['passphrase'], user['password'])
|
|
|
|
|
wallet_view = home_view.wallet_button.click()
|
|
|
|
|
wallet_view.set_up_wallet()
|
|
|
|
|
transactions_view = wallet_view.transaction_history_button.click()
|
|
|
|
|
transaction_details = transactions_view.transactions_table.get_first_transaction().click()
|
|
|
|
|
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')
|
|
|
|
|
|
|
|
|
|
@marks.testrail_id(3713)
|
2018-07-06 11:10:48 +00:00
|
|
|
|
@marks.smoke_1
|
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()
|
|
|
|
|
wallet.set_up_wallet()
|
|
|
|
|
wallet.options_button.click()
|
|
|
|
|
wallet.manage_assets_button.click()
|
|
|
|
|
select_asset = 'MDS'
|
|
|
|
|
deselect_asset = 'STT'
|
|
|
|
|
wallet.asset_checkbox_by_name(select_asset).click()
|
|
|
|
|
wallet.asset_checkbox_by_name(deselect_asset).click()
|
|
|
|
|
wallet.done_button.click()
|
|
|
|
|
if not wallet.asset_by_name(select_asset).is_element_displayed():
|
|
|
|
|
self.errors.append('%s asset is not shown in wallet' % select_asset)
|
|
|
|
|
if wallet.asset_by_name(deselect_asset).is_element_displayed():
|
|
|
|
|
self.errors.append('%s asset is shown in wallet but was deselected' % deselect_asset)
|
|
|
|
|
self.verify_no_errors()
|
2018-07-06 11:10:48 +00:00
|
|
|
|
|
|
|
|
|
@marks.testrail_id(3725)
|
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()
|
|
|
|
|
wallet.set_up_wallet()
|
2018-07-16 12:57:01 +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")
|
2018-07-06 11:10:48 +00:00
|
|
|
|
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()
|
2018-07-16 12:57:01 +00:00
|
|
|
|
if not wallet.backup_recovery_phrase.is_element_present():
|
|
|
|
|
pytest.fail("'Backup your Recovery phrase' option is not shown on Wallet for an account with funds")
|
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
|
|
|
|
|
|
|
|
|
@marks.testrail_id(3777)
|
|
|
|
|
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')
|
|
|
|
|
sign_in.sign_in()
|
|
|
|
|
wallet = sign_in.wallet_button.click()
|
|
|
|
|
wallet.set_up_wallet()
|
|
|
|
|
wallet.options_button.click()
|
|
|
|
|
wallet.manage_assets_button.click()
|
|
|
|
|
asset_name = 'CryptoKitties'
|
|
|
|
|
wallet.asset_checkbox_by_name(asset_name).click()
|
|
|
|
|
wallet.done_button.click()
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
@marks.testrail_id(2176)
|
|
|
|
|
def test_deny_camera_access_scanning_wallet_adders(self):
|
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
|
sign_in.create_user()
|
|
|
|
|
wallet = sign_in.wallet_button.click()
|
|
|
|
|
wallet.set_up_wallet()
|
|
|
|
|
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)
|