2017-08-28 10:02:20 +00:00
|
|
|
from views.base_view import BaseViewObject
|
|
|
|
from views.base_element import *
|
2017-09-11 10:43:42 +00:00
|
|
|
from tests import tests_data
|
2017-08-28 10:02:20 +00:00
|
|
|
|
|
|
|
|
2017-09-11 10:43:42 +00:00
|
|
|
class OkButtonAPK(BaseButton):
|
2017-08-28 10:02:20 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2017-09-11 10:43:42 +00:00
|
|
|
super(OkButtonAPK, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//*[@text='OK']")
|
2017-08-28 10:02:20 +00:00
|
|
|
|
|
|
|
|
2017-09-11 10:43:42 +00:00
|
|
|
class ContinueButtonAPK(BaseButton):
|
2017-08-31 13:39:41 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2017-09-11 10:43:42 +00:00
|
|
|
super(ContinueButtonAPK, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//*[@text='Continue']")
|
2017-08-31 13:39:41 +00:00
|
|
|
|
|
|
|
|
2017-09-26 10:50:34 +00:00
|
|
|
class ChatRequestInput(BaseEditBox):
|
2017-08-28 10:02:20 +00:00
|
|
|
|
|
|
|
def __init__(self, driver):
|
2017-09-26 10:50:34 +00:00
|
|
|
super(ChatRequestInput, self).__init__(driver)
|
2017-08-28 10:02:20 +00:00
|
|
|
self.locator = \
|
2017-09-26 10:50:34 +00:00
|
|
|
self.Locator.xpath_selector("//android.widget.EditText[@content-desc!='chat-message-input']")
|
2017-08-28 10:02:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RequestPasswordIcon(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(RequestPasswordIcon, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//*[@content-desc='request-password']")
|
|
|
|
|
2017-09-26 10:50:34 +00:00
|
|
|
def click(self):
|
|
|
|
self.wait_for_element(60)
|
|
|
|
self.find_element().click()
|
|
|
|
logging.info('Tap on %s' % self.name)
|
|
|
|
return self.navigate()
|
|
|
|
|
2017-08-28 10:02:20 +00:00
|
|
|
|
|
|
|
class HomeView(BaseViewObject):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(HomeView, self).__init__(driver)
|
2017-09-11 10:43:42 +00:00
|
|
|
self.continue_button_apk = ContinueButtonAPK(driver)
|
|
|
|
self.ok_button_apk = OkButtonAPK(driver)
|
2017-08-28 10:02:20 +00:00
|
|
|
|
2017-09-11 10:43:42 +00:00
|
|
|
for i in self.ok_button_apk, self.continue_button_apk:
|
2017-08-31 13:39:41 +00:00
|
|
|
try:
|
|
|
|
i.click()
|
|
|
|
except (NoSuchElementException, TimeoutException):
|
|
|
|
pass
|
2017-08-28 10:02:20 +00:00
|
|
|
|
2017-09-26 10:50:34 +00:00
|
|
|
self.chat_request_input = ChatRequestInput(driver)
|
2017-08-28 10:02:20 +00:00
|
|
|
self.request_password_icon = RequestPasswordIcon(driver)
|