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.contacts_view import ContactsView
|
|
|
|
|
|
|
|
|
|
|
|
class AddNewContactButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(AddNewContactButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
2018-02-07 13:18:55 +00:00
|
|
|
"//android.widget.TextView[@text='Start new chat']")
|
2018-01-03 09:34:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
class NewGroupChatButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(NewGroupChatButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
2018-02-07 13:18:55 +00:00
|
|
|
"//android.widget.TextView[@text='Start group chat']")
|
2018-01-03 09:34:40 +00:00
|
|
|
|
|
|
|
|
2018-02-14 13:48:18 +00:00
|
|
|
class JoinPublicChatButton(BaseButton):
|
|
|
|
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(JoinPublicChatButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
|
|
|
"//android.widget.TextView[@text='Join public chat']")
|
|
|
|
|
|
|
|
|
2018-01-03 09:34:40 +00:00
|
|
|
class NameEditBox(BaseEditBox):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(NameEditBox, self).__init__(driver)
|
|
|
|
self.locator = \
|
|
|
|
self.Locator.xpath_selector("//android.widget.EditText[@NAF='true']")
|
|
|
|
|
|
|
|
|
2018-02-07 13:18:55 +00:00
|
|
|
class OpenDAapButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(OpenDAapButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
|
|
|
"//android.widget.TextView[@text='Open ÐApp']")
|
|
|
|
|
|
|
|
|
|
|
|
class OpenButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(OpenButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector(
|
|
|
|
"//android.widget.TextView[@text='Open']")
|
|
|
|
|
|
|
|
|
2018-02-14 13:48:18 +00:00
|
|
|
class ConfirmButton(BaseButton):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(ConfirmButton, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector('(//android.view.ViewGroup[@content-desc="icon"])[2]')
|
|
|
|
|
|
|
|
|
2018-02-13 17:22:41 +00:00
|
|
|
class EnterUrlEditbox(BaseEditBox):
|
2018-01-03 09:34:40 +00:00
|
|
|
def __init__(self, driver):
|
2018-02-13 17:22:41 +00:00
|
|
|
super(EnterUrlEditbox, self).__init__(driver)
|
|
|
|
self.locator = self.Locator.xpath_selector("//android.widget.EditText")
|
|
|
|
|
|
|
|
|
|
|
|
class StartNewChatView(ContactsView):
|
|
|
|
def __init__(self, driver):
|
|
|
|
super(StartNewChatView, self).__init__(driver)
|
2018-01-03 09:34:40 +00:00
|
|
|
|
|
|
|
self.add_new_contact = AddNewContactButton(self.driver)
|
|
|
|
self.new_group_chat_button = NewGroupChatButton(self.driver)
|
2018-02-14 13:48:18 +00:00
|
|
|
self.join_public_chat_button = JoinPublicChatButton(self.driver)
|
2018-01-03 09:34:40 +00:00
|
|
|
|
2018-02-07 13:18:55 +00:00
|
|
|
self.open_d_app_button = OpenDAapButton(self.driver)
|
|
|
|
self.open_button = OpenButton(self.driver)
|
|
|
|
|
2018-01-03 09:34:40 +00:00
|
|
|
self.name_edit_box = NameEditBox(self.driver)
|
2018-02-13 17:22:41 +00:00
|
|
|
self.enter_url_editbox = EnterUrlEditbox(self.driver)
|
2018-02-14 13:48:18 +00:00
|
|
|
self.confirm_button = ConfirmButton(self.driver)
|