class HomewebPromisePage():
    def __init__(self, driver):

        self.driver = driver

        self.findelement = FindElement(self.driver)

        self.action = SeleniumAction(self.driver)

    def getelement_createpromisebtn(self):

        return self.findelement.get_element('createpromisebtn')

    def getelement_promisetitleinput(self):

        return self.findelement.get_element('promisetitleinput')

    def getelement_promiseinput(self):

        return self.findelement.get_element('promiseinput')

    def getlabel1(self):

        return self.findelement.get_element('label1')

    def getlabel2(self):

        return self.findelement.get_element('label2')

    def getelement_actbegintime(self):

        return self.findelement.get_element('actbegintime')

    def getelement_promisepeople(self):

        return self.findelement.get_element('promisepeople')

    def getelement_sendpeoplebtn(self):

        return self.findelement.get_element('sendpeoplebt')

    def getelement_creatbtn1(self):

        return self.findelement.get_element('creatbtn1')

    def getelement_createbtn2(self):

        return self.findelement.get_element('createbtn2')

    def geteles_listpromisetitle(self):

        return self.findelement.get_elements('listpromisetitle')
class HomewebCulturePage():

    def __init__(self,driver:WebDriver):

        self.driver = driver

        self.findelement = FindElement(self.driver)

    def goto_createpage(self):

        self.findelement.get_element('createpage').click()

    def getelement_cultitleinput(self):

        return  self.findelement.get_element('cultitleinput')

    def getelement_culcontextinput(self):

        return self.findelement.get_element('culcontextinput')

    def getelment_createbtn(self):

        return self.findelement.get_element('culcreatebtn')

    def getelement_linkbtn(self):

        return self.findelement.get_element('linkbtn')

    def getelement_culhrefinput(self):

        return self.findelement.get_element('culhrefinput')

    def getelement_culbtn(self):

        return self.findelement.get_element('culbtn')
class HomewebAnnouncePage():

    def __init__(self,driver):
        self.driver =driver
        self.findment = FindElement(self.driver)

    def goto_createpage(self):

        self.findment.get_element('announcecreatepage').click()

    def getelement_antitleinput(self):

        return self.findment.get_element('antitleinput')

    def getelement_aninput(self):

        return self.findment.get_element('aninput')

    def getelement_createbtn(self):

        return self.findment.get_element('createbtn')


    def geteles_listanncontext(self):

        return self.findment.get_element('listanncontext')

    def geteles_listanntitle(self):

        return self.findment.get_element('listanntitle')
class HomewebUserPage():
    def __init__(self, driver: WebDriver):

        self.driver = driver

        self.findelement = FindElement(self.driver)

    def goto_edituserpage(self):

        self.findelement.get_element('edituserpage').click()

    def getelement_inputname(self):

        return self.findelement.get_element('inputname')

    def getelement_inputEnglishname(self):

        return self.findelement.get_element('inputEnglishname')

    def getelement_inputwxname(self):

        return self.findelement.get_element('inputwxname')

    def getelement_inputfacebookname(self):

        return self.findelement.get_element('inputfacebookname')

    def getelement_usereditbtn(self):

        return self.findelement.get_element('usereditbtn')
class HomewebReportPage():
    def __init__(self, driver: WebDriver):

        self.driver = driver

        self.findelement = FindElement(self.driver)
        self.action = SeleniumAction(self.driver)

    def getelement_createbtn(self):

        return self.findelement.get_element('artcreatebtn')

    def goto_createpage(self):

        self.getelement_createbtn().click()

    def getelemts_reporttypes(self):

        eles = self.findelement.get_elements('reporttype')

        return eles

    def getelement_reporttypebtn(self):

        return self.findelement.get_element('reporttypebtn')

    def getelement_jobsuminput(self):

        return self.findelement.get_element('jobsuminput')

    def getelement_jobplaninput(self):

        return self.findelement.get_element('jobplaninput')

    def getelement_createjobbtn(self):

        return self.findelement.get_element('createjobbtn')

    def getelement_productinput(self):

        return self.findelement.get_element('productinput')

    def getelement_saleinput(self):

        return self.findelement.get_element('saleinput')

    def getelement_input(self):

        return self.findelement.get_element('input')
