2018-06-29 17:27:30 +00:00
|
|
|
import pytest
|
|
|
|
|
2018-07-09 19:47:50 +00:00
|
|
|
from tests import marks, common_password, basic_user
|
2018-07-03 12:40:44 +00:00
|
|
|
from tests.base_test_case import SingleDeviceTestCase
|
2018-06-29 17:27:30 +00:00
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
|
|
|
|
|
|
|
|
@marks.all
|
|
|
|
@marks.account
|
2018-07-03 12:40:44 +00:00
|
|
|
class TestRecoverAccountSingleDevice(SingleDeviceTestCase):
|
2018-06-29 17:27:30 +00:00
|
|
|
|
|
|
|
@marks.testrail_id(759)
|
|
|
|
def test_recover_account(self):
|
2018-07-03 12:40:44 +00:00
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
home = sign_in.create_user()
|
2018-06-29 17:27:30 +00:00
|
|
|
public_key = home.get_public_key()
|
|
|
|
profile = home.get_profile_view()
|
|
|
|
profile.backup_seed_phrase_button.click()
|
|
|
|
profile.ok_continue_button.click()
|
|
|
|
seed_phrase = profile.get_seed_phrase()
|
|
|
|
profile.back_button.click()
|
2018-07-03 12:40:44 +00:00
|
|
|
wallet = profile.wallet_button.click()
|
2018-06-29 17:27:30 +00:00
|
|
|
wallet.set_up_wallet()
|
|
|
|
address = wallet.get_wallet_address()
|
2018-07-03 12:40:44 +00:00
|
|
|
self.driver.reset()
|
2018-06-29 17:27:30 +00:00
|
|
|
sign_in.accept_agreements()
|
|
|
|
sign_in.recover_access(passphrase=' '.join(seed_phrase.values()), password=common_password)
|
|
|
|
home.connection_status.wait_for_invisibility_of_element(30)
|
|
|
|
home.wallet_button.click()
|
|
|
|
wallet.set_up_wallet()
|
2018-07-03 12:40:44 +00:00
|
|
|
address2 = wallet.get_wallet_address()
|
|
|
|
if address2 != address:
|
|
|
|
self.errors.append('Wallet address is %s after recovery, but %s is expected' % (address2, address))
|
|
|
|
public_key2 = wallet.get_public_key()
|
|
|
|
if public_key2 != public_key:
|
|
|
|
self.errors.append('Public key is %s after recovery, but %s is expected' % (public_key2, public_key))
|
2018-06-29 17:27:30 +00:00
|
|
|
self.verify_no_errors()
|
|
|
|
|
2018-07-03 12:40:44 +00:00
|
|
|
@marks.skip
|
2018-06-29 17:27:30 +00:00
|
|
|
@marks.testrail_id(845)
|
|
|
|
def test_recover_account_with_incorrect_passphrase(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
public_key = sign_in.get_public_key()
|
|
|
|
profile = sign_in.get_profile_view()
|
|
|
|
profile.backup_seed_phrase_button.click()
|
|
|
|
profile.ok_continue_button.click()
|
|
|
|
seed_phrase = profile.get_seed_phrase()
|
|
|
|
|
|
|
|
self.driver.reset()
|
|
|
|
sign_in.accept_agreements()
|
|
|
|
sign_in.recover_access(passphrase=' '.join(list(seed_phrase.values())[::-1]), password=common_password)
|
|
|
|
if sign_in.get_public_key() == public_key:
|
|
|
|
pytest.fail('The same account is recovered with reversed passphrase')
|
2018-07-09 19:47:50 +00:00
|
|
|
|
|
|
|
@marks.testrail_id(3769)
|
|
|
|
def test_logcat_recovering_account(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.recover_access(basic_user['passphrase'], basic_user['password'])
|
|
|
|
sign_in.check_no_value_in_logcat(basic_user['passphrase'], 'Passphrase')
|
|
|
|
sign_in.check_no_value_in_logcat(basic_user['password'])
|