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)
|
2018-07-06 11:10:48 +00:00
|
|
|
@marks.smoke_1
|
2018-06-29 17:27:30 +00:00
|
|
|
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()
|
2018-07-04 13:40:52 +00:00
|
|
|
profile.backup_recovery_phrase_button.click()
|
2018-06-29 17:27:30 +00:00
|
|
|
profile.ok_continue_button.click()
|
2018-07-04 13:40:52 +00:00
|
|
|
recovery_phrase = profile.get_recovery_phrase()
|
2018-06-29 17:27:30 +00:00
|
|
|
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()
|
2018-07-04 13:40:52 +00:00
|
|
|
sign_in.recover_access(passphrase=' '.join(recovery_phrase.values()), password=common_password)
|
2018-06-29 17:27:30 +00:00
|
|
|
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()
|
2018-07-04 13:40:52 +00:00
|
|
|
profile.backup_recovery_phrase_button.click()
|
2018-06-29 17:27:30 +00:00
|
|
|
profile.ok_continue_button.click()
|
2018-07-04 13:40:52 +00:00
|
|
|
recovery_phrase = profile.get_recovery_phrase()
|
2018-06-29 17:27:30 +00:00
|
|
|
|
|
|
|
self.driver.reset()
|
|
|
|
sign_in.accept_agreements()
|
2018-07-04 13:40:52 +00:00
|
|
|
sign_in.recover_access(passphrase=' '.join(list(recovery_phrase.values())[::-1]), password=common_password)
|
2018-06-29 17:27:30 +00:00
|
|
|
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
|
|
|
|
2018-07-11 14:14:39 +00:00
|
|
|
@marks.logcat
|
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'])
|
2018-07-17 16:27:00 +00:00
|
|
|
sign_in.check_no_values_in_logcat(passphrase=basic_user['passphrase'], password=basic_user['password'])
|