class SettingPage(object): #将GetDriver()的方法拿过来用 def __init__(self): self.dr = GetDriver().dr #注意加GetDriver()用的是方法,而不是GetDriver类 #定位“退出登录” def Logout(self): try: self.logout = self.dr.find_element_by_xpath("//*[@text='退出登录']") except Exception as error: assert False, '未找到元素:退出登陆' return self.logout #定位修改密码 def ResetPassword(self): pass #定位清空缓存 def ClearCache(self): pass #定位意见返馈 def Feedback(self): pass #定位关于我们 def AboutUs(self): pass
class BaosPage(object): #将GetDriver()的方法拿过来用 def __init__(self): self.dr = GetDriver().dr #注意加GetDriver()用的是方法,而不是GetDriver类 #self.dr.hide_keyboard() # 隐藏键盘 #定位报事内容方法 def Content(self): try: #尝试寻找该元素,若找不到则给与提示 self.content = self.dr.find_element_by_id( 'com.meilin.wulianbaogj:id/content') except Exception as error: assert False, '未找到输入框' return self.content # #定义上传照片方法 # def Uploadimage(self): # try:#尝试寻找该元素,若找不到则给与提示 # self.uploadimage=self.dr.find_element_by_id('com.meilin.wulianbaogj:id/content')#(200,450) # self.uploadimage=self.dr.f # except Exception as error: # assert False,'未找到图片上传元素' # return self.uploadimage # #定义上传视频方法 # def Uploadvideo(self): # try: # self.uploadvideo=self.dr. #定义上传语音方法 def Noice(self): try: self.noice = TouchAction().long_press( 'com.meilin.wulianbaogj:id/talkBtn', 4000) except Exception as error: assert False, "未找到按钮" return self.noice #定义备注方法 def Notice(self): try: self.notice = self.dr.find_element_by_id( "com.meilin.wulianbaogj:id/remarkET") except Exception as error: assert False, "未找到按钮" return self.notice #定义提交方法 def Sub(self): try: self.sub = self.dr.find_element_by_xpath("//*[@text='提交']") except Exception as error: assert False, '未找到提交按钮' return self.sub
class MyPage(object): #将GetDriver()的方法拿过来用 def __init__(self): self.dr = GetDriver().dr #注意加GetDriver()用的是方法,而不是GetDriver类 #定位“设置” def Setting(self): try: self.setting = self.dr.find_element_by_xpath('"//*[@text="设置"]"') except Exception as error: assert False, '未找到元素:用户名' return self.setting #定位消息通知 def Message(self): pass #定位报事 def Baoshi(self): pass #d定位累计工单 def Leijigd(self): pass #定位累计投诉 def Leijits(self): pass #定位累计咨询 def Leijizx(self): pass #定位个人信息 def PersonMessage(self): pass
class Home_Index(object): def __init__(self): self.dr = GetDriver().dr def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def BaoXiu(self): try: self.baoxiu = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.baoxiu def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei def JiaoFei(self): try: self.jiaofei = self.dr.find_element_by_xpath('') except Exception as error: assert False, '未找到改元素' return self.jiaofei