Skip to content

Commit

Permalink
Update e2e test for new recovery flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhy committed Aug 8, 2019
1 parent fbdd308 commit 2b4d708
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
18 changes: 17 additions & 1 deletion test/appium/views/recover_access_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,21 @@ class PassphraseInput(BaseEditBox):

def __init__(self, driver):
super(PassphraseInput, self).__init__(driver)
self.locator = self.Locator.accessibility_id("enter-12-words")
self.locator = self.Locator.xpath_selector("//android.widget.EditText")


class EnterSeedPhraseButton(BaseButton):

def __init__(self, driver):
super(EnterSeedPhraseButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id("enter-seed-phrase-button")


class ReencryptYourKeyButton(BaseButton):

def __init__(self, driver):
super(ReencryptYourKeyButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Re-encrypt your key']")


class ConfirmRecoverAccess(BaseButton):
Expand Down Expand Up @@ -72,7 +86,9 @@ def __init__(self, driver):
self.driver = driver

self.passphrase_input = PassphraseInput(self.driver)
self.enter_seed_phrase_button = EnterSeedPhraseButton(self.driver)
self.confirm_recover_access = ConfirmRecoverAccess(self.driver)
self.reencrypt_your_key_button = ReencryptYourKeyButton(self.driver)
self.warnings = Warnings(self.driver)
self.confirm_phrase_button = ConfirmPhraseButton(self.driver)
self.cancel_button = CancelPhraseButton(self.driver)
19 changes: 12 additions & 7 deletions test/appium/views/sign_in_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def __init__(self, driver):
class CreatePasswordInput(BaseEditBox):
def __init__(self, driver):
super(CreatePasswordInput, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Create a password']"
"/following-sibling::android.widget.EditText")
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Create a password']/.."
"//android.widget.EditText")


class ConfirmYourPasswordInput(BaseEditBox):
def __init__(self, driver):
super(ConfirmYourPasswordInput, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Confirm your password']"
"/following-sibling::android.widget.EditText")
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Confirm your password']/.."
"//android.widget.EditText")


class SignInButton(BaseButton):
Expand Down Expand Up @@ -198,11 +198,16 @@ def recover_access(self, passphrase: str, password: str = common_password):
recover_access_view = self.add_existing_multiaccount_button.click()
else:
recover_access_view = self.access_key_button.click()
recover_access_view.enter_seed_phrase_button.click()
recover_access_view.passphrase_input.click()
recover_access_view.passphrase_input.set_value(passphrase)
recover_access_view.recover_account_password_input.click()
recover_access_view.recover_account_password_input.set_value(password)
recover_access_view.sign_in_button.click_until_presence_of_element(recover_access_view.home_button)
recover_access_view.next_button.click()
recover_access_view.reencrypt_your_key_button.click()
recover_access_view.next_button.click()
recover_access_view.create_password_input.set_value(password)
recover_access_view.next_button.click()
recover_access_view.confirm_your_password_input.set_value(password)
recover_access_view.next_button.click_until_presence_of_element(recover_access_view.home_button)
return self.get_home_view()

def sign_in(self, password=common_password):
Expand Down

0 comments on commit 2b4d708

Please sign in to comment.