def updateIsUse(IsUse): tableDo() conftest.click(ele=get_page('修改是否启用')) if IsUse == 'yes': conftest.click(ele=get_page('修改启用')) else: conftest.click(ele=get_page('修改禁用')) conftest.click(ele=get_page('修改提交'))
def addUserHaveDepart(ManagerNum, InvestigatorNum, isSubmit=None, password=None, Isxiangzhen=None, passwordType=None): clickFangshan() clickAddUser() conftest.send_keys(ele=get_page('各级管理员数量'), content=ManagerNum) conftest.send_keys(ele=get_page('各级调查员数量'), content=InvestigatorNum) if Isxiangzhen == 'yes': conftest.click(ele=get_page('创建子机构用户')) if passwordType == '相同': conftest.click(ele=get_page('相同密码')) conftest.send_keys(ele=get_page('相同密码输入'), content=password) if isSubmit == 'no': conftest.click(ele=get_page('取消')) else: conftest.click(ele=get_page('提交'))
def clickReset(): conftest.click(ele=get_page('重置'))
def noAddUser(): conftest.click(ele=get_page('取消'))
def clickFangshan(): conftest.click(ele=get_page('房山区'))
def clickSelectUser(content): conftest.send_keys(ele=get_page('查询框'), content=content) conftest.click(ele=get_page('查询'))
def clickAddUser(): time.sleep(3) return conftest.click(ele=get_page('新增用户'))
def logout(): conftest.click(ele=get_page('登出'))
def noUpdateUserMessage(): conftest.click(ele=get_page('修改取消'))
def updatePassword(newPassword): tableDo() conftest.send_keys(ele=get_page('修改密码'), content=newPassword) conftest.click(ele=get_page('修改提交'))
def intoUserManager(): conftest.click(ele=get_page('系统管理')) conftest.click(ele=get_page('用户管理')) return conftest.getText(ele=get_page('新增用户'))
def loginDo(username, password): conftest.send_keys(ele=get_loginpage('账号'), content=username) conftest.send_keys(ele=get_loginpage('密码'), content=password) conftest.click(ele=get_loginpage('登录'))
def upadateUserTel(Tel): tableDo() conftest.send_keys(ele=get_page('修改联系电话'), content=Tel) conftest.click(ele=get_page('修改提交'))
def updateUserID(userID): time.sleep(1) tableDo() conftest.send_keys(ele=get_page('修改身份证号码'), content=userID) conftest.click(ele=get_page('修改提交'))
def updateName(newName): tableDo() conftest.send_keys(ele=get_page('修改姓名'), content=newName) conftest.click(ele=get_page('修改提交'))
def tableDo(): return conftest.click(ele=get_page('操作'))