2018-01-14 17:43:36 +00:00
|
|
|
from views.base_element import BaseButton, BaseEditBox
|
2018-01-03 09:34:40 +00:00
|
|
|
from views.base_view import BaseView
|
2017-09-21 17:01:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
class FirstAccountButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(FirstAccountButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//android.widget.ScrollView//android.widget.TextView")
|
|
|
|
|
|
|
|
|
|
|
|
class PasswordInput(BaseEditBox):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(PasswordInput, self).__init__(driver)
|
2017-09-26 10:50:34 +00:00
|
|
|
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Password']")
|
2017-09-21 17:01:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SignInButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(SignInButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Sign in']")
|
|
|
|
|
2018-01-14 17:43:36 +00:00
|
|
|
def navigate(self):
|
|
|
|
from views.home_view import HomeView
|
|
|
|
return HomeView(self.driver)
|
|
|
|
|
2017-09-21 17:01:04 +00:00
|
|
|
|
2017-09-26 10:50:34 +00:00
|
|
|
class RecoverAccessButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(RecoverAccessButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//android.widget.TextView[@text='Recover access']")
|
|
|
|
|
2018-01-03 09:34:40 +00:00
|
|
|
def navigate(self):
|
|
|
|
from views.recover_access_view import RecoverAccessView
|
|
|
|
return RecoverAccessView(self.driver)
|
2017-09-26 10:50:34 +00:00
|
|
|
|
|
|
|
|
2018-01-03 09:34:40 +00:00
|
|
|
class SignInView(BaseView):
|
2017-09-21 17:01:04 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2018-01-03 09:34:40 +00:00
|
|
|
super(SignInView, self).__init__(driver)
|
2017-09-21 17:01:04 +00:00
|
|
|
self.driver = driver
|
|
|
|
|
|
|
|
self.first_account_button = FirstAccountButton(self.driver)
|
|
|
|
self.password_input = PasswordInput(self.driver)
|
|
|
|
self.sign_in_button = SignInButton(self.driver)
|
2017-09-26 10:50:34 +00:00
|
|
|
self.recover_access_button = RecoverAccessButton(self.driver)
|