status-mobile/test/appium/views/recover_access_view.py
Gheorghe Pinzaru 497af38a7f
Update usage for toolbars
Replace all the usage of the button without component

Use quo

Fix tests

List item in multiaccounts

Use list items in contacts

Fix welcome  screen button

Experiment long press

Big list item

Remove old bottom sheet

Use bottom sheet

Keycard

Add error to list item

Stickers panel button

Images panel

Fix z-index in profile

Fix android crash

Fix signing list item

Try fixing test

iOs gas sheet keyboard

Disable root alert in e2e

keycard signing sheet height

Clean up bottom sheet events

Replace flat list in profile

Memorise the manual-close value for bottom sheet

Mailserver QR scanner

Fix e2e tests

E2e fix 2

Fix e2e 3

Remove extra fn

Reduce bridging time for animation

Trick android layout

Try hooks

Fix profile missing ens-name

Disable press on control in list-view

allow disabling animations in list item

Use simple list in wallet assets settings

TBD - this screen should be rewritten from scratch. Now on every interaction the full list is re-rendered, also it makes the wallet main screen to re-render.

Fix send sheet

Handle long press in main thread

UI fixes

perf

Update e2e

fix missing user name in image long press

Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
2020-07-06 13:35:50 +03:00

109 lines
3.7 KiB
Python

from views.base_element import BaseEditBox, BaseButton, BaseElement
from views.sign_in_view import SignInView
class SeedphraseInput(BaseEditBox):
def __init__(self, driver):
super(SeedphraseInput, self).__init__(driver)
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 keys']")
class ConfirmRecoverAccess(BaseButton):
def __init__(self, driver):
super(ConfirmRecoverAccess, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='RECOVER ACCESS']")
class ContinueCustomSeedPhraseButton(BaseButton):
def __init__(self, driver):
super(ContinueCustomSeedPhraseButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id("continue-custom-seed-phrase")
class CancelCustomSeedPhraseButton(BaseButton):
def __init__(self, driver):
super(CancelCustomSeedPhraseButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id("cancel-custom-seed-phrase")
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")
class RecoverAccessView(SignInView):
def __init__(self, driver):
super(RecoverAccessView, self).__init__(driver, skip_popups=False)
self.driver = driver
self.seedphrase_input = SeedphraseInput(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)
self.continue_custom_seed_phrase_button = ContinueCustomSeedPhraseButton(self.driver)
self.cancel_custom_seed_phrase_button = CancelCustomSeedPhraseButton(self.driver)