2018-10-04 09:51:03 +00:00
|
|
|
from views.base_element import BaseEditBox, BaseButton, BaseElement
|
2018-01-03 09:34:40 +00:00
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
|
|
|
|
|
2020-02-12 10:10:19 +00:00
|
|
|
class SeedphraseInput(BaseEditBox):
|
2018-01-03 09:34:40 +00:00
|
|
|
def __init__(self, driver):
|
2020-02-12 10:10:19 +00:00
|
|
|
super(SeedphraseInput, self).__init__(driver)
|
2019-08-01 15:49:33 +00:00
|
|
|
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)
|
2019-12-21 15:55:19 +00:00
|
|
|
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Re-encrypt your keys']")
|
2018-01-03 09:34:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ConfirmRecoverAccess(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ConfirmRecoverAccess, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='RECOVER ACCESS']")
|
|
|
|
|
2019-09-18 07:20:29 +00:00
|
|
|
|
2020-07-09 11:37:10 +00:00
|
|
|
class ContinueCustomSeedPhraseButton(BaseButton):
|
2019-09-18 07:20:29 +00:00
|
|
|
def __init__(self, driver):
|
|
|
|
super(ContinueCustomSeedPhraseButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id("continue-custom-seed-phrase")
|
|
|
|
|
|
|
|
|
2020-07-09 11:37:10 +00:00
|
|
|
class CancelCustomSeedPhraseButton(BaseButton):
|
2019-09-18 07:20:29 +00:00
|
|
|
def __init__(self, driver):
|
|
|
|
super(CancelCustomSeedPhraseButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.accessibility_id("cancel-custom-seed-phrase")
|
|
|
|
|
2018-01-03 09:34:40 +00:00
|
|
|
|
2018-10-04 09:51:03 +00:00
|
|
|
class RequiredField(BaseElement):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super().__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector("Required field")
|
|
|
|
|
|
|
|
|
|
|
|
class InvalidRecoveryPhrase(BaseElement):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super().__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector("Recovery phrase is invalid")
|
|
|
|
|
|
|
|
|
|
|
|
class TooShortPassword(BaseElement):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super().__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector("Password is too short")
|
|
|
|
|
|
|
|
|
|
|
|
class MisspelledWords(BaseElement):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super().__init__(driver)
|
|
|
|
self.locator = self.Locator.text_selector("Some words might be misspelled")
|
|
|
|
|
|
|
|
|
|
|
|
class Warnings(BaseElement):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super().__init__(driver)
|
|
|
|
self.required_field = RequiredField(driver)
|
|
|
|
self.invalid_recovery_phrase = InvalidRecoveryPhrase(driver)
|
|
|
|
self.too_short_password = TooShortPassword(driver)
|
|
|
|
self.misspelled_words = MisspelledWords(driver)
|
|
|
|
|
|
|
|
|
|
|
|
class ConfirmPhraseButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super().__init__(driver)
|
|
|
|
self.locator = self.Locator.id("android:id/button1")
|
|
|
|
|
|
|
|
def navigate(self):
|
|
|
|
from views.home_view import HomeView
|
|
|
|
return HomeView(self.driver)
|
|
|
|
|
|
|
|
|
|
|
|
class CancelPhraseButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super().__init__(driver)
|
|
|
|
self.locator = self.Locator.id("android:id/button2")
|
|
|
|
|
|
|
|
|
2018-01-03 09:34:40 +00:00
|
|
|
class RecoverAccessView(SignInView):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
2020-05-19 10:40:39 +00:00
|
|
|
super(RecoverAccessView, self).__init__(driver, skip_popups=False)
|
2018-01-03 09:34:40 +00:00
|
|
|
self.driver = driver
|
|
|
|
|
2020-02-12 10:10:19 +00:00
|
|
|
self.seedphrase_input = SeedphraseInput(self.driver)
|
2019-08-01 15:49:33 +00:00
|
|
|
self.enter_seed_phrase_button = EnterSeedPhraseButton(self.driver)
|
2018-01-03 09:34:40 +00:00
|
|
|
self.confirm_recover_access = ConfirmRecoverAccess(self.driver)
|
2019-08-01 15:49:33 +00:00
|
|
|
self.reencrypt_your_key_button = ReencryptYourKeyButton(self.driver)
|
2018-10-04 09:51:03 +00:00
|
|
|
self.warnings = Warnings(self.driver)
|
|
|
|
self.confirm_phrase_button = ConfirmPhraseButton(self.driver)
|
|
|
|
self.cancel_button = CancelPhraseButton(self.driver)
|
2019-09-18 07:20:29 +00:00
|
|
|
self.continue_custom_seed_phrase_button = ContinueCustomSeedPhraseButton(self.driver)
|
|
|
|
self.cancel_custom_seed_phrase_button = CancelCustomSeedPhraseButton(self.driver)
|