mirror of
https://github.com/status-im/status-react.git
synced 2025-01-11 03:26:31 +00:00
pairing e2e
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com> Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
parent
68a07740d8
commit
2334de58d2
@ -1,8 +1,8 @@
|
|||||||
from tests import marks
|
from tests import marks, pair_code
|
||||||
from tests.base_test_case import SingleDeviceTestCase
|
from tests.base_test_case import SingleDeviceTestCase
|
||||||
from views.sign_in_view import SignInView
|
from views.sign_in_view import SignInView
|
||||||
from views.keycard_view import KeycardView
|
from views.keycard_view import KeycardView
|
||||||
from tests.users import basic_user
|
from tests.users import basic_user, transaction_senders
|
||||||
|
|
||||||
|
|
||||||
@marks.all
|
@marks.all
|
||||||
@ -48,7 +48,7 @@ class TestCreateAccount(SingleDeviceTestCase):
|
|||||||
wallet_view.set_up_wallet()
|
wallet_view.set_up_wallet()
|
||||||
for asset in ['ETH', 'ADI', 'STT']:
|
for asset in ['ETH', 'ADI', 'STT']:
|
||||||
if wallet_view.get_asset_amount_by_name(asset) == 0:
|
if wallet_view.get_asset_amount_by_name(asset) == 0:
|
||||||
self.errors.append('Asset %s was not restored')
|
self.errors.append('Asset %s was not restored' % asset)
|
||||||
|
|
||||||
sign_in.just_fyi('Check that wallet address matches expected')
|
sign_in.just_fyi('Check that wallet address matches expected')
|
||||||
address = wallet_view.get_wallet_address()
|
address = wallet_view.get_wallet_address()
|
||||||
@ -65,11 +65,7 @@ class TestCreateAccount(SingleDeviceTestCase):
|
|||||||
profile_view.logout()
|
profile_view.logout()
|
||||||
|
|
||||||
sign_in.just_fyi('Check that can login with restored from mnemonic keycard account')
|
sign_in.just_fyi('Check that can login with restored from mnemonic keycard account')
|
||||||
sign_in.multi_account_on_login_button.wait_for_visibility_of_element(5)
|
sign_in.sign_in(keycard=True)
|
||||||
sign_in.multi_account_on_login_button.click()
|
|
||||||
keycard_view = KeycardView(self.driver)
|
|
||||||
keycard_view.connect_selected_card_button.click()
|
|
||||||
keycard_view.enter_default_pin()
|
|
||||||
if not sign_in.home_button.is_element_displayed(10):
|
if not sign_in.home_button.is_element_displayed(10):
|
||||||
self.driver.fail('Keycard user is not logged in')
|
self.driver.fail('Keycard user is not logged in')
|
||||||
|
|
||||||
@ -130,8 +126,9 @@ class TestCreateAccount(SingleDeviceTestCase):
|
|||||||
self.errors.append('Another seed phrase is shown after cancelling setup during Back up seed phrase')
|
self.errors.append('Another seed phrase is shown after cancelling setup during Back up seed phrase')
|
||||||
keycard_flow.backup_seed_phrase()
|
keycard_flow.backup_seed_phrase()
|
||||||
keycard_flow.enter_default_pin()
|
keycard_flow.enter_default_pin()
|
||||||
sign_in.lets_go_button.wait_for_visibility_of_element(30)
|
for element in sign_in.maybe_later_button, sign_in.lets_go_button:
|
||||||
sign_in.lets_go_button.click_until_absense_of_element(sign_in.lets_go_button)
|
element.wait_for_visibility_of_element(30)
|
||||||
|
element.click()
|
||||||
sign_in.profile_button.wait_for_visibility_of_element(30)
|
sign_in.profile_button.wait_for_visibility_of_element(30)
|
||||||
|
|
||||||
sign_in.just_fyi('Check username and relogin')
|
sign_in.just_fyi('Check username and relogin')
|
||||||
@ -140,7 +137,9 @@ class TestCreateAccount(SingleDeviceTestCase):
|
|||||||
if real_username != username:
|
if real_username != username:
|
||||||
self.errors.append('Username was changed after interruption of creating account')
|
self.errors.append('Username was changed after interruption of creating account')
|
||||||
profile.logout()
|
profile.logout()
|
||||||
sign_in.sign_in(keycard=True)
|
home = sign_in.sign_in(keycard=True)
|
||||||
|
if not home.wallet_button.is_element_displayed(10):
|
||||||
|
self.errors.append("Failed to login to Keycard account")
|
||||||
self.errors.verify_no_errors()
|
self.errors.verify_no_errors()
|
||||||
|
|
||||||
@marks.testrail_id(6246)
|
@marks.testrail_id(6246)
|
||||||
@ -185,8 +184,9 @@ class TestCreateAccount(SingleDeviceTestCase):
|
|||||||
keycard_flow.pair_code_input.set_value(pair_code)
|
keycard_flow.pair_code_input.set_value(pair_code)
|
||||||
keycard_flow.pair_to_this_device_button.click()
|
keycard_flow.pair_to_this_device_button.click()
|
||||||
keycard_flow.enter_default_pin()
|
keycard_flow.enter_default_pin()
|
||||||
sign_in.lets_go_button.wait_for_visibility_of_element(30)
|
for element in sign_in.maybe_later_button, sign_in.lets_go_button:
|
||||||
sign_in.lets_go_button.click_until_absense_of_element(sign_in.lets_go_button)
|
element.wait_for_visibility_of_element(30)
|
||||||
|
element.click()
|
||||||
sign_in.profile_button.wait_for_visibility_of_element(30)
|
sign_in.profile_button.wait_for_visibility_of_element(30)
|
||||||
public_key, default_username = sign_in.get_public_key_and_username(return_username=True)
|
public_key, default_username = sign_in.get_public_key_and_username(return_username=True)
|
||||||
profile_view = sign_in.get_profile_view()
|
profile_view = sign_in.get_profile_view()
|
||||||
@ -199,3 +199,49 @@ class TestCreateAccount(SingleDeviceTestCase):
|
|||||||
if not home.wallet_button.is_element_displayed(10):
|
if not home.wallet_button.is_element_displayed(10):
|
||||||
self.errors.append("Failed to login to Keycard account")
|
self.errors.append("Failed to login to Keycard account")
|
||||||
self.errors.verify_no_errors()
|
self.errors.verify_no_errors()
|
||||||
|
|
||||||
|
@marks.testrail_id(5758)
|
||||||
|
@marks.high
|
||||||
|
def test_can_recover_keycard_account_card_pairing(self):
|
||||||
|
sign_in = SignInView(self.driver)
|
||||||
|
recovered_user = transaction_senders['A']
|
||||||
|
|
||||||
|
sign_in.just_fyi('Recover multiaccount')
|
||||||
|
sign_in.get_started_button.click_until_presence_of_element(sign_in.access_key_button)
|
||||||
|
sign_in.access_key_button.click()
|
||||||
|
sign_in.recover_with_keycard_button.click()
|
||||||
|
keycard_view = sign_in.begin_recovery_button.click()
|
||||||
|
keycard_view.connect_pairing_card_button.click()
|
||||||
|
keycard_view.pair_code_input.set_value(pair_code)
|
||||||
|
sign_in.pair_to_this_device_button.click()
|
||||||
|
keycard_view.enter_default_pin()
|
||||||
|
sign_in.home_button.wait_for_visibility_of_element(30)
|
||||||
|
|
||||||
|
sign_in.just_fyi('Check assets after pairing keycard for recovered multiaccount')
|
||||||
|
wallet_view = sign_in.wallet_button.click()
|
||||||
|
wallet_view.set_up_wallet()
|
||||||
|
for asset in ['ETH', 'LXS']:
|
||||||
|
if wallet_view.get_asset_amount_by_name(asset) == 0:
|
||||||
|
self.errors.append("%s value is not restored" % asset)
|
||||||
|
|
||||||
|
sign_in.just_fyi('Check that wallet address matches expected for recovered multiaccount')
|
||||||
|
address = wallet_view.get_wallet_address()
|
||||||
|
if str(address).lower() != '0x%s' % recovered_user['address']:
|
||||||
|
self.errors.append('Restored address %s does not match expected' % address)
|
||||||
|
|
||||||
|
sign_in.just_fyi('Check that username and public key match expected for recovered multiaccount')
|
||||||
|
public_key, default_username = sign_in.get_public_key_and_username(return_username=True)
|
||||||
|
profile_view = sign_in.get_profile_view()
|
||||||
|
if public_key != recovered_user['public_key']:
|
||||||
|
self.errors.append('Public key %s does not match expected' % public_key)
|
||||||
|
if default_username != recovered_user['username']:
|
||||||
|
self.errors.append('Default username %s does not match expected' % default_username)
|
||||||
|
profile_view.logout()
|
||||||
|
|
||||||
|
sign_in.just_fyi('Check that can login with recovered keycard account')
|
||||||
|
sign_in.sign_in(keycard=True)
|
||||||
|
if not sign_in.home_button.is_element_displayed(10):
|
||||||
|
self.driver.fail('Keycard user is not logged in')
|
||||||
|
|
||||||
|
self.errors.verify_no_errors()
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
|
|||||||
if not status_test_dapp.element_by_text(text).is_element_displayed(180):
|
if not status_test_dapp.element_by_text(text).is_element_displayed(180):
|
||||||
self.driver.fail('Contract was not created')
|
self.driver.fail('Contract was not created')
|
||||||
|
|
||||||
@marks.testrail_id(5784)
|
@marks.testrail_id(6310)
|
||||||
@marks.medium
|
@marks.medium
|
||||||
def test_keycard_sign_typed_message(self):
|
def test_keycard_sign_typed_message(self):
|
||||||
sender = transaction_senders['W']
|
sender = transaction_senders['W']
|
||||||
|
@ -73,6 +73,13 @@ class PairToThisDeviceButton(BaseButton):
|
|||||||
super(PairToThisDeviceButton, self).__init__(driver)
|
super(PairToThisDeviceButton, self).__init__(driver)
|
||||||
self.locator = self.Locator.text_selector("Pair to this device")
|
self.locator = self.Locator.text_selector("Pair to this device")
|
||||||
|
|
||||||
|
|
||||||
|
class ConnectPairingCardButton(BaseButton):
|
||||||
|
def __init__(self, driver):
|
||||||
|
super(ConnectPairingCardButton, self).__init__(driver)
|
||||||
|
self.locator = self.Locator.accessibility_id("connect-pairing-card")
|
||||||
|
|
||||||
|
|
||||||
class KeycardView(BaseView):
|
class KeycardView(BaseView):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(KeycardView, self).__init__(driver)
|
super(KeycardView, self).__init__(driver)
|
||||||
@ -84,6 +91,7 @@ class KeycardView(BaseView):
|
|||||||
self.pair_code_text = PairCodeText(self.driver)
|
self.pair_code_text = PairCodeText(self.driver)
|
||||||
self.pair_code_input = PairCodeInput(self.driver)
|
self.pair_code_input = PairCodeInput(self.driver)
|
||||||
self.pair_to_this_device_button = PairToThisDeviceButton(self.driver)
|
self.pair_to_this_device_button = PairToThisDeviceButton(self.driver)
|
||||||
|
self.connect_pairing_card_button = ConnectPairingCardButton(self.driver)
|
||||||
|
|
||||||
#keyboard
|
#keyboard
|
||||||
self.one_button = OnePinKeyboardButton(self.driver)
|
self.one_button = OnePinKeyboardButton(self.driver)
|
||||||
|
@ -3,40 +3,36 @@ from views.sign_in_view import SignInView
|
|||||||
|
|
||||||
|
|
||||||
class SeedphraseInput(BaseEditBox):
|
class SeedphraseInput(BaseEditBox):
|
||||||
|
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(SeedphraseInput, self).__init__(driver)
|
super(SeedphraseInput, self).__init__(driver)
|
||||||
self.locator = self.Locator.xpath_selector("//android.widget.EditText")
|
self.locator = self.Locator.xpath_selector("//android.widget.EditText")
|
||||||
|
|
||||||
|
|
||||||
class EnterSeedPhraseButton(BaseButton):
|
class EnterSeedPhraseButton(BaseButton):
|
||||||
|
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(EnterSeedPhraseButton, self).__init__(driver)
|
super(EnterSeedPhraseButton, self).__init__(driver)
|
||||||
self.locator = self.Locator.accessibility_id("enter-seed-phrase-button")
|
self.locator = self.Locator.accessibility_id("enter-seed-phrase-button")
|
||||||
|
|
||||||
|
|
||||||
class ReencryptYourKeyButton(BaseButton):
|
class ReencryptYourKeyButton(BaseButton):
|
||||||
|
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(ReencryptYourKeyButton, self).__init__(driver)
|
super(ReencryptYourKeyButton, self).__init__(driver)
|
||||||
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Re-encrypt your keys']")
|
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Re-encrypt your keys']")
|
||||||
|
|
||||||
|
|
||||||
class ConfirmRecoverAccess(BaseButton):
|
class ConfirmRecoverAccess(BaseButton):
|
||||||
|
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(ConfirmRecoverAccess, self).__init__(driver)
|
super(ConfirmRecoverAccess, self).__init__(driver)
|
||||||
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='RECOVER ACCESS']")
|
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='RECOVER ACCESS']")
|
||||||
|
|
||||||
class ContinueCustomSeedPhraseButton(BaseButton):
|
|
||||||
|
|
||||||
|
class ContinueCustomSeedPhraseButton(BaseButton):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(ContinueCustomSeedPhraseButton, self).__init__(driver)
|
super(ContinueCustomSeedPhraseButton, self).__init__(driver)
|
||||||
self.locator = self.Locator.accessibility_id("continue-custom-seed-phrase")
|
self.locator = self.Locator.accessibility_id("continue-custom-seed-phrase")
|
||||||
|
|
||||||
class CancelCustomSeedPhraseButton(BaseButton):
|
|
||||||
|
|
||||||
|
class CancelCustomSeedPhraseButton(BaseButton):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(CancelCustomSeedPhraseButton, self).__init__(driver)
|
super(CancelCustomSeedPhraseButton, self).__init__(driver)
|
||||||
self.locator = self.Locator.accessibility_id("cancel-custom-seed-phrase")
|
self.locator = self.Locator.accessibility_id("cancel-custom-seed-phrase")
|
||||||
|
@ -23,6 +23,32 @@ class MultiAccountOnLoginButton(BaseButton):
|
|||||||
self.locator = self.Locator.xpath_selector("(//*[@content-desc='chat-icon'])[%s]/.." % position)
|
self.locator = self.Locator.xpath_selector("(//*[@content-desc='chat-icon'])[%s]/.." % position)
|
||||||
|
|
||||||
|
|
||||||
|
class RecoverWithKeycardButton(BaseButton):
|
||||||
|
def __init__(self, driver):
|
||||||
|
super(RecoverWithKeycardButton, self).__init__(driver)
|
||||||
|
self.locator = self.Locator.accessibility_id("recover-with-keycard-button")
|
||||||
|
|
||||||
|
|
||||||
|
class BeginRecoveryButton(BaseButton):
|
||||||
|
def __init__(self, driver):
|
||||||
|
super(BeginRecoveryButton, self).__init__(driver)
|
||||||
|
self.locator = self.Locator.text_selector("Begin recovery")
|
||||||
|
|
||||||
|
def navigate(self):
|
||||||
|
from views.keycard_view import KeycardView
|
||||||
|
return KeycardView(self.driver)
|
||||||
|
|
||||||
|
def click(self):
|
||||||
|
self.scroll_to_element().click()
|
||||||
|
return self.navigate()
|
||||||
|
|
||||||
|
|
||||||
|
class PairToThisDeviceButton(BaseButton):
|
||||||
|
def __init__(self, driver):
|
||||||
|
super(PairToThisDeviceButton, self).__init__(driver)
|
||||||
|
self.locator = self.Locator.text_selector("Pair to this device")
|
||||||
|
|
||||||
|
|
||||||
class PasswordInput(BaseEditBox):
|
class PasswordInput(BaseEditBox):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(PasswordInput, self).__init__(driver)
|
super(PasswordInput, self).__init__(driver)
|
||||||
@ -222,6 +248,12 @@ class SignInView(BaseView):
|
|||||||
self.keycard_storage_button = KeycardKeyStorageButton(self.driver)
|
self.keycard_storage_button = KeycardKeyStorageButton(self.driver)
|
||||||
self.first_username_on_choose_chat_name = FirstKeyForChatText(self.driver)
|
self.first_username_on_choose_chat_name = FirstKeyForChatText(self.driver)
|
||||||
|
|
||||||
|
#keycard recovery
|
||||||
|
self.recover_with_keycard_button = RecoverWithKeycardButton(self.driver)
|
||||||
|
self.begin_recovery_button = BeginRecoveryButton(self.driver)
|
||||||
|
self.pair_to_this_device_button = PairToThisDeviceButton(self.driver)
|
||||||
|
|
||||||
|
|
||||||
def create_user(self, password=common_password, keycard=False):
|
def create_user(self, password=common_password, keycard=False):
|
||||||
self.get_started_button.click()
|
self.get_started_button.click()
|
||||||
self.generate_key_button.click()
|
self.generate_key_button.click()
|
||||||
@ -273,7 +305,7 @@ class SignInView(BaseView):
|
|||||||
from views.keycard_view import KeycardView
|
from views.keycard_view import KeycardView
|
||||||
keycard_view = KeycardView(self.driver)
|
keycard_view = KeycardView(self.driver)
|
||||||
keycard_view.enter_default_pin()
|
keycard_view.enter_default_pin()
|
||||||
keycard_view.connect_card_button.click()
|
keycard_view.connect_selected_card_button.click()
|
||||||
else:
|
else:
|
||||||
self.password_input.set_value(password)
|
self.password_input.set_value(password)
|
||||||
self.sign_in_button.click()
|
self.sign_in_button.click()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user