class HomewebBasePage():
    def __init__(self, driver):
        self.driver = driver
        self.findelemnt = FindElement(self.driver)

        self.action = SeleniumAction(self.driver)

    def getele_imgurl(self):

        return self.findelemnt.get_element("imgurl")

    def getele_teamkitlogo(self):

        return self.findelemnt.get_element("teamkitlogo")

    def gettext_teamkitlogo(self):
        '''获取定位值'''
        return self.action.get_elementtext(self.getele_teamkitlogo())

    def getele_addactbtn(self):

        return self.findelemnt.get_element('addactbtn')

    def getele_addacttitleinput(self):

        return self.findelemnt.get_element("addtitleinput")

    def getele_addactbegintimeinput(self):

        return self.findelemnt.get_element('addactbegintimeinput')

    def getele_addactcontentinput(self):

        return self.findelemnt.get_element('addactinput')

    def geteles_addactbtns(self):

        return self.findelemnt.get_element('addactbtns')

    def getele_submitbtn(self):

        return self.geteles_addactbtns()[1]

    def getele_submitbycss(self):
        return self.findelemnt.get_element("submitbycss")
class BasePage():
    def __init__(self, driver):
        self.driver = driver
        self.findelement = FindElement(self.driver)
        self.actionElement = SeleniumAction(self.driver)

    def get_element_zhzxspan(self):

        return self.findelement.get_element("zhzxspan")

    def get_element_tkspan(self):

        return self.findelement.get_element("tkspan")

    def get_element_tdglspan(self):

        return self.findelement.get_element("tdglspan")

    def click_element_zhzxspan(self):

        self.actionElement.click_ele(self.get_element_zhzxspan())

    def click_element_tkspan(self):

        self.actionElement.click_ele(self.get_element_tkspan())

    def click_element_tdglspan(self):

        self.actionElement.click_ele(self.get_element_tdglspan())

    def getvalue_element(self):

        return self.actionElement.get_elementtext(self.get_element())

    def gettitle_base(self):

        return self.actionElement.get_title()

    def geteles_yhgllist(self):
        '''获取用户管理列表数据的元素,为element list 形式'''

        eles = self.findelement.get_element("yhgllist")

        return eles

    def getvalue_yhgllist(self):
        '''获取用户管理列表的数据'''

        yhgllistdata = []
        for i in self.geteles_yhgllist():
            data = self.actionElement.get_elementtext(i)
            yhgllistdata.append(data)

        return yhgllistdata

    def get_element_xztdbtn(self):
        ''' 获取新增团队按钮'''
        return self.findelement.get_element("xztdbtn")

    def get_element_ssyyinput(self):
        '''获取搜索应用输入框'''
        return self.findelement.get_element("ssyyinput")

    def get_element_xzteamkitspan(self):
        '''获取选择Teamkit span'''
        return self.findelement.get_element("xzteamkitspan")

    def get_element_xzuserspaninput(self):
        '''获取选择用户输入框'''
        return self.findelement.get_element("xzuserspaninput")

    def get_elements_xzuserspan(self):
        '''获取选择用户列表'''
        return self.findelement.get_element("xzuserspaneles")

    def get_element_userspan(self, phone):
        '''从选择用户列表中获取某个用户'''
        # 这里如果调用封装的FindElement则无法将参数为动态获取,如果没有调用封装则没有写日志
        # return self.findelement.get_childelement(self.get_elements_xzuserspan(),)
        return self.get_elements_xzuserspan().find_element_by_link_text(phone)

    def get_element_teamnameinput(self):
        '''获取团队名称输入框'''
        return self.findelement.get_element("teamnameinput")

    def get_element_companyinput(self):
        '''获取公司名称输入框'''

        return self.findelement.get_element("companyinput")

    def get_element_accpetbtn(self):
        '''获取确定按钮'''

        return self.findelement.get_element("acceptbtn")

    def get_element_cancelbtnbtn(self):
        '''获取取消按钮'''

        return self.findelement.get_element("cancelbtn")